Azure Visualizer aka 'AzViz' - PowerShell module to automatically generate Azure resource topology diagrams by just typing a PowerShell cmdlet and passing the name of one or more Azure Resource Group(s).
Cloud admins are not anymore doomed to manually document a cloud environment! The pain of inheriting an undocumented cloud landscape to support is gone 😎😉 so please share this project with your colleagues and friends.
It is capable of:
- Finding Resources in a Azure Resource Group and identifying their dependencies.
- Plot nodes and edges to represent Azure Resources and their dependencies on a graph.
- Insert appropriate Azure Icons on basis of resource category/sub-category.
- Label each resource with information like Name, Category, Type etc.
- Generate visualization in formats like: .png and .svg
- Output image can be in 'light', 'dark' or 'neon' theme.
- Can target more than one resource group at once.
- Change direction in which resource groups are plotted, i.e, left-to-right or top-to-bottom.
Special thanks & shoutout to
Kevin Marquette
and hisPSGraph
module which seeded the idea for programmatical approach to Azure Visualization while I was working with Kevin's module. And without which 'AzViz' module won't be possible! ♥👍
We need to install GraphViz on our system before we can proceed with using the 'AzViz' PowerShell module. Depending upon the operating system you are using please follow the below mentioned steps:
# Ubuntu
$ sudo apt install graphviz
# Fedora
$ sudo yum install graphviz
# Debian
$ sudo apt install graphviz
# chocolatey packages Graphviz for Windows
choco install graphviz
# alternatively using windows package manager
winget install graphviz
brew install graphviz
# install from powershell gallery
Install-Module -Name AzViz -Scope CurrentUser -Repository PSGallery -Force
# import the module
Import-Module AzViz
# login to azure, this is required for module to work
Connect-AzAccount
# optionally clone the project from github
git clone https://github.com/PrateekKumarSingh/AzViz.git
Set-Location .\AzViz\AzViz
# import the powershell module
Import-Module .\AzViz.psm1 -Verbose
# login to azure, this is required for module to work
Connect-AzAccount
# target single resource group
Export-AzViz -ResourceGroup demo-2 -Theme light -OutputFormat png -Show
# target single resource group with more sub-categories
Export-AzViz -ResourceGroup demo-2 -Theme light -OutputFormat png -Show -CategoryDepth 2
# target multiple resource groups
Export-AzViz -ResourceGroup demo-2, demo-3 -LabelVerbosity 1 -CategoryDepth 1 -Theme light -Show -OutputFormat png
# adding more information in resource label like: Name, type, Provider etc
Export-AzViz -ResourceGroup demo-2 -Theme light -OutputFormat png -Show -LabelVerbosity 2
- Fixed casing for
loadbalancer.png
inAzViz/src/private/Images.ps1
to match the filename forAzViz/icons/LoadBalancers.png
as AzViz could not find the icon when run from pwsh on a Linux VM. pull-request by @madsaune
- Handled condition to skip resources out of resource group, this should fix issue#37 and issue#39
- Handled period in resource group name, this should fix issue#41
- If there are no edges between the nodes, then graph legends are not plotted, this should fix issue#38
- Empty resource groups skips, resource visualization for all later targets, this should fix issue#50. Thanks @madsaune finding the bug and creating the issue.
- Add Vnet-only resource groups to graph visualization. Special thanks to @madsaune for the pull-request
- Network infra and the associated resources are represented in much better way
- Improve network diagrams with Virtual Networks containing Subnets and resources
- Azure Icons with labels showing informarion on Subscriptions, RGs, VNet, Subnets
- Excluding Azure resource types/providers
- Supports empty virtual networks
- Improved dark and neon themes
- Supports diagram legends
- Bug Fixes