Before we jump into understanding why and how we can visualize and document Azure infrastructure, let’s take a pause here and talk a little bit about what are the challenges and problems in current visualization tools and in the approach of manual documentation. 👇
Cloud admins are doomed to manually document a cloud environment or infrastructure! As the environment grows it becomes complex to maintain the documentation. There has to be a better way to do this in an automated approach!
It is painful inheriting an undocumented cloud landscape to support. But the bigger problem is manual documentation consumes a lot of effort and time and it is static in nature and you have to update your documentation after regular intervals.
What if I want ability target a real Azure environment(s) or multiple resource groups at once, without downloading the template for an individual resource group? There has to be a better which is automated, modular, and extensible so that we can import it and write our own custom tooling on top of that.. that is why PowerShell comes into the picture.
Not many insights from the graphs and diagrams unless you spend a week designing them manually.
No mechanism to change the label verbosity. What if I want to see the resource
OS profile of a Virtual machine like
Linux etc? right now you can’t get that..
What if I want to see the resource dependencies and network flow? not possible with existing tools.
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.
See the following image 👇😇 to understand what this module can generate…
- 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.
- Inserts 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:
Can target more than one resource group at once.
Change direction in which resource groups are plotted, i.e,
Network infrastructure and the associated resources are represented in much better way, by visualizing Virtual Networks containing Subnets and resources inside it.
Excluding any Azure resource types/providers, that you don't want to visualize
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 -Verbose # 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 cd .\AzViz\ # import the powershell module Import-Module .\AzViz.psm1 -Verbose # login to azure, this is required for module to work Connect-AzAccount
Following are few ways to use the module to generate visualization of your Azure infrastructure:
# Visualizing a single resource group Export-AzViz -ResourceGroup demo-2 -Theme light -OutputFormat png -Show # Visualizing a single resource group with more sub-categories Export-AzViz -ResourceGroup demo-2 -Theme light -OutputFormat png -Show -CategoryDepth 2 # Visualizing multiple resource groups Export-AzViz -ResourceGroup demo-2, demo-3 -LabelVerbosity 1 -CategoryDepth 1 -Theme light -Show -OutputFormat png # Add more information in resource label like: Name, type, Provider etc using the '-LabelVerbosity' parameter Export-AzViz -ResourceGroup demo-2 -Theme light -OutputFormat png -Show -LabelVerbosity 2 # Exclude Azure resources/providers from the visualization by passing them as an argument to the '-ExcludeTypes' parameter Export-AzViz -ResourceGroup prateek -Show -ExcludeTypes "*workspace*", "Microsoft.Storage*" -Theme Neon
I've long term plans for this module and will keep evolving this going forward which you can find here:
But on a high-level, these are area's I want to focus:
Today I use
GraphViz which is open-source visualization software, but gradually I will add support for more visualization engines, graphing tools like:
Lucid Charts, etc
I strongly believe users should have more control on how visualization is generated. And one important aspect is giving user ability to expose '
Custom properties' of an Azure resource type on the image, like
IPAddress on NIC,
Linux on Virtual Machines etc.
Right now, the module doesn't support clustering similar resources and subcategories into a logical cluster/group. This is a work in progress and would make the diagram much easier to understand once implemented.
Infrastructure DIFF! yeah, you heard it right this is going to be my favorite feature to implement. This will give us the 'ability to identify/detect what has changed in Azure infrastructure', for example, a resource has been deleted, or IPAddress has been changed something like that.