Stage 5 · Platform
Azure Monitor & Observability
Dashboards & Workbooks
Build Azure Monitor Workbooks for SLO tracking and capacity dashboards.
Dashboards vs Workbooks
Azure Dashboards are simple pin-based views of metrics, logs, and resources. Workbooks are interactive, parameterized reports with rich visualizations. Use dashboards for at-a-glance monitoring and workbooks for deep analysis.
| Feature | Azure Dashboard | Azure Monitor Workbook |
|---|---|---|
| Complexity | Simple pin-based | Rich interactive reports |
| Parameters | No | Yes (dropdowns, time pickers) |
| KQL queries | Basic | Advanced with branching |
| Visualization | Charts, metrics, links | Grids, charts, maps, tiles |
| Sharing | Export/import JSON | Gallery templates |
| Best for | Quick overview | Deep analysis, SLO tracking |
Azure Dashboards
# Export a dashboard definition to a file
az portal dashboard export \
--resource-group rg-monitoring \
--name "AKS Overview" \
--output-file ./aks-dashboard.json
# Import a dashboard from a file
az portal dashboard create \
--resource-group rg-monitoring \
--name "AKS Overview" \
--input-path ./aks-dashboard.jsonDashboards are stored as JSON. You can version control them, share them between subscriptions, and create templates for standard monitoring views.
Workbooks Overview
Workbooks are interactive reports that combine KQL queries, metrics, parameters, and visualizations into a single document. They support branching logic, conditional rendering, and parameter-driven filtering.
{
"type": "Microsoft.Insights/workbooks",
"apiVersion": "2022-04-01",
"location": "eastus",
"properties": {
"displayName": "AKS SLO Dashboard",
"category": "workbook",
"dataSources": [
{
"type": "arg",
"query": "InsightsMetrics | where Namespace == 'K8SNode' | summarize avgCPU = avg(Val) by Computer",
"resources": ["/subscriptions/{sub-id}/resourceGroups/rg-monitoring/providers/Microsoft.OperationalInsights/workspaces/law-aks"]
}
],
"visualization": {
"type": "metric",
"metrics": [
{
"resourceMetadata": {},
"name": "avgCPU",
"aggregationType": 4
}
]
}
}
}Workbooks are stored as ARM resources. They can be deployed via ARM templates, Bicep, or Terraform for consistent monitoring across environments.
Workbook Components
- Parameters — Dropdowns, text inputs, time pickers that filter workbook content
- Query Steps — KQL or metric queries that feed visualizations
- Visualizations — Charts, grids, tiles, maps, and metric plots
- Links — Navigation to other workbooks or Azure resources
- Groups — Collapsible sections for organizing content
- Conditional Visibility — Show/hide elements based on parameter values
Building an SLO Workbook
// Calculate availability SLO (target: 99.9%)
let totalRequests = requests
| where timestamp > ago(30d)
| summarize Total = count();
let failedRequests = requests
| where timestamp > ago(30d)
| where success == false
| summarize Failed = count();
totalRequests
| extend Availability = round((1.0 - todouble(Failed) / todouble(Total)) * 100, 3)
| extend SLOTarget = 99.9
| extend ErrorBudget = round(SLOTarget - Availability, 3)This query calculates the actual availability over 30 days and compares it against the SLO target. The error budget shows how much more downtime is allowed before the SLO is breached.
// Error budget burn rate (how fast are we consuming the error budget?)
let slo_target = 99.9;
let error_budget = 100 - slo_target; // 0.1%
let window = 30d;
let total = requests
| where timestamp > ago(window)
| summarize Total = count();
let errors = requests
| where timestamp > ago(window)
| where success == false
| summarize Errors = count();
total
| extend ActualErrorRate = round(todouble(Errors) / todouble(Total) * 100, 4)
| extend BurnRate = round(ActualErrorRate / error_budget, 2)
| extend BudgetRemaining = round(error_budget - ActualErrorRate, 4)A burn rate of 1.0 means you are consuming the error budget at the expected rate. Above 1.0 means you are burning through the budget faster than planned.
The Azure Monitor Gallery contains hundreds of pre-built workbook templates for AKS, VMs, networks, and services. Search the gallery in the Portal or deploy them via Bicep for immediate value.
Workbook Templates
# List available workbook templates
az monitor app-insights component show \
--app ai-payments-prod \
--resource-group rg-payments \
--query "ApplicationId" --output tsv
# Deploy a workbook via ARM template
az deployment group create \
--resource-group rg-monitoring \
--template-file workbook-aks-slo.json \
--parameters workspaceId="/subscriptions/{sub-id}/resourceGroups/rg-monitoring/providers/Microsoft.OperationalInsights/workspaces/law-aks"Workbooks can be deployed as part of infrastructure-as-code. Store workbook definitions in Git and deploy them alongside your monitoring infrastructure.
Unlike dashboards, workbooks can query data from multiple Log Analytics workspaces, Azure Monitor metrics, and Azure Resource Graph in a single view. This makes them ideal for enterprise-wide monitoring.
Mark this lesson complete to store local progress and unlock a cleaner resume path the next time you visit.