Azure Diagram Generator
Generates architecture diagrams for Azure infrastructure from ARM templates, Azure CLI output, or natural language descriptions.
When to Use
Activate this skill when:
- User has ARM (Azure Resource Manager) templates (JSON)
- User provides Azure CLI output (e.g.,
az vm list)
- User wants to visualize Azure resources
- User mentions Azure services (Virtual Machines, Storage Accounts, VNets, etc.)
- User asks to "diagram my Azure infrastructure"
How It Works
This skill generates Azure-specific diagrams by parsing Azure resources and calling the Eraser API directly:
- Parse Azure Resources: Extract resources from ARM templates, CLI output, or descriptions
- Map Azure Relationships: Identify Resource Groups, VNets, subnets, and service connections
- Generate Eraser DSL: Create Eraser DSL code from Azure resources
- Call Eraser API: Use
/api/render/elements with diagramType: "cloud-architecture-diagram"
Instructions
When the user provides Azure infrastructure information:
Parse the Source
- ARM Templates: Extract
resources array, identify types (Microsoft.Compute/virtualMachines, etc.)
- CLI Output: Parse JSON output from
az commands
- Description: Identify Azure service names and relationships
Identify Azure Components
- Networking: Virtual Networks (VNets), Subnets, Network Security Groups, Load Balancers
- Compute: Virtual Machines, Virtual Machine Scale Sets, App Services, Functions
- Storage: Storage Accounts, Blob Storage, File Shares
- Databases: SQL Databases, Cosmos DB, Redis Cache
- Security: Network Security Groups, Azure AD, Key Vault
- Load Balancing: Application Gateway, Load Balancer, Traffic Manager
- Other: Service Bus, Event Hubs, API Management
Map Relationships
- VMs in subnets
- Subnets in VNets
- VNets in Resource Groups
- Storage accounts accessed by VMs
- Databases accessed by applications
- Network Security Groups attached to subnets
Generate Eraser DSL Convert Azure resources to Eraser DSL:
- CRITICAL: Label Formatting Rules
- Labels MUST be on a single line - NEVER use newlines inside label attributes
- Keep labels simple and readable - prefer separate labels over concatenating too much metadata
- Format DSL with proper line breaks (one node/group per line, but labels stay on single lines)
- If including metadata like CIDR blocks or instance types, include them in the same quoted label string:
[label: "VNet 10.0.0.0/16"]
Example:
myVNet [label: "VNet 10.0.0.0/16"] {
subnet1 [label: "Subnet 1"] {
myVM [icon: azure-vm, label: "Virtual Machine"]
gateway [icon: azure-app-gateway]
}
subnet2 [label: "Subnet 2"] {
database [icon: azure-sql]
}
}
storage [icon: azure-storage]
myVNet -> myVM
myVM -> database
Make the HTTP Request
IMPORTANT: You MUST execute this curl command after generating the DSL. Never stop after generating DSL without making the API call.
CRITICAL: In the X-Skill-Source header below, you MUST replace the value with your AI agent name:
- If you are Claude (Anthropic), use:
claude
- If you are running in Cursor, use:
cursor
- If you are ChatGPT (OpenAI), use:
chatgpt
- If you are Gemini (Google), use:
gemini
- Otherwise, use your model/agent name in lowercase
curl -X POST https://app.eraser.io/api/render/elements \
-H "Content-Type: application/json" \
-H "X-Skill-Source: eraser-skill" \
-H "Authorization: Bearer ${ERASER_API_KEY}" \
-d '{
"elements": [{
"type": "diagram",
"id": "diagram-1",
"code": "<your generated DSL>",
"diagramType": "cloud-architecture-diagram"
}],
"scale": 2,
"theme": "${ERASER_THEME:-dark}",
"background": true
}'
Track Sources During Analysis
As you analyze files and resources to generate the diagram, track:
- Internal files: Record each file path you read and what information was extracted (e.g.,
infra/main.bicep - VNet and subnet definitions)
- External references: Note any documentation, examples, or URLs consulted (e.g., Azure architecture best practices documentation)
- Annotations: For each source, note what it contributed to the diagram
Handle the Response
CRITICAL: Minimal Output Format
Your response MUST always include these elements with clear headers:
Diagram Preview: Display with a header
## Diagram

