Observability & Alert Response
Operator playbook for inspecting live Aspire Dashboard telemetry, running Log Analytics KQL queries, checking resource saturation, and responding to alerts.
When to Use & Blast Radius
Use this guide when an Azure Monitor alert fires, latency degrades, or you need to correlate distributed traces and logs across API Gateway, backend services, Message Broker consumers, and AI pipelines. All commands in this runbook are read-only and safe to run against Production.
Telemetry and Alerting Surface
Loading graph...
Pre-Flight Check
Verify your Azure CLI context and retrieve the Log Analytics workspace ID before running queries:
az account set --subscription "<SUBSCRIPTION_ID>"WORKSPACE_ID=$(az monitor log-analytics workspace list --resource-group "<RESOURCE_GROUP>" --query "[0].customerId" -o tsv)echo "Workspace ID: ${WORKSPACE_ID}"Procedure
Stream live container logs for immediate triage
Stream real-time stdout/stderr or platform lifecycle events without waiting for Log Analytics ingestion lag:
Terminal window # Application stdout/stderraz containerapp logs show --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" --type console --follow# Platform events (image pulls, probe failures, scaling)az containerapp logs show --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" --type system --tail 100Query application errors and trace IDs in Log Analytics
Run KQL queries across all Container Apps to surface recent exceptions or correlate a single request by
<TRACE_ID>:Terminal window # Recent application errors across all servicesaz monitor log-analytics query --workspace "${WORKSPACE_ID}" \--analytics-query "ContainerAppConsoleLogs_CL | where TimeGenerated > ago(1h) | where Log_s has_any ('Error','Exception','Unhandled','Failed') | summarize ErrorCount=count() by ContainerAppName_s | order by ErrorCount desc" \-o table# Correlate a specific trace or request ID end-to-endaz monitor log-analytics query --workspace "${WORKSPACE_ID}" \--analytics-query "ContainerAppConsoleLogs_CL | where TimeGenerated > ago(2h) | where Log_s contains '<TRACE_ID>' | project TimeGenerated, ContainerAppName_s, Log_s | order by TimeGenerated asc" \-o tableInspect asynchronous Message Broker and dead-letter queue logs
Check consumer failures and dead-letter routing across Ordering Service, Finance Orchestrator, Basket Service, Notification Service, Catalog Service, Catalog Ingestion, Rating Service, and Scheduler Service:
Terminal window az monitor log-analytics query --workspace "${WORKSPACE_ID}" \--analytics-query "ContainerAppConsoleLogs_CL | where TimeGenerated > ago(1h) | where ContainerAppName_s in ('ordering','finance','basket','notification','catalog','catalog-ingestion','rating','scheduler') | where Log_s has_any ('dead-letter','Wolverine','Kafka','ConsumeException') | project TimeGenerated, ContainerAppName_s, Log_s | order by TimeGenerated desc | take 50" \-o tableCheck compute and datastore saturation
Inspect Container App replica counts, PostgreSQL CPU/storage, and Redis memory pressure:
Terminal window # Container App active replicas and provisioning stateaz containerapp revision list --name "<APP_NAME>" --resource-group "<RESOURCE_GROUP>" \--query "[?properties.active==\`true\`].{Revision:name, Replicas:properties.replicas, Health:properties.healthState}" -o table# PostgreSQL CPU and storage utilization (last 30 minutes)PG_ID=$(az postgres flexible-server show --name "<POSTGRES_SERVER>" --resource-group "<RESOURCE_GROUP>" --query id -o tsv)az monitor metrics list --resource "${PG_ID}" --metric cpu_percent storage_percent --interval PT5M --output table# Azure Managed Redis memory usageREDIS_ID=$(az redisenterprise show --name "<REDIS_NAME>" --resource-group "<RESOURCE_GROUP>" --query id -o tsv)az monitor metrics list --resource "${REDIS_ID}" --metric usedmemorypercentage --interval PT5M --output tableInspect live traces in the managed Aspire Dashboard
In the Azure Portal, open Resource groups →
<RESOURCE_GROUP>→ Container Apps Environment → Aspire Dashboard to view end-to-end W3C traces, ASP.NET Core / HTTP metrics, and structured logs. For local troubleshooting, openhttps://localhost:17290.
Common Alert Playbooks
- Run the KQL error summary query in Step 2 to identify which
<APP_NAME>is throwing exceptions. - Check
ContainerAppSystemLogs_CLforContainerTerminatedorUnhealthyProbeevents:
az monitor log-analytics query --workspace "${WORKSPACE_ID}" \ --analytics-query "ContainerAppSystemLogs_CL | where TimeGenerated > ago(1h) | where Reason_s in ('ContainerTerminated','ImagePullFailed','UnhealthyProbe') | project TimeGenerated, ContainerAppName_s, Reason_s, Log_s | order by TimeGenerated desc" -o table- If correlated with a recent deployment, follow Deployment & Rollback RunbookCustom DocDeployment & Rollback RunbookOperator runbook for deploying BookWorm releases, shifting Container App revision traffic, and executing instant rollbac...Ownerplatform-engineering-teamOpen doc to roll back the revision immediately.
- Open Application Insights linked to the AI project and filter Failures for HTTP
429onchat,decision, orembeddingdeployments. 2. Check Privacy Analyzer and Privacy Anonymizer Container Apps (presidio-analyzer,presidio-anonymizer) for CPU/replica saturation. 3. Increase model RPM/TPM capacity in Microsoft Foundry or scale up the privacy sidecars using Scaling & Cost GuardrailsCustom DocScaling & Cost GuardrailsCloud/DevOps runbook for manual Container App replica overrides, concurrency and KEDA scaling limits, and pausing non-pr...Ownerplatform-engineering-teamOpen doc.
- Verify
cpu_percentandstorage_percenton<POSTGRES_SERVER>andusedmemorypercentageon<REDIS_NAME>using Step 4. - Check for runaway batch jobs in Quartz Dashboard (
https://quartz-dashboard.<DOMAIN>/quartz) or stuck sagas in Finance Orchestrator. - Scale compute/storage SKUs temporarily or pause non-critical batch ingestion until saturation subsides.
When an Azure Monitor alert triggers an Azure SRE Agent incident workflow, the agent automatically correlates Application Insights failures, Log Analytics exceptions, and recent deployment history.
- Verify the
sreAzure CLI extension is available (az sre --help) or query the agent’s threads endpoint:Terminal window SRE_ENDPOINT=$(az rest -m GET \--url "https://management.azure.com/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.App/agents/<SRE_AGENT_NAME>?api-version=2025-05-01-preview" \--query properties.agentEndpoint -o tsv)SRE_TOKEN=$(az account get-access-token --resource https://azuresre.dev --query accessToken -o tsv)curl -s -H "Authorization: Bearer ${SRE_TOKEN}" "${SRE_ENDPOINT}/api/v1/threads" - Approve or reject proposed mitigations in the Azure Portal (Review mode) before any automated scaling or restart action runs against
Production.
Verification
Confirm log ingestion is active across all Container Apps within the last 15 minutes:
az monitor log-analytics query --workspace "${WORKSPACE_ID}" \ --analytics-query "ContainerAppConsoleLogs_CL | where TimeGenerated > ago(15m) | summarize Logs=count() by ContainerAppName_s | order by ContainerAppName_s asc" \ -o tableExpected output:
ContainerAppName_s Logs-------------------- ------backoffice 14basket 22catalog 41commerce 12gateway 105...Rollback / Escape Hatch
All diagnostic queries in this runbook are read-only. If you adjusted log sampling, diagnostic settings, or alert thresholds during an incident, revert them to baseline via aspire deploy --environment "<ENV>".