Azure-PlantUML
repository·master·Indexed 19 days ago
https://github.com/plantuml-stdlib/azure-plantumlA library providing PlantUML sprites, macros, and stereotypes for creating architecture diagrams using official Microsoft Azure component icons. It includes support for high-level service macros, raw sprite access, a simplified mode for management presentations, and integration with C4-PlantUML via AzureC4Integration.puml. The library can be used via remote GitHub URLs or local files.
What's inside Azure-PlantUML
- For modeling large-scale systems, it is recommended to use Azure-PlantUML in combination with C4-PlantUML. This allows you to use C4 model abstractions (like Containers and Components) while using official Azure icons for visual clarity.
Set up Azure-PlantUML in your diagrams
masterTo use Azure-PlantUML, you must include the
AzureCommon.pumlfile at the top of your.pumlfile. You can reference it locally for offline use or via!includeurlto use the latest version from GitHub.After including
AzureCommon.puml, you must include specific service files (e.g.,AzureFunction.puml) or category files (e.g.,all.pumlwithin a category folder) to make their macros and sprites available.// Local reference !include path/to/AzureCommon.puml // Remote reference (always up-to-date) !includeurl https://raw.githubusercontent.com/plantuml-stdlib/Azure-PlantUML/release/2-2/dist/AzureCommon.puml // Including specific services or categories !define AzurePuml https://raw.githubusercontent.com/plantuml-stdlib/Azure-PlantUML/release/2-2/dist !includeurl AzurePuml/Databases/all.puml !includeurl AzurePuml/Compute/AzureFunction.pumlAccess Azure symbols as standalone images or in PowerPoint
masterAzure symbols are available as colored and monochromatic SVG and PNG images for use in documents or presentations outside of PlantUML. A PowerPoint file (Azure_Symbols.pptx) is also provided in thedist/directory containing all Azure symbols as SVGs.Use Azure-PlantUML symbols via remote URL
masterTo ensure you are always using the most up-to-date version of the Azure symbols, define a path to the GitHub raw content repository and use
!includeurlto pull the required.pumlfiles. This method requires internet connectivity during the PlantUML rendering process.!define AzurePuml https://raw.githubusercontent.com/plantuml-stdlib/Azure-PlantUML/master/dist !includeurl AzurePuml/AzureCommon.puml !includeurl AzurePuml/Databases/AzureCosmosDb.puml !includeurl AzurePuml/Compute/AzureFunction.pumlGenerate the Azure-PlantUML distro
masterTo execute the generation process, run the following command from the
scriptsfolder:dotnet runGeneration Workflow
- Recursively processes and renames SVGs in the
officialfolder. - Loads
Config.yaml. - Cleans the
distfolder. - Copies
AzureCommon.pumltodist. - Searches for colored and monochrome SVGs for each configured service (checking
source/manualif needed). - Generates PNGs (colored, monochrome with white background, and monochrome without background).
- Generates PlantUML sprites.
- Generates individual and category-combined PUML files.
- Generates a markdown table (
table.md) and VSCode snippets.
- Recursively processes and renames SVGs in the
Install the Playwright CLI
masterThe build process requires the Playwright CLI. Install it globally using the dotnet tool command:
dotnet tool install -g Microsoft.Playwright.CLIUse Azure-PlantUML macros for basic diagrams
masterThe primary way to use Azure-PlantUML is through service macros. These macros follow a standard pattern:
AzureServiceName(alias, "Label", "Technology", "Description"). This allows you to quickly define components with consistent styling.@startuml Basic usage !define AzurePuml https://raw.githubusercontent.com/plantuml-stdlib/Azure-PlantUML/release/2-2/dist !includeurl AzurePuml/AzureCommon.puml !includeurl AzurePuml/Analytics/AzureEventHub.puml !includeurl AzurePuml/Analytics/AzureStreamAnalyticsJob.puml !includeurl AzurePuml/Databases/AzureCosmosDb.puml left to right direction agent "Device Simulator" as devices #fff AzureEventHub(fareDataEventHub, "Fare Data", "PK: Medallion HackLicense VendorId; 3 TUs") AzureEventHub(tripDataEventHub, "Trip Data", "PK: Medallion HackLicense VendorId; 3 TUs") AzureStreamAnalyticsJob(streamAnalytics, "Stream Processing", "6 SUs") AzureCosmosDb(outputCosmosDb, "Output Database", "1,000 RUs") devices --> fareDataEventHub devices --> tripDataEventHub fareDataEventHub --> streamAnalytics tripDataEventHub --> streamAnalytics streamAnalytics --> outputCosmosDb @endumlPrerequisites for generating the Azure-PlantUML distro
masterTo build a customized Azure-PlantUML distribution, you must have the following software installed on Windows, MacOS, or Linux (Ubuntu 20.04):
Manage Azure icons in source folders
masterTo include icons in your custom distro:
- Official Icons: Download the Microsoft Azure architecture icons and copy all folders from
Azure_Public_Service_Icons_V4\Azure_Public_Service_Icons\Iconstosource/official. - Manual Icons: Place any icons not part of the official Microsoft bundle into
source/manual.
- Official Icons: Download the Microsoft Azure architecture icons and copy all folders from
Use Azure-PlantUML snippets in Visual Studio Code
masterYou can improve your workflow in Visual Studio Code by using the provided Azure-PlantUML snippets.
- Manual Installation: Copy the contents of
dist/.vscode/snippets/diagram.jsonand follow the VS Code guide for creating user-defined snippets. - Project-level Snippets: Use the Project Snippets extension to manage these snippets at the workspace or project level.
- Manual Installation: Copy the contents of
Additional setup for Linux (Ubuntu 20.04)
masterOn Linux systems, Playwright requires additional dependencies. Navigate to the
scriptsfolder and run the following commands to build the project and install the necessary dependencies:dotnet build playwright install-depsEnable Simplified Mode for management presentations
masterTo create a high-level version of your architecture for management (removing technical details), include
AzureSimplified.puml. You can toggle this mode by commenting or uncommenting the include line.@startuml Two Mode Sample !define AzurePuml https://raw.githubusercontent.com/plantuml-stdlib/Azure-PlantUML/release/2-2/dist !includeurl AzurePuml/AzureCommon.puml ' Uncomment the line below to enable simplified mode ' !includeurl AzurePuml/AzureSimplified.puml !includeurl AzurePuml/Analytics/AzureEventHub.puml // ... other includes