Skip to main content

Logging, Monitoring, and Operations

Logs and alerts are not something you add after the first incident. They are part of the platform’s first day. If monitoring arrives late, the platform’s earliest and most formative changes happen with no record and no alerting — exactly when you most want both.

Purpose

This page defines the operational monitoring baseline for the platform: logs, metrics, Activity Logs, diagnostic settings, alerts, action groups, workbooks, and reporting.

Design Reasoning

A practical starting point is one central Log Analytics workspace in the management subscription. Microsoft’s guidance is to start with a single workspace and split only when a clear requirement exists — data residency, access isolation, cost separation, or retention differences. A useful rule of thumb: one workspace per Microsoft Entra tenant, plus a separate workspace per region only where data-residency rules demand it.

Two facts shape the rest of the design:

  • Azure does not collect resource logs automatically. Diagnostic settings must be configured per supported resource type — or, far better, deployed at scale with Azure Policy (DeployIfNotExists).
  • The Activity Log is retained for 90 days and then deleted. For longer retention and cross-subscription analysis, export it to the workspace with a diagnostic setting (it lands in the AzureActivity table).

Architecture Decision Record

DecisionChoiceRationale
Logging architectureStart with one central Log Analytics workspaceReduces complexity, avoids fragmented queries, and gives the platform a single operational view.
Diagnostics rolloutDeploy diagnostic settings at scale with policyManual per-resource configuration does not keep up; policy keeps coverage complete as the estate grows.

Tradeoff: A single workspace concentrates cost and access in one place. For most small-to-medium organizations that concentration is a feature — one place to query, one place to govern — and you split only when a concrete requirement forces it.

AreaRecommendation
Log AnalyticsOne central workspace in the management subscription as the default
Activity LogsExport with a diagnostic setting to the central workspace
Resource logsEnable diagnostic settings for critical PaaS, network, and security resources
AlertsBaseline metric, Activity Log, and log-query alerts
Action groupsCentralized groups for notifications and automation (at least one per subscription)
WorkbooksPlatform health, security posture, and subscription visibility
AccessPrefer resource-centric access; use workspace access where needed

A single action group can be reused across many alert rules, and a single alert rule can reference up to five action groups — so define a few well-named action groups (for example, one for high-severity platform alerts) and reuse them.

Example Implementation

Create the central workspace in the management subscription:

Terminal window
az group create \
--name rg-platform-monitoring-prod-sec-001 \
--location switzerlandnorth
az monitor log-analytics workspace create \
--resource-group rg-platform-monitoring-prod-sec-001 \
--workspace-name log-platform-prod-sec-001 \
--location switzerlandnorth

Failed control-plane operations in the last 24 hours:

AzureActivity
| where TimeGenerated > ago(24h)
| where ActivityStatusValue in ("Failure", "Failed")
| project TimeGenerated, Caller, OperationNameValue, ResourceGroup, SubscriptionId
| order by TimeGenerated desc

Delete operations across the estate in the last seven days:

AzureActivity
| where TimeGenerated > ago(7d)
| where OperationNameValue contains "delete"
| project TimeGenerated, Caller, OperationNameValue, _ResourceId
| order by TimeGenerated desc

Validation Steps

Terminal window
# Confirm the workspace exists
az monitor log-analytics workspace show \
--resource-group rg-platform-monitoring-prod-sec-001 \
--workspace-name log-platform-prod-sec-001
# Confirm a resource is forwarding logs
az monitor diagnostic-settings list --resource <resource-id>
# Confirm centralized action groups exist
az monitor action-group list \
--resource-group rg-platform-monitoring-prod-sec-001 \
--output table

Common Mistakes

  • Creating one workspace per team too early, before a real requirement justifies the split.
  • Not exporting Activity Logs, then losing control-plane history after 90 days.
  • Not enabling diagnostic settings for critical resources, so resource logs are simply absent.
  • Alerts without central action groups, or alerts with no owner, so notifications go nowhere.
  • Keeping logs with no retention or cost plan, which produces a surprise bill.
  • Not using workbooks for platform-level visibility.

References