# azure-samples/azure-monitor-lab architecture

> Architecture diagram of the GitHub repository azure-samples/azure-monitor-lab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-09). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azure-samples/azure-monitor-lab
- Repository: https://github.com/azure-samples/azure-monitor-lab

## Overview

Azure Monitor Lab is a demo environment with two complementary user paths: guided scenarios and a web Control Center. In the sampled runtime, the Control Center serves agent demonstrations, infrastructure health, approved lab operations, and an SRE MCP assistant; the separate AI workload provisions Foundry agents and generates traced traffic. The README also documents broad monitoring, deployment, and optional Sentinel capabilities, but their infrastructure implementation is outside the supplied tree excerpt. Edges are limited to calls and flows shown in excerpts or documented by the README; unsampled wiring is omitted.

Main entry points: [`workloads/webapp/Program.cs`](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/Program.cs) (Console API), [`workloads/webapp/LabOperationsService.cs`](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/LabOperationsService.cs) (Approval workflow), [`workloads/webapp/InfrastructureHealthService.cs`](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/InfrastructureHealthService.cs) (Infrastructure health), [`workloads/webapp/SreAssistant.cs`](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/SreAssistant.cs) (SRE assistant)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entrypoints"]
  node_scenarios["Guided scenarios"]
end

subgraph group_console["Control Center"]
  node_frontend["Control Center UI<br/>[agents.js]"]
  node_webapp["Console API<br/>[Program.cs]"]
  node_playground["Agent playground<br/>[AgentPlayground.cs]"]
  node_scenario_catalog["Observability scenarios"]
  node_health["Infrastructure health"]
  node_health_queries["Telemetry queries"]
end

subgraph group_operations["Lab operations"]
  node_operations_ui["Operations view<br/>[lab-operations.js]"]
  node_operations_service["Approval workflow"]
  node_catalog["Operation catalog"]
  node_target["Runner target validation"]
  node_job_operations["Container job runner"]
  node_journal[("Run journal")]
end

subgraph group_sre["SRE assistant"]
  node_sre_ui["SRE assistant view<br/>[sre-assistant.js]"]
  node_sre_assistant["SRE assistant<br/>[SreAssistant.cs]"]
  node_sre_model["Model tools<br/>[SreModel.cs]"]
  node_mcp_client["MCP client<br/>[SreMcpClient.cs]"]
  node_mcp_runtime["MCP runtime<br/>[SreMcpRuntime.cs]"]
end

subgraph group_ai["AI workload"]
  node_agent_creator["Foundry agent setup<br/>[create_agents.py]"]
  node_traffic["Agent traffic generator"]
end

node_operator(("Lab user"))
node_azure["Azure resources"]
node_monitor[("Azure Monitor")]
node_sre_service["Azure SRE Agent"]
node_foundry["Microsoft Foundry"]
node_ai_telemetry[("AI telemetry")]

node_operator -->|"follows walkthroughs"| node_scenarios
node_operator -->|"uses"| node_frontend
node_frontend -->|"calls APIs"| node_webapp
node_webapp -->|"runs agents"| node_playground
node_webapp -->|"serves scenarios"| node_scenario_catalog
node_webapp -->|"checks health"| node_health
node_health -->|"builds queries"| node_health_queries
node_health -->|"reads inventory"| node_azure
node_health -->|"queries telemetry"| node_monitor
node_operator -->|"requests operations"| node_operations_ui
node_operations_ui -->|"calls APIs"| node_webapp
node_webapp -->|"handles operations"| node_operations_service
node_operations_service -->|"validates choices"| node_catalog
node_operations_service -->|"uses validated target"| node_target
node_operations_service -->|"dispatches approved run"| node_job_operations
node_operations_service -->|"records run state"| node_journal
node_job_operations -->|"runs container job"| node_azure
node_operator -->|"asks questions"| node_sre_ui
node_sre_ui -->|"calls APIs"| node_webapp
node_webapp -->|"routes requests"| node_sre_assistant
node_sre_assistant -.->|"uses model"| node_sre_model
node_sre_assistant -->|"lists and calls tools"| node_mcp_client
node_mcp_client -->|"prepares runtime"| node_mcp_runtime
node_mcp_client -.->|"calls tools"| node_sre_service
node_agent_creator -->|"creates agents"| node_foundry
node_traffic -->|"runs agents"| node_foundry
node_traffic -->|"exports traces"| node_ai_telemetry

