$npx -y skills add github/awesome-copilot --skill azure-resource-visualizerAnalyze Azure resource groups and generate detailed Mermaid architecture diagrams showing the relationships between individual resources. Use this skill when the user asks for a diagram of their Azure resources or help in understanding how the resources relate to each other.
| 1 | # Azure Resource Visualizer - Architecture Diagram Generator |
| 2 | |
| 3 | A user may ask for help understanding how individual resources fit together, or to create a diagram showing their relationships. Your mission is to examine Azure resource groups, understand their structure and relationships, and generate comprehensive Mermaid diagrams that clearly illustrate the architecture. |
| 4 | |
| 5 | ## Core Responsibilities |
| 6 | |
| 7 | 1. **Resource Group Discovery**: List available resource groups when not specified |
| 8 | 2. **Deep Resource Analysis**: Examine all resources, their configurations, and interdependencies |
| 9 | 3. **Relationship Mapping**: Identify and document all connections between resources |
| 10 | 4. **Diagram Generation**: Create detailed, accurate Mermaid diagrams |
| 11 | 5. **Documentation Creation**: Produce clear markdown files with embedded diagrams |
| 12 | |
| 13 | ## Workflow Process |
| 14 | |
| 15 | ### Step 1: Resource Group Selection |
| 16 | |
| 17 | If the user hasn't specified a resource group: |
| 18 | |
| 19 | 1. Use your tools to query available resource groups. If you do not have a tool for this, use `az`. |
| 20 | 2. Present a numbered list of resource groups with their locations |
| 21 | 3. Ask the user to select one by number or name |
| 22 | 4. Wait for user response before proceeding |
| 23 | |
| 24 | If a resource group is specified, validate it exists and proceed. |
| 25 | |
| 26 | ### Step 2: Resource Discovery & Analysis |
| 27 | |
| 28 | Once you have the resource group: |
| 29 | |
| 30 | 1. **Query all resources** in the resource group using Azure MCP tools or `az`. |
| 31 | 2. **Analyze each resource** type and capture: |
| 32 | - Resource name and type |
| 33 | - SKU/tier information |
| 34 | - Location/region |
| 35 | - Key configuration properties |
| 36 | - Network settings (VNets, subnets, private endpoints) |
| 37 | - Identity and access (Managed Identity, RBAC) |
| 38 | - Dependencies and connections |
| 39 | |
| 40 | 3. **Map relationships** by identifying: |
| 41 | - **Network connections**: VNet peering, subnet assignments, NSG rules, private endpoints |
| 42 | - **Data flow**: Apps → Databases, Functions → Storage, API Management → Backends |
| 43 | - **Identity**: Managed identities connecting to resources |
| 44 | - **Configuration**: App Settings pointing to Key Vaults, connection strings |
| 45 | - **Dependencies**: Parent-child relationships, required resources |
| 46 | |
| 47 | ### Step 3: Diagram Construction |
| 48 | |
| 49 | Create a **detailed Mermaid diagram** using the `graph TB` (top-to-bottom) or `graph LR` (left-to-right) format: |
| 50 | |
| 51 | **Diagram Structure Guidelines:** |
| 52 | |
| 53 | ```mermaid |
| 54 | graph TB |
| 55 | %% Use subgraphs to group related resources |
| 56 | subgraph "Resource Group: [name]" |
| 57 | subgraph "Network Layer" |
| 58 | VNET[Virtual Network<br/>10.0.0.0/16] |
| 59 | SUBNET1[Subnet: web<br/>10.0.1.0/24] |
| 60 | SUBNET2[Subnet: data<br/>10.0.2.0/24] |
| 61 | NSG[Network Security Group] |
| 62 | end |
| 63 | |
| 64 | subgraph "Compute Layer" |
| 65 | APP[App Service<br/>Plan: P1v2] |
| 66 | FUNC[Function App<br/>Runtime: .NET 8] |
| 67 | end |
| 68 | |
| 69 | subgraph "Data Layer" |
| 70 | SQL[Azure SQL Database<br/>DTU: S1] |
| 71 | STORAGE[Storage Account<br/>Type: Standard LRS] |
| 72 | end |
| 73 | |
| 74 | subgraph "Security & Identity" |
| 75 | KV[Key Vault] |
| 76 | MI[Managed Identity] |
| 77 | end |
| 78 | end |
| 79 | |
| 80 | %% Define relationships with descriptive labels |
| 81 | APP -->|"HTTPS requests"| FUNC |
| 82 | FUNC -->|"SQL connection"| SQL |
| 83 | FUNC -->|"Blob/Queue access"| STORAGE |
| 84 | APP -->|"Uses identity"| MI |
| 85 | MI -->|"Access secrets"| KV |
| 86 | VNET --> SUBNET1 |
| 87 | VNET --> SUBNET2 |
| 88 | SUBNET1 --> APP |
| 89 | SUBNET2 --> SQL |
| 90 | NSG -->|"Rules applied to"| SUBNET1 |
| 91 | ``` |
| 92 | |
| 93 | **Key Diagram Requirements:** |
| 94 | |
| 95 | - **Group by layer or purpose**: Network, Compute, Data, Security, Monitoring |
| 96 | - **Include details**: SKUs, tiers, important settings in node labels (use `<br/>` for line breaks) |
| 97 | - **Label all connections**: Describe what flows between resources (data, identity, network) |
| 98 | - **Use meaningful node IDs**: Abbreviations that make sense (APP, FUNC, SQL, KV) |
| 99 | - **Visual hierarchy**: Subgraphs for logical grouping |
| 100 | - **Connection types**: |
| 101 | - `-->` for data flow or dependencies |
| 102 | - `-.->` for optional/conditional connections |
| 103 | - `==>` for critical/primary paths |
| 104 | |
| 105 | **Resource Type Examples:** |
| 106 | - App Service: Include plan tier (B1, S1, P1v2) |
| 107 | - Functions: Include runtime (.NET, Python, Node) |
| 108 | - Databases: Include tier (Basic, Standard, Premium) |
| 109 | - Storage: Include redundancy (LRS, GRS, ZRS) |
| 110 | - VNets: Include address space |
| 111 | - Subnets: Include address range |
| 112 | |
| 113 | ### Step 4: File Creation |
| 114 | |
| 115 | Use [template-architecture.md](./assets/template-architecture.md) as a template and create a markdown file named `[resource-group-name]-architecture.md` with: |
| 116 | |
| 117 | 1. **Header**: Resource group name, subscr |