Learning Objectives
By the end of this chapter, you will be able to:
- Monitor resources in Azure.
- Implement backup and recovery.
Executive Summary
- Azure Monitor unifies two data types: metrics (numeric time-series retained for 93 days) and logs (structured records stored in a Log Analytics workspace and queried with KQL). Every resource emits platform metrics automatically; resource logs require an explicit diagnostic setting.
- The activity log is a subscription-scoped control plane audit trail retained for 90 days by default. To keep it longer, route it to a Log Analytics workspace, storage account, or event hub through a diagnostic setting.
- Azure Backup uses two vault types with no overlap in workloads. A Recovery Services vault protects Azure VMs, SQL and SAP HANA inside VMs, Azure Files, and on-premises servers through MARS, MABS, or DPM. A Backup vault protects Azure Managed Disks, Azure Blobs, Kubernetes, and Azure Database for PostgreSQL servers.
- Azure Site Recovery (ASR) and Azure Backup solve different problems. ASR replicates running workloads to a secondary region for failover with low RPO. Azure Backup creates point-in-time snapshots for granular item or full-machine recovery with longer retention.
Assumptions
- All resource names follow the convention
rg-contoso-prod-eus,vm-app01,log-contoso-prod-eus,rsv-contoso-prod-eus, andbv-contoso-prod-eusfor resource group, virtual machine, Log Analytics workspace, Recovery Services vault, and Backup vault respectively. Region codes assume Azure commercial cloud. - The Azure CLI examples assume
azversion 2.50 or later and PowerShell examples assume theAzmodule 11.0 or later. All snippets are runnable as written after substituting subscription IDs. - The Log Analytics agent (also known as Microsoft Monitoring Agent or MMA) was retired on August 31, 2024. All agent-based examples in this chapter use the Azure Monitor Agent (AMA) with data collection rules.
