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