Join our Newsletter — 33% off our NHI Course
Home› Guides› Azure Monitor, Activity Log and Diagnostic Settings Guide:…
Guide Cloud Security

Azure Monitor, Activity Log and Diagnostic Settings Guide: Closing Azure Logging Coverage Gaps

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, edited by Lalit Choda Updated 8 November 2026 12 min read
On this page

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: allLogs or audit category 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. listKeys on a log storage account exposes everything in it.
  • Logging changes are attack signals: alert on Microsoft.Insights/diagnosticSettings/delete and /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

SourceRecordsCollected by defaultRetention without exportWhere it lands when exported
Activity Log (subscription)Resource Manager write, delete and action operations; Policy, Security, Service Health and other categoriesYes90 days, no chargeAzureActivity 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 creationYes90 daysManagement group diagnostic setting covers that group and all below it
Resource logsData plane and service-specific operations: Key Vault AuditEvent, storage read and write logs, SQL audit, NSG and firewall logsNoNoneResource-specific tables or AzureDiagnostics, storage, Event Hubs, partner solutions
Platform metricsNumeric performance dataYesKept in metrics storeOptional export; not all metrics are exportable
Entra ID logsSign-ins, directory audit, provisioningYes, short retentionDepends on licenceTenant-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 listKeys on 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 roleWhy it is sensitiveRecommended holder
Microsoft.Insights/diagnosticSettings/write and /delete (in Monitoring Contributor, Contributor, Owner)Disable or redirect resource logsPolicy remediation identity and platform pipeline; humans through PIM only
Microsoft.OperationalInsights/workspaces/delete and retention settingsDestroy or shorten the evidence storePlatform logging team through PIM; protect with a delete lock
Microsoft.Storage/storageAccounts/listkeys/action on log storageKeys give full signed access to all services in the accountNobody routinely; use Entra ID authorisation and read-only SAS for consumers
Microsoft.EventHub/namespaces/authorizationrules/listkeys/actionRead or inject the SIEM streamSIEM connector identity with a listen-only policy
Microsoft Sentinel Contributor on the workspaceDisable analytics rules and automationSOC 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

NeedDestinationTrade-off
Query, correlate and alert, Microsoft SentinelLog Analytics workspaceIngestion cost for resource logs; Activity Log ingestion is free; retention extendable up to 12 years
Third-party SIEMEvent HubsNear real time; the namespace and its keys become part of your attack surface
Cheap long-term evidenceStorage account with immutabilityNot 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: AzureActivity where OperationNameValue matches MICROSOFT.INSIGHTS/DIAGNOSTICSETTINGS/DELETE or /WRITE and 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: listKeys on 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

  1. 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.
  2. Enable resource logs by policy: assign the built-in initiatives for the allLogs or audit category group to Log Analytics (and Event Hubs or Storage where needed) at management group scope. The categoryGroup parameter defaults to audit; choose deliberately.
  3. 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.
  4. 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.
  5. Prioritise data plane logs for Key Vault, storage accounts holding sensitive data, SQL, Azure Firewall, NSG and virtual network flow logs, and Entra ID.
  6. Protect destinations: delete locks on workspaces, immutability on archive storage, Entra ID authorisation instead of keys, private endpoints where supported.
  7. Set retention to cover your investigation window and regulatory obligations; 90 days of Activity Log is rarely enough for an incident discovered months later.
  8. 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.
  9. Roll back safely: switch a problematic assignment's effect to AuditIfNotExists rather than deleting it, so coverage gaps stay visible while you fix the issue.
MetricTarget
Subscriptions exporting Activity Log to the central workspace100%
Supported resources compliant with the diagnostic settings initiativeAbove 98%, gaps owned
Key Vaults and sensitive storage accounts sending audit logs100%
Unexplained diagnostic setting deletionsZero; every one investigated
Log retention meeting policy for security tables100%

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

FrameworkReferenceRelevance
NIST SP 800-53 Rev. 5AU-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 GenerationCoverage, storage, protection, retention and correlation
NIST CSF 2.0PR.PS-04; DE.CM-09; DE.AE-03Logs generated and available; monitoring; correlation
CIS Controls v8.1Control 8 Audit Log ManagementCollection, storage, retention and review
ISO/IEC 27001:2022 Annex A8.15 Logging; 8.16 Monitoring activitiesProducing, protecting and analysing logs
Microsoft cloud security benchmarkLogging and threat detection (LT) domainAzure baseline for audit log collection and retention
MITRE ATT&CK v20T1685.002 Disable or Modify Cloud Log; T1098.003 Additional Cloud Roles; T1078.004 Cloud AccountsDefence 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

Related NHI Mgmt Group resources: Cloud Logging and Audit Trail Guide · Microsoft Sentinel Guide · Cloud Detection Engineering Guide · Microsoft Azure Security Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Researched and written by the NHI Mgmt Group editorial team using AI tools, under the editorial direction of Lalit Choda. Facts are drawn from the sources listed on this page and checked by our automated quality process. Last updated 8 November 2026. Spotted an error? Use our contact page.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM and Agentic AI security. nhimg.org

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick the PDF box to continue.