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
AzureActivitytable).
Architecture Decision Record
| Decision | Choice | Rationale |
|---|---|---|
| Logging architecture | Start with one central Log Analytics workspace | Reduces complexity, avoids fragmented queries, and gives the platform a single operational view. |
| Diagnostics rollout | Deploy diagnostic settings at scale with policy | Manual 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.
Recommended Configuration
| Area | Recommendation |
|---|---|
| Log Analytics | One central workspace in the management subscription as the default |
| Activity Logs | Export with a diagnostic setting to the central workspace |
| Resource logs | Enable diagnostic settings for critical PaaS, network, and security resources |
| Alerts | Baseline metric, Activity Log, and log-query alerts |
| Action groups | Centralized groups for notifications and automation (at least one per subscription) |
| Workbooks | Platform health, security posture, and subscription visibility |
| Access | Prefer 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:
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 switzerlandnorthFailed 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 descDelete 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 descValidation Steps
# Confirm the workspace existsaz 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 logsaz monitor diagnostic-settings list --resource <resource-id>
# Confirm centralized action groups existaz monitor action-group list \ --resource-group rg-platform-monitoring-prod-sec-001 \ --output tableCommon 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.