Skip to main content

Azure resource topology visualization tool - Python implementation inspired by the PowerShell AzViz module

Project description

Python AzViz

A modern Python implementation for automatically generating Azure resource topology diagrams, inspired by the PowerShell AzViz module.

Overview

Python AzViz generates visual diagrams of Azure Resource Groups and their dependencies by:

  • Discovering Azure resources using Azure Management APIs
  • Mapping resource relationships and dependencies
  • Creating graph visualizations using NetworkX and Graphviz
  • Supporting multiple themes and output formats

Features

  • Azure Resource Discovery: Automatically finds resources and dependencies
  • Network Topology Mapping: Maps VNets, subnets, and network relationships
  • VM Power State Visualization: Shows running/stopped status with color coding
  • Visual Themes: Light, dark, and neon color schemes
  • Multiple Formats: PNG and SVG output support
  • Flexible Filtering: Include/exclude specific resource types
  • Icon Integration: 40+ Azure service icons for visual clarity
  • Hybrid Layout: Horizontal resource groups with vertical resource stacking
  • Private Link Support: Visualizes Private Endpoints and Private Link Services

Installation

Prerequisites

  • Python 3.8+
  • Graphviz installed on your system
  • Azure CLI or Azure credentials configured

Install Graphviz

Ubuntu/Debian:

sudo apt-get install graphviz

macOS:

brew install graphviz

Windows: Download from https://graphviz.org/download/

Option 1: Install Python AzViz (Future)

pip install python-azviz

Option 2: Run Directly from Source

# Clone the repository
git clone https://github.com/rut31337/python-azviz.git
cd python-azviz

# Install dependencies
pip install -r requirements.txt

# Run directly using wrapper script
python azviz.py --help
python azviz.py export --resource-group my-rg
python azviz.py list-rg

Option 3: Development Installation

# Install in editable mode for development
pip install -e .
python-azviz --help

Quick Start

from azviz import AzViz

# Initialize with Azure credentials
viz = AzViz()

# Generate diagram for all resource groups
viz.export_diagram(
    resource_group=[],  # Empty list = all RGs
    output_file="all-resources.png",
    theme="light"
)

# Generate diagram for specific resource group
viz.export_diagram(
    resource_group="my-resource-group",
    output_file="my-diagram.png",
    theme="light"
)

CLI Usage

# Diagram all resource groups in subscription
python-azviz export --output all-resources.png

# Basic usage for specific resource group
python-azviz export --resource-group my-rg --output diagram.png

# With custom theme and format
python-azviz export --resource-group my-rg --theme dark --format svg --output diagram.svg

# Multiple resource groups
python-azviz export -g rg1 -g rg2 -g rg3 --output multi-rg.png

Configuration

Authentication

Python AzViz supports multiple authentication methods:

  • Azure CLI (az login)
  • Environment variables
  • Managed Identity
  • Service Principal

Themes

  • light: Light background with dark text
  • dark: Dark background with light text
  • neon: High-contrast neon colors

Output Formats

  • png: Portable Network Graphics
  • svg: Scalable Vector Graphics

Examples

See the examples/ directory for more usage examples.

Migration from PowerShell AzViz

Python AzViz maintains compatibility with the original PowerShell version:

  • Same parameter names and behavior
  • Identical output formats and themes
  • Compatible icon system

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

License

MIT License - see LICENSE file for details.

Credits

  • Original PowerShell AzViz by Prateek Kumar Singh
  • Python implementation by Patrick Rutledge with assistance from Claude AI
  • Azure service icons from Microsoft's official Azure Architecture Icons

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_azviz-1.0.0.tar.gz (164.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_azviz-1.0.0-py3-none-any.whl (182.3 kB view details)

Uploaded Python 3

File details

Details for the file python_azviz-1.0.0.tar.gz.

File metadata

  • Download URL: python_azviz-1.0.0.tar.gz
  • Upload date:
  • Size: 164.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for python_azviz-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2b8b4342a30316924482c8b0db1c1cad7bfdbe00ad7ae9d70c0cbff19f87cd23
MD5 09718054ee3732a6d26c09fa8a767120
BLAKE2b-256 0fbf4b021d54fc4b355eb97d0d9daabc158d3f7c8c7399f1c6c927a0bc135a45

See more details on using hashes here.

File details

Details for the file python_azviz-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: python_azviz-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 182.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for python_azviz-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 507ae45b7fd678f53b953997ab277e6248cf80875e84a50247c03ed56563e0cd
MD5 20d009def53b28b69a6066c0edd06db0
BLAKE2b-256 17449bf5a5db9bdb152cf718d6f6c009e1f580f16ebaa1769351dc8d7d1f96ba

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page