Azure records every control plane change for free, keeps it for 90 days, and records almost nothing about data access unless someone creates a diagnostic setting on each resource. That is the main Azure logging gap: Key Vault secret reads, storage blob downloads, SQL logins and network security group flows are resource logs, and resource logs are not collected by default. Incident responders routinely find that the one resource that mattered had no diagnostic setting, or that the Activity Log rolled off before anyone exported it. This guide explains how the Activity Log, resource logs and diagnostic settings fit together in Azure Monitor, who can change them, how to deploy them at scale with Azure Policy, how to protect the destinations, and how to detect anyone switching them off. It is for Azure platform engineers, SOC teams and auditors. The provider-neutral view is in the Cloud Logging and Audit Trail Guide; Entra ID logs are covered in the Entra ID Sign-In and Audit Log Detection Guide.
This is an independent guide from NHI Mgmt Group, based on Microsoft's public documentation as of November 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.
Key takeaways
- Two log families, different defaults: the Activity Log (control plane) is collected automatically and kept 90 days at no charge; resource logs (data plane) exist only where a diagnostic setting sends them somewhere.
- Coverage is per resource: each resource needs its own diagnostic setting, up to five per resource, so coverage must be enforced with Azure Policy DeployIfNotExists and remediation tasks, not by hand.
- Use category groups:
allLogsorauditcategory groups keep settings current as services add log categories, where supported. - Destinations are evidence stores: the Log Analytics workspace, storage account or event hub holding logs needs its own access model, immutability and monitoring.
listKeyson a log storage account exposes everything in it. - Logging changes are attack signals: alert on
Microsoft.Insights/diagnosticSettings/deleteand/write, workspace deletion and retention changes, with no suppression (ATT&CK T1685.002 Disable or Modify Cloud Log).
How identity and access work in Azure Monitor logging
What each log source records
| Source | Records | Collected by default | Retention without export | Where it lands when exported |
|---|---|---|---|---|
| Activity Log (subscription) | Resource Manager write, delete and action operations; Policy, Security, Service Health and other categories | Yes | 90 days, no charge | AzureActivity table (no ingestion charge in Log Analytics), storage, Event Hubs |
| Activity Log (management group and tenant) | Resource Manager events at those scopes, such as management group and subscription creation | Yes | 90 days | Management group diagnostic setting covers that group and all below it |
| Resource logs | Data plane and service-specific operations: Key Vault AuditEvent, storage read and write logs, SQL audit, NSG and firewall logs | No | None | Resource-specific tables or AzureDiagnostics, storage, Event Hubs, partner solutions |
| Platform metrics | Numeric performance data | Yes | Kept in metrics store | Optional export; not all metrics are exportable |
| Entra ID logs | Sign-ins, directory audit, provisioning | Yes, short retention | Depends on licence | Tenant-level diagnostic setting in Entra ID |
Microsoft documents two scope details that matter. Events without the hierarchy property (non-Resource Manager providers do not populate it) do not propagate to management group diagnostic settings, so subscription-level settings are still needed for complete capture. And the same event reaching one destination through several settings creates duplicates, which you can remove at query time with a hash and arg_max.
Who can read and change logging
- Monitoring Reader: views monitoring data, Activity Log and diagnostic settings; changes nothing.
- Monitoring Contributor: adds creating and editing diagnostic settings, alert rules and listing workspace shared keys. Sending logs to a storage account or event hub also needs
listKeyson that target, which Microsoft says to grant at resource or resource group scope, never subscription. - Log Analytics Reader and Contributor: Reader queries all data in a workspace but cannot read the workspace shared key; Contributor can also configure diagnostic settings, data export and read storage account keys. Microsoft warns that the Contributor's ability to add VM extensions can give full control of a virtual machine.
- Workspace access control mode: workspaces created after March 2019 default to Use resource or workspace permissions, so application teams can query their own resources' logs in resource-context without workspace access. Granular RBAC with role assignment conditions is the recommended way to restrict tables and rows.
Admin roles and privileged access
Anyone who can write diagnostic settings can turn off evidence collection or redirect it to a destination they control. Treat these permissions as privileged:
| Permission or role | Why it is sensitive | Recommended holder |
|---|---|---|
Microsoft.Insights/diagnosticSettings/write and /delete (in Monitoring Contributor, Contributor, Owner) | Disable or redirect resource logs | Policy remediation identity and platform pipeline; humans through PIM only |
Microsoft.OperationalInsights/workspaces/delete and retention settings | Destroy or shorten the evidence store | Platform logging team through PIM; protect with a delete lock |
Microsoft.Storage/storageAccounts/listkeys/action on log storage | Keys give full signed access to all services in the account | Nobody routinely; use Entra ID authorisation and read-only SAS for consumers |
Microsoft.EventHub/namespaces/authorizationrules/listkeys/action | Read or inject the SIEM stream | SIEM connector identity with a listen-only policy |
| Microsoft Sentinel Contributor on the workspace | Disable analytics rules and automation | SOC engineering through PIM |
Keep monitoring resources in a dedicated subscription or resource group, as Microsoft advises, so monitoring roles can be scoped to them without granting access to anything else. In an Azure landing zone this is the Management subscription. See the Azure Landing Zones Security Guide and the Azure RBAC and Service Principals Guide.
Integrations, API tokens and service accounts
- Azure Policy remediation identity: DeployIfNotExists assignments run remediation as a managed identity (system-assigned by default) that needs rights to write diagnostic settings on every resource in scope and to reach the destination. It is a powerful non-human identity: scope the assignment, review its role assignments, and do not reuse it for other policies.
- Event Hubs to SIEM: create a listen-only shared access policy for the SIEM consumer (Microsoft gives the example name
monitoringReadOnly), prefer Entra ID authentication where the SIEM supports it, and rotate keys on a schedule. - Storage for long-term archive: use a dedicated account, immutable storage policies, and read-only SAS for auditors instead of account keys. Storage accounts and event hubs used as destinations must be in the same region as the monitored regional resource, and if they use virtual network rules, Allow trusted Microsoft services must be enabled.
- Cross-tenant collection: sending logs to a destination in another Entra tenant uses Azure Lighthouse, which makes the managing tenant part of your evidence chain. See the Cross-Account and Cross-Tenant Access Guide.
- Workspace shared keys: legacy agents and APIs authenticate with them; the Log Analytics Reader role deliberately excludes reading them. Move ingestion to the Azure Monitor Agent with data collection rules and Entra ID authentication.
Logging and detection
Choosing destinations
| Need | Destination | Trade-off |
|---|---|---|
| Query, correlate and alert, Microsoft Sentinel | Log Analytics workspace | Ingestion cost for resource logs; Activity Log ingestion is free; retention extendable up to 12 years |
| Third-party SIEM | Event Hubs | Near real time; the namespace and its keys become part of your attack surface |
| Cheap long-term evidence | Storage account with immutability | Not queryable without extra tooling; same region constraint |
A small organisation can send everything to one workspace in the Management subscription and rely on Activity Log being free to ingest. A large or regulated one typically runs a central workspace for security tables, resource-context access for application teams, Event Hubs for a non-Microsoft SIEM, and an immutable storage archive for retention obligations.
Detections for the logging plane
- Diagnostic setting deleted or changed:
AzureActivitywhereOperationNameValuematchesMICROSOFT.INSIGHTS/DIAGNOSTICSETTINGS/DELETEor/WRITEand the caller is not the policy remediation identity. Field values vary in case, so compare with=~. - Workspace or retention change: deletion of Log Analytics workspaces, table retention reductions and data export rule changes.
- Policy weakened: deletion of diagnostic setting policy assignments or exemptions created against them.
- Key listing on log destinations:
listKeyson log storage accounts or event hub authorisation rules. - Silence: a resource or subscription that stops sending logs. Build a heartbeat query that compares expected sources with those seen in the last hour.
- Entra ID logging changes: the tenant-level diagnostic setting that exports Entra ID sign-in and audit logs is configured in Entra ID, not on an Azure resource, so it is invisible to resource policies. Check it separately, restrict who can change it, and alert on its modification in the Entra ID audit log.
- Timing expectations: Activity Log entries are usually available for analysis and alerting within 3 to 20 minutes, according to Microsoft. Set alert SLAs with that delay in mind rather than assuming real time.
Useful detection points include Activity Log monitoring for listKeys, publishing profile retrieval and firewall rule writes, plus Key Vault logging with purge protection and long retention. Without Key Vault resource logs, secret reads leave no record at all.
Hardening baseline
- Export the Activity Log from every subscription to the central workspace through a DeployIfNotExists policy at the top of the hierarchy, and add management group diagnostic settings for hierarchy-level events. Disable any legacy log profiles.
- Enable resource logs by policy: assign the built-in initiatives for the
allLogsorauditcategory group to Log Analytics (and Event Hubs or Storage where needed) at management group scope. ThecategoryGroupparameter defaults toaudit; choose deliberately. - Remediate existing resources: assignments apply only to new resources until you run a remediation task, and an initiative needs a remediation task for each policy in it.
- Fill the gaps: for resource types without built-in policies, write custom policies; verify coverage against the supported resource list, which shows some types support only one category group.
- Prioritise data plane logs for Key Vault, storage accounts holding sensitive data, SQL, Azure Firewall, NSG and virtual network flow logs, and Entra ID.
- Protect destinations: delete locks on workspaces, immutability on archive storage, Entra ID authorisation instead of keys, private endpoints where supported.
- Set retention to cover your investigation window and regulatory obligations; 90 days of Activity Log is rarely enough for an incident discovered months later.
- Test: create a test resource in a sandbox subscription, confirm the policy deploys its setting (Microsoft says data should arrive within 90 minutes; investigate after 24 hours), then delete the setting and confirm the alert fires.
- Roll back safely: switch a problematic assignment's effect to
AuditIfNotExistsrather than deleting it, so coverage gaps stay visible while you fix the issue.
| Metric | Target |
|---|---|
| Subscriptions exporting Activity Log to the central workspace | 100% |
| Supported resources compliant with the diagnostic settings initiative | Above 98%, gaps owned |
| Key Vaults and sensitive storage accounts sending audit logs | 100% |
| Unexplained diagnostic setting deletions | Zero; every one investigated |
| Log retention meeting policy for security tables | 100% |
Common misconfigurations
- Relying on the 90-day Activity Log: no export, so the history an investigation needs has gone. The Activity Log is also the only record of a resource's creator.
- Policy assigned, never remediated: new resources compliant, the existing estate not, and nobody notices because the compliance view is not reviewed.
- Diagnostic setting left on deleted resources: Microsoft warns to delete settings before deleting, renaming or moving a resource, because they can apply to a re-created resource with the same name.
- Logs sent back to themselves: configuring a storage account or event hub to log into itself through the API can create an infinite write loop.
- Broad Monitoring Contributor: granted at subscription scope to developers, giving them the ability to disable logs on production resources.
- Sentinel-enabled workspace behind Network Security Perimeter: As of November 2026 Microsoft documents that associating a Sentinel-enabled Log Analytics workspace with NSP disables analytic rules, so keep such workspaces outside NSP and confirm with Microsoft. See the Cloud Data Perimeter Guide.
Framework mapping
| Framework | Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev. 5 | AU-2 Event Logging; AU-4 Audit Log Storage Capacity; AU-6(3) Correlate Audit Record Repositories; AU-9 Protection of Audit Information; AU-9(4) Access by Subset of Privileged Users; AU-11 Audit Record Retention; AU-12 Audit Record Generation | Coverage, storage, protection, retention and correlation |
| NIST CSF 2.0 | PR.PS-04; DE.CM-09; DE.AE-03 | Logs generated and available; monitoring; correlation |
| CIS Controls v8.1 | Control 8 Audit Log Management | Collection, storage, retention and review |
| ISO/IEC 27001:2022 Annex A | 8.15 Logging; 8.16 Monitoring activities | Producing, protecting and analysing logs |
| Microsoft cloud security benchmark | Logging and threat detection (LT) domain | Azure baseline for audit log collection and retention |
| MITRE ATT&CK v20 | T1685.002 Disable or Modify Cloud Log; T1098.003 Additional Cloud Roles; T1078.004 Cloud Accounts | Defence impairment against logging and the privilege it needs |
Practitioner checklist
- Export the Activity Log from every subscription and add management group diagnostic settings.
- Assign the built-in diagnostic settings initiatives at management group scope and run remediation tasks for every policy.
- Confirm Key Vault, sensitive storage, SQL, firewall and flow logs are collected, with custom policies for unsupported types.
- Restrict diagnostic setting write and delete to the remediation identity and PIM-activated platform roles.
- Keep log destinations in a dedicated subscription with locks, immutability and no routine key access.
- Set retention to meet investigation and regulatory needs beyond the 90-day default.
- Alert on diagnostic setting, workspace, retention and policy assignment changes, and on sources going silent.
- Test coverage and alerts in a sandbox subscription after every policy or schema change.
Standards and references
- Microsoft Learn: Activity log in Azure Monitor
- Microsoft Learn: Diagnostic settings in Azure Monitor
- Microsoft Learn: Create diagnostic settings at scale using built-in Azure Policies
- Microsoft Learn: Azure Activity Log event schema
- Microsoft Learn: Roles, permissions and security in Azure Monitor
- Microsoft Learn: Manage access to Log Analytics workspaces
- Microsoft Learn: Microsoft cloud security benchmark
- NIST: SP 800-53 Rev. 5
Related NHI Mgmt Group resources: Cloud Logging and Audit Trail Guide · Microsoft Sentinel Guide · Cloud Detection Engineering Guide · Microsoft Azure Security Guide