Azure Monitor Overview: Metrics, Logs, and Alerts

Every system will eventually misbehave. The question is whether you find out from a monitoring alert or from a customer complaint. Azure Monitor is Microsoft’s answer to that challenge — a unified observability platform that collects metrics, stores logs, fires alerts, and visualizes data across your entire Azure footprint and beyond.

What Azure Monitor actually does

Azure Monitor is not a single service — it is a platform made up of several interconnected capabilities. When you deploy anything in Azure, Monitor starts collecting data almost immediately. A virtual machine emits CPU and disk metrics. An App Service instance reports HTTP response times. A storage account tracks transaction counts and latency. All of this flows into Azure Monitor without you writing a line of code.

At the highest level, Azure Monitor deals with two categories of data:

  • Metrics — Numerical measurements collected at regular intervals (typically every 60 seconds). Examples: CPU percentage, memory used, requests per second, HTTP 5xx errors. Metrics are lightweight and ideal for real-time dashboards and fast alerting.
  • Logs — Structured or semi-structured records that capture events, errors, traces, and detailed diagnostic information. Logs live in a Log Analytics workspace and are queried using Kusto Query Language (KQL).

On top of these data types, Monitor provides alerting, dashboards, workbooks, and integration with ITSM tools like ServiceNow and PagerDuty.

Where the data comes from

Azure Monitor ingests telemetry from a wide range of sources. Understanding these sources helps you know what monitoring is automatic and what requires explicit configuration.

Data SourceData TypeConfiguration Required
Azure resources (VMs, App Service, SQL)Platform metricsNone — automatic
Azure Activity LogLogs (control-plane events)None — automatic
Resource diagnostic logsLogs (data-plane events)Enable diagnostic settings per resource
Guest OS (VM agents)Metrics and logsInstall Azure Monitor Agent
ApplicationsTraces, exceptions, custom eventsInstrument with Application Insights SDK
On-premises / other cloudsMetrics and logsAzure Arc or Log Analytics agent
Kubernetes (AKS)Metrics, logs, container insightsEnable Container Insights add-on

Metrics: fast data for fast decisions

Platform metrics are stored in Azure Monitor’s time-series database for 93 days at no cost. They are available in near real-time — usually within 2–3 minutes of the underlying event. You can view them in the Metrics Explorer, pin them to dashboards, or use them to trigger metric alerts.

Metrics support multiple aggregations: average, minimum, maximum, sum, and count. When you are charting CPU usage, “average” gives you a trend line, but “maximum” reveals the worst-case spikes that can cause latency bursts.

You can query and export metrics using the Azure CLI:

# List available metrics for an App Service plan
az monitor metrics list-definitions \
  --resource /subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.Web/serverFarms/<plan-name> \
  --output table

# Retrieve CPU percentage for the last hour, averaged every 5 minutes
az monitor metrics list \
  --resource /subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.Web/serverFarms/<plan-name> \
  --metric "CpuPercentage" \
  --interval PT5M \
  --start-time 2026-03-19T10:00:00Z \
  --end-time 2026-03-19T11:00:00Z \
  --aggregation Average \
  --output table

Logs: the full story behind every event

Logs capture context that metrics cannot. A metric can tell you that your error rate spiked at 2:14 PM. A log entry tells you which request failed, which user triggered it, what the exception stack trace was, and which downstream service returned an error.

Logs in Azure Monitor are stored in a Log Analytics workspace — a centralized repository that acts like a database. Multiple resources can send their logs to the same workspace, and you query across all of them using KQL.

Here is a basic KQL query to find errors in the last hour:

// Find all error-level events in the last hour
AzureDiagnostics
| where TimeGenerated > ago(1h)
| where Level == "Error"
| project TimeGenerated, ResourceType, OperationName, ResultDescription
| order by TimeGenerated desc
| limit 50
Note

Logs are not retained forever. The default retention in a Log Analytics workspace is 30 days. You can extend this to up to 730 days (paid) or export to a storage account for long-term archival.

Alerts: from data to action

Azure Monitor alerts watch your metrics and logs continuously and notify you — or trigger automated responses — when conditions are met. There are four alert types:

  • Metric alerts — Trigger when a metric crosses a static or dynamic threshold. Best for real-time conditions like high CPU or low available memory.
  • Log search alerts — Run a KQL query on a schedule and alert when the result count or value meets a condition. Best for error patterns in log data.
  • Activity log alerts — Trigger on Azure control-plane events like resource deletion, role assignment changes, or service health advisories.
  • Smart detection alerts — Used by Application Insights to automatically detect anomalies in application telemetry without manual threshold configuration.

Alerts route through action groups — reusable collections of notification targets (email, SMS, webhook, Azure Function, Logic App, ITSM connector). One action group can be shared across many alert rules.

Enabling diagnostic settings

Many Azure services do not send their detailed logs to a Log Analytics workspace by default. You need to configure a diagnostic setting to enable this. You can do this through the portal, ARM templates, or the CLI.

# Enable diagnostic settings for an Azure SQL Database
az monitor diagnostic-settings create \
  --name "sql-diagnostics" \
  --resource /subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.Sql/servers/<server>/databases/<db> \
  --workspace /subscriptions/<sub-id>/resourceGroups/<rg>/providers/Microsoft.OperationalInsights/workspaces/<workspace> \
  --logs '[{"category": "SQLInsights", "enabled": true}, {"category": "Errors", "enabled": true}]' \
  --metrics '[{"category": "Basic", "enabled": true}]'
Tip

Use Azure Policy to automatically apply diagnostic settings to all resources of a given type in a subscription. This prevents new resources from being deployed without monitoring configured.

How the pieces fit together

Think of Azure Monitor as the central nervous system for your cloud environment. Resources generate signals. Those signals flow into the metrics store and the Log Analytics workspace. Queries and thresholds evaluate those signals. Alerts fire and route to action groups. Workbooks and dashboards visualize everything for humans.

Application Insights adds application-level depth to this picture — tracking individual HTTP requests, dependencies, exceptions, and custom business events. Container Insights does the same for Kubernetes workloads. Network Watcher covers connectivity and packet-level diagnostics.

None of these are replacements for Azure Monitor — they are components within it, each covering a specific observability layer.

Common mistakes

  1. Assuming all logs are collected automatically. Platform metrics flow without configuration, but resource diagnostic logs require you to enable a diagnostic setting per resource. New resources will have no logs until you configure this.
  2. Using a single Log Analytics workspace for everything forever. A single workspace simplifies cross-resource queries, but very large organizations may need workspace-per-region for data residency compliance or cost allocation reasons.
  3. Ignoring the Activity Log. The Activity Log records every control-plane action in your subscription — who deleted what, when, from which IP. It is invaluable for security audits and incident post-mortems.
  4. Setting alert thresholds without baseline data. Alert on CPU > 80% sounds reasonable until you discover your application normally runs at 75%. Spend two weeks collecting baseline data before finalizing thresholds.

Frequently asked questions

What is Azure Monitor?

Azure Monitor is Microsoft's unified monitoring platform that collects, analyzes, and acts on telemetry data from Azure resources, on-premises environments, and other clouds.

Is Azure Monitor free?

Some features are free (first 5 GB of log ingestion per month, basic metrics retention), but Log Analytics ingestion, custom metrics, and alert rules beyond the free tier have associated costs.

How is Azure Monitor different from Application Insights?

Application Insights is a feature of Azure Monitor specifically designed for application performance monitoring (APM). Azure Monitor is the umbrella platform; Application Insights sits within it.

Last verified: 19 March 2026 Cloud services change frequently. Verify details against official documentation before making infrastructure decisions.