Pcornel
Cloud · Microsoft Azure

Azure Monitor and Log Analytics

Cheat sheet · https://pcornel.dk/topic.php?topic=7001

Back to the Topic

Answer

Azure Monitor collects metrics, logs and traces from Azure resources, VMs, containers and applications. Platform metrics and the Activity log are collected automatically; resource logs need a diagnostic setting; guest OS data needs the Azure Monitor Agent with a data collection rule. Logs land in a Log Analytics workspace and are queried with KQL.

Remember

No diagnostic setting, no resource logs. Metrics ≠ logs: metrics are numeric time series kept automatically for a limited time; logs are records you choose to collect and pay for. Query scope decides what you see: workspace scope shows all its data, resource scope only that resource's.

First checks

  • az monitor diagnostic-settings list --resource <id> — is anything collected, and where to?
  • az monitor metrics list --resource <id> --metric <name> — platform metric values.
  • KQL Heartbeat | summarize max(TimeGenerated) by Computer — which agents still report.
  • az monitor activity-log list — control-plane changes.

Verify in this order

resource/VM → collection (platform metrics, diagnostic setting, AMA + DCR) → destination (workspace, storage, event hub) → query (KQL / metrics explorer) → alert rule → action group → people/automation

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=7001

Confirmation

Confirm action

Continue?