# Python AzViz
A modern Python implementation for automatically generating Azure resource topology diagrams, inspired by the PowerShell [AzViz](https://github.com/PrateekKumarSingh/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
- **Subscription Flexibility**: Support for both subscription IDs and names
- **Network Topology Mapping**: Maps VNets, subnets, and network relationships
- **Enhanced Icon Visibility**: Properly sized subnet icons and resource-specific icons
- **VM Power State Visualization**: Shows running/stopped status with color coding
- **Visual Themes**: Light, dark, and neon color schemes
- **Multiple Formats**: PNG, SVG, and interactive HTML output support
- **Flexible Filtering**: Include/exclude specific resource types
- **Icon Integration**: 56+ Azure service icons for visual clarity
- **Optimized Layout**: External resource group titles, left-to-right resource ordering
- **Advanced Dependencies**: SSH keys, managed identities, gallery hierarchies, DNS zones
- **Private Link Support**: Visualizes Private Endpoints and Private Link Services
- **Cross-Resource Group**: Discovers dependencies across resource groups
- **Storage Account Relationships**: Connects VMs to storage accounts and diagnostics
- **Compute-Only View**: Focus on compute resources and their direct dependencies
- **Smart Edge Filtering**: Removes redundant bidirectional arrows for cleaner diagrams
- **Horizontal VM-Storage Alignment**: Related storage appears next to VMs
## Example Output
### Full Topology View
Shows all Azure resources and their relationships across the subscription:

### Compute-Only View
Focuses on compute resources (VMs, disks, clusters) and their directly related infrastructure:

The compute-only view filters 49 resources down to 21 focused on compute infrastructure, making it easier to understand VM deployments, storage attachments, and networking dependencies.
## Installation
### Prerequisites
- Python 3.9+
- [Graphviz](https://graphviz.org/download/) installed on your system
- Azure CLI or Azure credentials configured
### Install Graphviz
**Ubuntu/Debian:**
```bash
sudo apt-get install graphviz
```
**macOS:**
```bash
brew install graphviz
```
**Windows:**
Download from https://graphviz.org/download/
### Option 1: Install Python AzViz
```bash
pip install python-azviz
```
### Option 2: Run Directly from Source
```bash
# 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_wrapper.py --help
python azviz_wrapper.py export --resource-group my-rg
python azviz_wrapper.py list-rg
```
### Option 3: Development Installation
```bash
# Install in editable mode for development
pip install -e .
python-azviz --help
```
## Quick Start
```python
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
```bash
# 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
# Interactive HTML output
python-azviz export --resource-group my-rg --format html --output diagram.html
# Multiple resource groups
python-azviz export -g rg1 -g rg2 -g rg3 --output multi-rg.png
# Using subscription by name instead of ID
python-azviz export --subscription "My Production Subscription" --output prod.png
# Using subscription by ID
python-azviz export --subscription "12345678-1234-1234-1234-123456789012" --output prod.png
# Focus on compute resources only (VMs, disks, storage, networking)
python-azviz export --compute-only --output compute-topology.png
python-azviz export --resource-group my-rg --compute-only --output my-compute.png
# Save DOT source file for debugging
python-azviz export --save-dot --resource-group my-rg --output diagram.png
# Different label verbosity levels (1=minimal, 2=standard, 3=detailed)
python-azviz export --verbosity 1 --resource-group my-rg --output minimal.png
python-azviz export --verbosity 3 --resource-group my-rg --output detailed.png
# Advanced filtering
python-azviz export --exclude "*.subnets" --exclude "*.disks" --resource-group my-rg
# List resource groups in specific subscription
python-azviz list-rg --subscription "My Dev Subscription"
# Preview resources before generating diagram
python-azviz preview my-rg --subscription "My Test Subscription"
```
## Configuration
### Subscription Selection
Python AzViz supports flexible subscription targeting:
- **By Name**: `--subscription "My Production Subscription"`
- **By ID**: `--subscription "12345678-1234-1234-1234-123456789012"`
- **Partial Matching**: `--subscription "Production"` (must be unique)
- **Auto-detection**: Uses first available subscription if not specified
### 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
- `html`: Interactive HTML with zoom, pan, and drag capabilities
### Filtering Options
- **Compute-Only**: `--compute-only` focuses on compute resources and their direct dependencies
- Includes: VMs, disks, SSH keys, galleries, AKS/OpenShift clusters
- Related: Network interfaces, VNets, subnets, NSGs, load balancers, storage accounts, managed identities
- Perfect for understanding compute infrastructure deployments
- **Exclude Types**: `--exclude "*.subnets"` to exclude specific resource types
### Verbose Output
- **Normal mode**: Clean output with Graphviz warnings suppressed
- **Verbose mode** (`--verbose` or `-v`): Shows all debug information including Graphviz warnings and processing details
### Supported Azure Resources
Python AzViz automatically discovers and visualizes these Azure resource types with proper relationships:
**Compute**
- Virtual Machines (with power state visualization)
- Virtual Machine Scale Sets
- SSH Public Keys
- Azure Compute Galleries, Images, and Versions
**Network**
- Virtual Networks and Subnets
- Network Interfaces
- Public IP Addresses
- Load Balancers
- Network Security Groups
- Route Tables
- Private Endpoints
- Private Link Services
- DNS Zones (Public and Private)
- Private DNS Zones and VNet Links
**Storage**
- Storage Accounts (with VM diagnostic relationships)
- Managed Disks
**Identity**
- User-Assigned Managed Identities
**Container**
- Azure Red Hat OpenShift Clusters
- Azure Kubernetes Service Clusters
**Other**
- Resource Groups (as containers)
- Cross-resource group dependencies
- Internet connectivity visualization
## 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](LICENSE) file for details.
## Credits
- Original PowerShell AzViz by [Prateek Kumar Singh](https://github.com/PrateekKumarSingh/AzViz)
- Python implementation by [Patrick Rutledge](https://github.com/rut31337) with assistance from Claude AI
- Azure service icons from Microsoft's official Azure Architecture Icons
Raw data
{
"_id": null,
"home_page": null,
"name": "python-azviz",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "azure, visualization, topology, graph, cloud, infrastructure",
"author": null,
"author_email": "Patrick Rutledge <rut31337@users.noreply.github.com>",
"download_url": "https://files.pythonhosted.org/packages/2c/ca/f2f9b7f94b78e0d38b0857ca9c13064a1c59cfb76dd057711a5f6ff02f28/python_azviz-1.1.4.tar.gz",
"platform": null,
"description": "# Python AzViz\n\nA modern Python implementation for automatically generating Azure resource topology diagrams, inspired by the PowerShell [AzViz](https://github.com/PrateekKumarSingh/AzViz) module.\n\n## Overview\n\nPython AzViz generates visual diagrams of Azure Resource Groups and their dependencies by:\n- Discovering Azure resources using Azure Management APIs\n- Mapping resource relationships and dependencies\n- Creating graph visualizations using NetworkX and Graphviz\n- Supporting multiple themes and output formats\n\n## Features\n\n- **Azure Resource Discovery**: Automatically finds resources and dependencies\n- **Subscription Flexibility**: Support for both subscription IDs and names\n- **Network Topology Mapping**: Maps VNets, subnets, and network relationships\n- **Enhanced Icon Visibility**: Properly sized subnet icons and resource-specific icons\n- **VM Power State Visualization**: Shows running/stopped status with color coding\n- **Visual Themes**: Light, dark, and neon color schemes\n- **Multiple Formats**: PNG, SVG, and interactive HTML output support\n- **Flexible Filtering**: Include/exclude specific resource types\n- **Icon Integration**: 56+ Azure service icons for visual clarity\n- **Optimized Layout**: External resource group titles, left-to-right resource ordering\n- **Advanced Dependencies**: SSH keys, managed identities, gallery hierarchies, DNS zones\n- **Private Link Support**: Visualizes Private Endpoints and Private Link Services\n- **Cross-Resource Group**: Discovers dependencies across resource groups\n- **Storage Account Relationships**: Connects VMs to storage accounts and diagnostics\n- **Compute-Only View**: Focus on compute resources and their direct dependencies\n- **Smart Edge Filtering**: Removes redundant bidirectional arrows for cleaner diagrams\n- **Horizontal VM-Storage Alignment**: Related storage appears next to VMs\n\n## Example Output\n\n### Full Topology View\nShows all Azure resources and their relationships across the subscription:\n\n\n\n### Compute-Only View\nFocuses on compute resources (VMs, disks, clusters) and their directly related infrastructure:\n\n\n\nThe compute-only view filters 49 resources down to 21 focused on compute infrastructure, making it easier to understand VM deployments, storage attachments, and networking dependencies.\n\n## Installation\n\n### Prerequisites\n- Python 3.9+\n- [Graphviz](https://graphviz.org/download/) installed on your system\n- Azure CLI or Azure credentials configured\n\n### Install Graphviz\n**Ubuntu/Debian:**\n```bash\nsudo apt-get install graphviz\n```\n\n**macOS:**\n```bash\nbrew install graphviz\n```\n\n**Windows:**\nDownload from https://graphviz.org/download/\n\n### Option 1: Install Python AzViz\n```bash\npip install python-azviz\n```\n\n### Option 2: Run Directly from Source\n```bash\n# Clone the repository\ngit clone https://github.com/rut31337/python-azviz.git\ncd python-azviz\n\n# Install dependencies\npip install -r requirements.txt\n\n# Run directly using wrapper script\npython azviz_wrapper.py --help\npython azviz_wrapper.py export --resource-group my-rg\npython azviz_wrapper.py list-rg\n```\n\n### Option 3: Development Installation\n```bash\n# Install in editable mode for development\npip install -e .\npython-azviz --help\n```\n\n## Quick Start\n\n```python\nfrom azviz import AzViz\n\n# Initialize with Azure credentials\nviz = AzViz()\n\n# Generate diagram for all resource groups\nviz.export_diagram(\n resource_group=[], # Empty list = all RGs\n output_file=\"all-resources.png\",\n theme=\"light\"\n)\n\n# Generate diagram for specific resource group\nviz.export_diagram(\n resource_group=\"my-resource-group\",\n output_file=\"my-diagram.png\",\n theme=\"light\"\n)\n```\n\n### CLI Usage\n```bash\n# Diagram all resource groups in subscription\npython-azviz export --output all-resources.png\n\n# Basic usage for specific resource group\npython-azviz export --resource-group my-rg --output diagram.png\n\n# With custom theme and format\npython-azviz export --resource-group my-rg --theme dark --format svg --output diagram.svg\n\n# Interactive HTML output\npython-azviz export --resource-group my-rg --format html --output diagram.html\n\n# Multiple resource groups\npython-azviz export -g rg1 -g rg2 -g rg3 --output multi-rg.png\n\n# Using subscription by name instead of ID\npython-azviz export --subscription \"My Production Subscription\" --output prod.png\n\n# Using subscription by ID\npython-azviz export --subscription \"12345678-1234-1234-1234-123456789012\" --output prod.png\n\n# Focus on compute resources only (VMs, disks, storage, networking)\npython-azviz export --compute-only --output compute-topology.png\npython-azviz export --resource-group my-rg --compute-only --output my-compute.png\n\n# Save DOT source file for debugging\npython-azviz export --save-dot --resource-group my-rg --output diagram.png\n\n# Different label verbosity levels (1=minimal, 2=standard, 3=detailed)\npython-azviz export --verbosity 1 --resource-group my-rg --output minimal.png\npython-azviz export --verbosity 3 --resource-group my-rg --output detailed.png\n\n# Advanced filtering\npython-azviz export --exclude \"*.subnets\" --exclude \"*.disks\" --resource-group my-rg\n\n# List resource groups in specific subscription\npython-azviz list-rg --subscription \"My Dev Subscription\"\n\n# Preview resources before generating diagram\npython-azviz preview my-rg --subscription \"My Test Subscription\"\n```\n\n## Configuration\n\n### Subscription Selection\nPython AzViz supports flexible subscription targeting:\n- **By Name**: `--subscription \"My Production Subscription\"`\n- **By ID**: `--subscription \"12345678-1234-1234-1234-123456789012\"`\n- **Partial Matching**: `--subscription \"Production\"` (must be unique)\n- **Auto-detection**: Uses first available subscription if not specified\n\n### Authentication\nPython AzViz supports multiple authentication methods:\n- Azure CLI (`az login`)\n- Environment variables\n- Managed Identity\n- Service Principal\n\n### Themes\n- `light`: Light background with dark text\n- `dark`: Dark background with light text\n- `neon`: High-contrast neon colors\n\n### Output Formats\n- `png`: Portable Network Graphics\n- `svg`: Scalable Vector Graphics\n- `html`: Interactive HTML with zoom, pan, and drag capabilities\n\n### Filtering Options\n- **Compute-Only**: `--compute-only` focuses on compute resources and their direct dependencies\n - Includes: VMs, disks, SSH keys, galleries, AKS/OpenShift clusters\n - Related: Network interfaces, VNets, subnets, NSGs, load balancers, storage accounts, managed identities\n - Perfect for understanding compute infrastructure deployments\n- **Exclude Types**: `--exclude \"*.subnets\"` to exclude specific resource types\n\n### Verbose Output\n- **Normal mode**: Clean output with Graphviz warnings suppressed\n- **Verbose mode** (`--verbose` or `-v`): Shows all debug information including Graphviz warnings and processing details\n\n### Supported Azure Resources\nPython AzViz automatically discovers and visualizes these Azure resource types with proper relationships:\n\n**Compute**\n- Virtual Machines (with power state visualization)\n- Virtual Machine Scale Sets\n- SSH Public Keys\n- Azure Compute Galleries, Images, and Versions\n\n**Network**\n- Virtual Networks and Subnets\n- Network Interfaces\n- Public IP Addresses\n- Load Balancers\n- Network Security Groups\n- Route Tables\n- Private Endpoints\n- Private Link Services\n- DNS Zones (Public and Private)\n- Private DNS Zones and VNet Links\n\n**Storage**\n- Storage Accounts (with VM diagnostic relationships)\n- Managed Disks\n\n**Identity**\n- User-Assigned Managed Identities\n\n**Container**\n- Azure Red Hat OpenShift Clusters\n- Azure Kubernetes Service Clusters\n\n**Other**\n- Resource Groups (as containers)\n- Cross-resource group dependencies\n- Internet connectivity visualization\n\n## Examples\n\nSee the `examples/` directory for more usage examples.\n\n## Migration from PowerShell AzViz\n\nPython AzViz maintains compatibility with the original PowerShell version:\n- Same parameter names and behavior\n- Identical output formats and themes\n- Compatible icon system\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch\n3. Make your changes\n4. Add tests\n5. Submit a pull request\n\n## License\n\nMIT License - see [LICENSE](LICENSE) file for details.\n\n## Credits\n\n- Original PowerShell AzViz by [Prateek Kumar Singh](https://github.com/PrateekKumarSingh/AzViz)\n- Python implementation by [Patrick Rutledge](https://github.com/rut31337) with assistance from Claude AI\n- Azure service icons from Microsoft's official Azure Architecture Icons\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Azure resource topology visualization tool - Python implementation inspired by the PowerShell AzViz module",
"version": "1.1.4",
"project_urls": {
"Bug Tracker": "https://github.com/rut31337/python-azviz/issues",
"Documentation": "https://github.com/rut31337/python-azviz#readme",
"Homepage": "https://github.com/rut31337/python-azviz",
"Original PowerShell Version": "https://github.com/PrateekKumarSingh/AzViz",
"Repository": "https://github.com/rut31337/python-azviz"
},
"split_keywords": [
"azure",
" visualization",
" topology",
" graph",
" cloud",
" infrastructure"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "927ac206fea2e54a86426e0ae8d108b183afc89986d2219dd24158cc88153c49",
"md5": "8945fda0ec62f72680285fa454b5418d",
"sha256": "5678a47e6404ef684fabdd9d90f9340e6215521789568e57dad688608037c9c0"
},
"downloads": -1,
"filename": "python_azviz-1.1.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8945fda0ec62f72680285fa454b5418d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 212285,
"upload_time": "2025-09-19T16:42:44",
"upload_time_iso_8601": "2025-09-19T16:42:44.782665Z",
"url": "https://files.pythonhosted.org/packages/92/7a/c206fea2e54a86426e0ae8d108b183afc89986d2219dd24158cc88153c49/python_azviz-1.1.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "2ccaf2f9b7f94b78e0d38b0857ca9c13064a1c59cfb76dd057711a5f6ff02f28",
"md5": "a3f717863fb699d53e9dd88876ddbcf9",
"sha256": "01aac7beee2355d0698c3f5229e4b3657f871dc28887417ade11d182da0c9319"
},
"downloads": -1,
"filename": "python_azviz-1.1.4.tar.gz",
"has_sig": false,
"md5_digest": "a3f717863fb699d53e9dd88876ddbcf9",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 197560,
"upload_time": "2025-09-19T16:42:45",
"upload_time_iso_8601": "2025-09-19T16:42:45.996474Z",
"url": "https://files.pythonhosted.org/packages/2c/ca/f2f9b7f94b78e0d38b0857ca9c13064a1c59cfb76dd057711a5f6ff02f28/python_azviz-1.1.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-19 16:42:45",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rut31337",
"github_project": "python-azviz",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "azure-identity",
"specs": [
[
">=",
"1.12.0"
]
]
},
{
"name": "azure-mgmt-core",
"specs": [
[
">=",
"1.4.0"
]
]
},
{
"name": "azure-mgmt-resource",
"specs": [
[
">=",
"23.0.0"
]
]
},
{
"name": "azure-mgmt-network",
"specs": [
[
">=",
"25.0.0"
]
]
},
{
"name": "azure-mgmt-compute",
"specs": [
[
">=",
"30.0.0"
]
]
},
{
"name": "azure-mgmt-storage",
"specs": [
[
">=",
"21.0.0"
]
]
},
{
"name": "azure-mgmt-subscription",
"specs": [
[
">=",
"3.1.1"
]
]
},
{
"name": "networkx",
"specs": [
[
">=",
"3.0"
]
]
},
{
"name": "graphviz",
"specs": [
[
">=",
"0.20.0"
]
]
},
{
"name": "click",
"specs": [
[
">=",
"8.0.0"
]
]
},
{
"name": "pydantic",
"specs": [
[
">=",
"2.0.0"
]
]
},
{
"name": "rich",
"specs": [
[
">=",
"13.0.0"
]
]
},
{
"name": "jinja2",
"specs": [
[
">=",
"3.0.0"
]
]
}
],
"lcname": "python-azviz"
}