Azure-PlantUML

repository·master·Indexed 19 days ago

https://github.com/plantuml-stdlib/azure-plantuml

A 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.

Tokens
13.3K
Snippets
35
Records
43
Agent score
67%

What's inside Azure-PlantUML

  1. Set up Azure-PlantUML in your diagrams

    master

    To use Azure-PlantUML, you must include the AzureCommon.puml file at the top of your .puml file. You can reference it locally for offline use or via !includeurl to 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.puml within 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.puml
  2. Access Azure symbols as standalone images or in PowerPoint

    master
    Azure 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 the dist/ directory containing all Azure symbols as SVGs.
  3. Use Azure-PlantUML symbols via remote URL

    master

    To 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 !includeurl to pull the required .puml files. 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.puml
  4. Generate the Azure-PlantUML distro

    master

    To execute the generation process, run the following command from the scripts folder:

    dotnet run

    Generation Workflow

    1. Recursively processes and renames SVGs in the official folder.
    2. Loads Config.yaml.
    3. Cleans the dist folder.
    4. Copies AzureCommon.puml to dist.
    5. Searches for colored and monochrome SVGs for each configured service (checking source/manual if needed).
    6. Generates PNGs (colored, monochrome with white background, and monochrome without background).
    7. Generates PlantUML sprites.
    8. Generates individual and category-combined PUML files.
    9. Generates a markdown table (table.md) and VSCode snippets.
  5. Use Azure-PlantUML macros for basic diagrams

    master

    The 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
    
    @enduml
  6. Enable Simplified Mode for management presentations

    master

    To 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