Use the ACTUAL imageUrl from the API response.
Editor Link: Display with a header
## Open in Eraser
[Edit this diagram in the Eraser editor]({createEraserFileUrl})
Use the ACTUAL URL from the API response.
Sources section: Brief list of files/resources analyzed (if applicable)
## Sources
- `path/to/file` - What was extracted
Diagram Code section: The Eraser DSL in a code block with eraser language tag
## Diagram Code
```eraser
{DSL code here}
Learn More link: You can learn more about Eraser at https://docs.eraser.io/docs/using-ai-agent-integrations
Additional content rules:
- If the user ONLY asked for a diagram, include NOTHING beyond the 5 elements above
- If the user explicitly asked for more (e.g., "explain the architecture", "suggest improvements"), you may include that additional content
- Never add unrequested sections like Overview, Security Considerations, Testing, etc.
The default output should be SHORT. The diagram image speaks for itself.
Azure-Specific Tips
- Resource Groups: Show Resource Groups as logical containers
- VNets as Containers: Always show VNets containing subnets and resources
- Network Security Groups: Include NSG rules and attachments
- Subscriptions: Note subscription context if provided
- Data Flow: Show traffic flow (Internet → Application Gateway → VM → SQL Database)
- Use Azure Icons: Request Azure-specific styling in the description
Example: ARM Template with Multiple Azure Services
User Input
{
"resources": [
{
"type": "Microsoft.Resources/resourceGroups",
"name": "rg-main"
},
{
"type": "Microsoft.Network/virtualNetworks",
"name": "myVNet",
"properties": {
"addressSpace": {
"addressPrefixes": ["10.0.0.0/16"]
},
"subnets": [
{
"name": "subnet1",
"properties": {
"addressPrefix": "10.0.1.0/24"
}
}
]
}
},
{
"type": "Microsoft.Compute/virtualMachines",
"name": "myVM",
"properties": {
"hardwareProfile": {
"vmSize": "Standard_B1s"
}
}
},
{
"type": "Microsoft.Web/sites",
"name": "myAppService",
"properties": {
"serverFarmId": "/subscriptions/.../serverfarms/myPlan"
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"name": "mystorageaccount"
},
{
"type": "Microsoft.Sql/servers",
"name": "mysqlserver",
"properties": {
"administratorLogin": "admin"
}
}
]
}
Expected Behavior
Parses ARM template:
- Resource Group: rg-main (container)
- Networking: VNet with subnet
- Compute: VM, App Service
- Storage: Storage Account
- Database: SQL Server
Generates DSL showing Azure service diversity:
resource-group [label: "Resource Group rg-main"] {
myVNet [label: "VNet 10.0.0.0/16"] {
subnet1 [label: "Subnet 1 10.0.1.0/24"] {
myVM [icon: azure-vm, label: "VM Standard_B1s"]
}
}
myAppService [icon: azure-app-service, label: "App Service"]
mystorageaccount [icon: azure-storage, label: "Storage Account"]
mysqlserver [icon: azure-sql, label: "SQL Server"]
}
myAppService -> mystorageaccount
myVM -> mysqlserver
Important: All label text must be on a single line within quotes. Azure-specific: Show Resource Groups as containers, include App Services, Storage Accounts, and SQL databases with proper Azure icons.
Calls /api/render/elements with diagramType: "cloud-architecture-diagram"
Example: Azure CLI Output
User Input
User runs: az vm list --output json
Provides JSON output
Expected Behavior
Parses JSON to extract:
- VM names, sizes, states
- Resource groups
- Network interfaces
- Storage accounts
Formats and calls API
1---2name: azure-diagrams3description: Visualizes Azure infrastructure from ARM templates, Azure CLI, or descriptions. Use when user has Azure resources to diagram.4license: MIT5---67# Azure Diagram Generator89Generates architecture diagrams for Azure infrastructure from ARM templates, Azure CLI output, or natural language descriptions.1011## When to Use1213Activate this skill when:1415- User has ARM (Azure Resource Manager) templates (JSON)16- User provides Azure CLI output (e.g., `az vm list`)17- User wants to visualize Azure resources18- User mentions Azure services (Virtual Machines, Storage Accounts, VNets, etc.)19- User asks to "diagram my Azure infrastructure"2021## How It Works2223This skill generates Azure-specific diagrams by parsing Azure resources and calling the Eraser API directly:24251. **Parse Azure Resources**: Extract resources from ARM templates, CLI output, or descriptions262. **Map Azure Relationships**: Identify Resource Groups, VNets, subnets, and service connections273. **Generate Eraser DSL**: Create Eraser DSL code from Azure resources284. **Call Eraser API**: Use `/api/render/elements` with `diagramType: "cloud-architecture-diagram"`2930## Instructions3132When the user provides Azure infrastructure information:33341. **Parse the Source**3536 - **ARM Templates**: Extract `resources` array, identify types (Microsoft.Compute/virtualMachines, etc.)37 - **CLI Output**: Parse JSON output from `az` commands38 - **Description**: Identify Azure service names and relationships39402. **Identify Azure Components**4142 - **Networking**: Virtual Networks (VNets), Subnets, Network Security Groups, Load Balancers43 - **Compute**: Virtual Machines, Virtual Machine Scale Sets, App Services, Functions44 - **Storage**: Storage Accounts, Blob Storage, File Shares45 - **Databases**: SQL Databases, Cosmos DB, Redis Cache46 - **Security**: Network Security Groups, Azure AD, Key Vault47 - **Load Balancing**: Application Gateway, Load Balancer, Traffic Manager48 - **Other**: Service Bus, Event Hubs, API Management49503. **Map Relationships**5152 - VMs in subnets53 - Subnets in VNets54 - VNets in Resource Groups55 - Storage accounts accessed by VMs56 - Databases accessed by applications57 - Network Security Groups attached to subnets58594. **Generate Eraser DSL** Convert Azure resources to Eraser DSL:6061 - **CRITICAL: Label Formatting Rules**62 - Labels MUST be on a single line - NEVER use newlines inside label attributes63 - Keep labels simple and readable - prefer separate labels over concatenating too much metadata64 - Format DSL with proper line breaks (one node/group per line, but labels stay on single lines)65 - If including metadata like CIDR blocks or instance types, include them in the same quoted label string: `[label: "VNet 10.0.0.0/16"]`6667 Example:6869 ```70 myVNet [label: "VNet 10.0.0.0/16"] {71 subnet1 [label: "Subnet 1"] {72 myVM [icon: azure-vm, label: "Virtual Machine"]73 gateway [icon: azure-app-gateway]74 }75 subnet2 [label: "Subnet 2"] {76 database [icon: azure-sql]77 }78 }79 storage [icon: azure-storage]80 myVNet -> myVM81 myVM -> database82 ```83845. **Make the HTTP Request**8586 **IMPORTANT**: You MUST execute this curl command after generating the DSL. Never stop after generating DSL without making the API call.8788 **CRITICAL**: In the `X-Skill-Source` header below, you MUST replace the value with your AI agent name:89 - If you are Claude (Anthropic), use: `claude`90 - If you are running in Cursor, use: `cursor`91 - If you are ChatGPT (OpenAI), use: `chatgpt`92 - If you are Gemini (Google), use: `gemini`93 - Otherwise, use your model/agent name in lowercase9495 ```bash96 curl -X POST https://app.eraser.io/api/render/elements \97 -H "Content-Type: application/json" \98 -H "X-Skill-Source: eraser-skill" \99 -H "Authorization: Bearer ${ERASER_API_KEY}" \100 -d '{101 "elements": [{102 "type": "diagram",103 "id": "diagram-1",104 "code": "<your generated DSL>",105 "diagramType": "cloud-architecture-diagram"106 }],107 "scale": 2,108 "theme": "${ERASER_THEME:-dark}",109 "background": true110 }'111 ```1121136. **Track Sources During Analysis**114115 As you analyze files and resources to generate the diagram, track:116117 - **Internal files**: Record each file path you read and what information was extracted (e.g., `infra/main.bicep` - VNet and subnet definitions)118 - **External references**: Note any documentation, examples, or URLs consulted (e.g., Azure architecture best practices documentation)119 - **Annotations**: For each source, note what it contributed to the diagram1201217. **Handle the Response**122123 **CRITICAL: Minimal Output Format**124125 Your response MUST always include these elements with clear headers:126127 1. **Diagram Preview**: Display with a header128 ```129 ## Diagram130 131 ```132 Use the ACTUAL `imageUrl` from the API response.133134 2. **Editor Link**: Display with a header135 ```136 ## Open in Eraser137 [Edit this diagram in the Eraser editor]({createEraserFileUrl})138 ```139 Use the ACTUAL URL from the API response.140141 3. **Sources section**: Brief list of files/resources analyzed (if applicable)142 ```143 ## Sources144 - `path/to/file` - What was extracted145 ```146147 4. **Diagram Code section**: The Eraser DSL in a code block with `eraser` language tag148 ```149 ## Diagram Code150 ```eraser151 {DSL code here}152 ```153 ```154155 5. **Learn More link**: `You can learn more about Eraser at https://docs.eraser.io/docs/using-ai-agent-integrations`156157 **Additional content rules:**158 - If the user ONLY asked for a diagram, include NOTHING beyond the 5 elements above159 - If the user explicitly asked for more (e.g., "explain the architecture", "suggest improvements"), you may include that additional content160 - Never add unrequested sections like Overview, Security Considerations, Testing, etc.161162 The default output should be SHORT. The diagram image speaks for itself.163164## Azure-Specific Tips165166- **Resource Groups**: Show Resource Groups as logical containers167- **VNets as Containers**: Always show VNets containing subnets and resources168- **Network Security Groups**: Include NSG rules and attachments169- **Subscriptions**: Note subscription context if provided170- **Data Flow**: Show traffic flow (Internet → Application Gateway → VM → SQL Database)171- **Use Azure Icons**: Request Azure-specific styling in the description172173## Example: ARM Template with Multiple Azure Services174175### User Input176177```json178{179 "resources": [180 {181 "type": "Microsoft.Resources/resourceGroups",182 "name": "rg-main"183 },184 {185 "type": "Microsoft.Network/virtualNetworks",186 "name": "myVNet",187 "properties": {188 "addressSpace": {189 "addressPrefixes": ["10.0.0.0/16"]190 },191 "subnets": [192 {193 "name": "subnet1",194 "properties": {195 "addressPrefix": "10.0.1.0/24"196 }197 }198 ]199 }200 },201 {202 "type": "Microsoft.Compute/virtualMachines",203 "name": "myVM",204 "properties": {205 "hardwareProfile": {206 "vmSize": "Standard_B1s"207 }208 }209 },210 {211 "type": "Microsoft.Web/sites",212 "name": "myAppService",213 "properties": {214 "serverFarmId": "/subscriptions/.../serverfarms/myPlan"215 }216 },217 {218 "type": "Microsoft.Storage/storageAccounts",219 "name": "mystorageaccount"220 },221 {222 "type": "Microsoft.Sql/servers",223 "name": "mysqlserver",224 "properties": {225 "administratorLogin": "admin"226 }227 }228 ]229}230```231232### Expected Behavior2332341. Parses ARM template:235236 - **Resource Group**: rg-main (container)237 - **Networking**: VNet with subnet238 - **Compute**: VM, App Service239 - **Storage**: Storage Account240 - **Database**: SQL Server2412422. Generates DSL showing Azure service diversity:243244 ```245 resource-group [label: "Resource Group rg-main"] {246 myVNet [label: "VNet 10.0.0.0/16"] {247 subnet1 [label: "Subnet 1 10.0.1.0/24"] {248 myVM [icon: azure-vm, label: "VM Standard_B1s"]249 }250 }251 myAppService [icon: azure-app-service, label: "App Service"]252 mystorageaccount [icon: azure-storage, label: "Storage Account"]253 mysqlserver [icon: azure-sql, label: "SQL Server"]254 }255256 myAppService -> mystorageaccount257 myVM -> mysqlserver258 ```259260 **Important**: All label text must be on a single line within quotes. Azure-specific: Show Resource Groups as containers, include App Services, Storage Accounts, and SQL databases with proper Azure icons.2612623. Calls `/api/render/elements` with `diagramType: "cloud-architecture-diagram"`263264## Example: Azure CLI Output265266### User Input267268```269User runs: az vm list --output json270Provides JSON output271```272273### Expected Behavior2742751. Parses JSON to extract:276277 - VM names, sizes, states278 - Resource groups279 - Network interfaces280 - Storage accounts2812822. Formats and calls API