Draw.io Azure infrastructure diagrams through code like an artist
Introduction
In this article we will see how to create an Azure diagram to reveal all the dependencies between Azure App Services, their Application Insights and finally their workspace-based Log Analytics Workspaces.
The use case consist in:
- auditing the current configuration on Azure through a PowerShell script,
- export the current infrastructure set up on a CSV Draw.io readable file,
- observe a work of art.
Concept
To make this piece of art possible you should have a clear idea of the following concept.
- Azure resource dependencies: An App Service or Function App can send logs to an Application Insights and Application Insights can send logs to a Log Analytics workspace. This refers to the concept of Workspace-based Application Insights resources.
- Draw.io is a free diagram software that permits to insert diagram from specially formatted CSV Data as explained in the following blog.
We can now move on to the next chapter which consists of creating a script that will scan our Infrastructure and write to the CSV in draw.io format.
Script
The following PowerShell script will analyze your App Services configuration based on which ones have these tags and export its results to a local file.
There are 2 main tips on the script you should understand:
- The Draw.io “styles” block points out to existing Draw.io shapes, you can print their code by selecting an existing shape, then press
Ctrl+Eon Windows orCmd+Eon macOS. - You can create multiple connections between your CSV rows with their own properties (labels, line style, etc…).
The complete script:
Rendering
From Draw.io select Arrange > Insert > Advanced > CSV.
Paste your formatting information and CSV data into the large text field, overwriting the example.
The following screenshot illustrates a diagram generated by the PowerShell script.
Conclusion
We saw in this demo how to draw a script-based Azure App Service oriented diagram. This methodology has no limits and DALL-E knows it, would you defeat it ?
See You in the Cloud
Jamesdld
Published on:
Learn moreRelated posts
This Month in Azure Static Web Apps | 09/2024
We are back with another edition of the Azure Static Web Apps Community! :party_popper: September was yet another month ...
GitHub Copilot for Azure: 6 Must-Try Features
As developers, we are constantly seeking tools that streamline our workflows and boost productivity. … Enter GitHub Copilot for Azure, now in ...
Responsible AI Mitigation Layers
Generative AI is increasingly being used in various kinds of systems to augment humans and infuse intelligent behavior into existing and new a...
Streamline Your Azure Workflow: Introducing GitHub Copilot for Azure in VS Code
I'm excited to announce the public preview of GitHub Copilot for Azure - a new addition to your toolkit that seamlessly integrates with G...
Build Intelligent Apps Code-First with Prompty and Azure AI
Building Generative AI applications can feel daunting for traditional app developers. What does the end-to-end applicati...
Certificación AI-900 (Fundamentos de IA) con Chicas en IA
La inteligencia artificial ha llegado para quedarse, ¡y más aún con la revolucionaria IA generativa! Para ayudar a los profesionales a especia...
Get certified with Learn Live GitHub series!
GitHub Universe is coming, and Microsoft and GitHub are partnering to offer a new special Learn Live series in Brazilian Portuguese, English a...
Certifícate con Learn Live GitHub en Español
Microsoft y GitHub se han unido para ofrecer una nueva serie especial de Learn Live en inglés y español: GitHub 2024. Del 10 al 24 de Octubre,...
Evaluating generative AI: Best practices for developers
As a developer working with generative AI, you've likely marveled at the impressive outputs your models can produce. But how do you ensure the...
Introducing Azure Product Retirement Livestreams
The Azure Retirements team, in collaboration with key partner groups, is excited t...