click node_frontend "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/frontend/agents.js"
click node_webapp "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/Program.cs"
click node_playground "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/AgentPlayground.cs"
click node_scenario_catalog "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/AgentObservabilityScenarios.cs"
click node_health "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/InfrastructureHealthService.cs"
click node_health_queries "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/InfrastructureHealthQueries.cs"
click node_operations_ui "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/frontend/lab-operations.js"
click node_operations_service "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/LabOperationsService.cs"
click node_catalog "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/LabOperationCatalog.cs"
click node_target "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/ContainerJobTarget.cs"
click node_job_operations "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/ContainerJobOperations.cs"
click node_journal "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/LabOperationsJournal.cs"
click node_sre_ui "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/frontend/sre-assistant.js"
click node_sre_assistant "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/SreAssistant.cs"
click node_sre_model "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/SreModel.cs"
click node_mcp_client "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/SreMcpClient.cs"
click node_mcp_runtime "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/SreMcpRuntime.cs"
click node_agent_creator "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/ai/create_agents.py"
click node_traffic "https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/ai/simulate_traffic.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_scenarios,node_operator toneBlue
class node_frontend,node_webapp,node_playground,node_scenario_catalog,node_health,node_health_queries,node_monitor,node_ai_telemetry toneAmber
class node_operations_ui,node_operations_service,node_catalog,node_target,node_job_operations,node_journal toneMint
class node_sre_ui,node_sre_assistant,node_sre_model,node_mcp_client,node_mcp_runtime toneRose
class node_agent_creator,node_traffic,node_azure,node_sre_service,node_foundry toneIndigo
```

## Components

### User entrypoints

- **Guided scenarios**

### Control Center

- [Control Center UI](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/frontend/agents.js): `workloads/webapp/frontend/agents.js`
- [Console API](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/Program.cs): `workloads/webapp/Program.cs`
- [Agent playground](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/AgentPlayground.cs): `workloads/webapp/AgentPlayground.cs`
- [Observability scenarios](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/AgentObservabilityScenarios.cs): `workloads/webapp/AgentObservabilityScenarios.cs`
- [Infrastructure health](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/InfrastructureHealthService.cs): `workloads/webapp/InfrastructureHealthService.cs`
- [Telemetry queries](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/InfrastructureHealthQueries.cs): `workloads/webapp/InfrastructureHealthQueries.cs`

### Lab operations

- [Operations view](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/frontend/lab-operations.js): `workloads/webapp/frontend/lab-operations.js`
- [Approval workflow](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/LabOperationsService.cs): `workloads/webapp/LabOperationsService.cs`
- [Operation catalog](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/LabOperationCatalog.cs): `workloads/webapp/LabOperationCatalog.cs`
- [Runner target validation](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/ContainerJobTarget.cs): `workloads/webapp/ContainerJobTarget.cs`
- [Container job runner](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/ContainerJobOperations.cs): `workloads/webapp/ContainerJobOperations.cs`
- [Run journal](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/LabOperationsJournal.cs): `workloads/webapp/LabOperationsJournal.cs`

### SRE assistant

- [SRE assistant view](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/frontend/sre-assistant.js): `workloads/webapp/frontend/sre-assistant.js`
- [SRE assistant](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/SreAssistant.cs): `workloads/webapp/SreAssistant.cs`
- [Model tools](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/SreModel.cs): `workloads/webapp/SreModel.cs`
- [MCP client](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/SreMcpClient.cs): `workloads/webapp/SreMcpClient.cs`
- [MCP runtime](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/webapp/SreMcpRuntime.cs): `workloads/webapp/SreMcpRuntime.cs`

### AI workload

- [Foundry agent setup](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/ai/create_agents.py): `workloads/ai/create_agents.py`
- [Agent traffic generator](https://github.com/azure-samples/azure-monitor-lab/blob/main/workloads/ai/simulate_traffic.py): `workloads/ai/simulate_traffic.py`

### Other components

- **Lab user**
- **Azure resources**
- **Azure Monitor**
- **Azure SRE Agent**
- **Microsoft Foundry**
- **AI telemetry**

## Connections

- Lab user → Guided scenarios: follows walkthroughs
- Lab user → Control Center UI: uses
- Control Center UI → Console API: calls APIs (evidence: `workloads/webapp/frontend/agents.js`)
- Console API → Agent playground: runs agents (evidence: `workloads/webapp/Program.cs`)
- Console API → Observability scenarios: serves scenarios (evidence: `workloads/webapp/Program.cs`)
- Console API → Infrastructure health: checks health (evidence: `workloads/webapp/Program.cs`)
- Infrastructure health → Telemetry queries: builds queries (evidence: `workloads/webapp/InfrastructureHealthService.cs`)
- Infrastructure health → Azure resources: reads inventory (evidence: `workloads/webapp/InfrastructureHealthService.cs`)
- Infrastructure health → Azure Monitor: queries telemetry (evidence: `workloads/webapp/InfrastructureHealthService.cs`)
- Lab user → Operations view: requests operations
- Operations view → Console API: calls APIs
- Console API → Approval workflow: handles operations (evidence: `workloads/webapp/Program.cs`)
- Approval workflow → Operation catalog: validates choices (evidence: `workloads/webapp/LabOperationsService.cs`)
- Approval workflow → Runner target validation: uses validated target (evidence: `workloads/webapp/LabOperationsService.cs`)
- Approval workflow → Container job runner: dispatches approved run (evidence: `workloads/webapp/LabOperationsService.cs`)
- Approval workflow → Run journal: records run state (evidence: `workloads/webapp/LabOperationsService.cs`)
- Container job runner → Azure resources: runs container job (evidence: `workloads/webapp/ContainerJobOperations.cs`)
- Lab user → SRE assistant view: asks questions
- SRE assistant view → Console API: calls APIs
- Console API → SRE assistant: routes requests (evidence: `workloads/webapp/Program.cs`)
- SRE assistant → Model tools: uses model
- SRE assistant → MCP client: lists and calls tools (evidence: `workloads/webapp/SreAssistant.cs`)
- MCP client → MCP runtime: prepares runtime (evidence: `workloads/webapp/SreMcpClient.cs`)
- MCP client → Azure SRE Agent: calls tools
- Foundry agent setup → Microsoft Foundry: creates agents (evidence: `workloads/ai/create_agents.py`)
- Agent traffic generator → Microsoft Foundry: runs agents (evidence: `workloads/ai/simulate_traffic.py`)
- Agent traffic generator → AI telemetry: exports traces (evidence: `workloads/ai/simulate_traffic.py`)
