Azure Cloud Series: This lesson is part of our comprehensive Complete Microsoft Azure Tutorial: Learn Azure from Beginner to Advanced.
KODESTREE TECHNOLOGIES
AZURE SEO CONTENT HUB
Pillar cluster: Azure Monitoring, Architecture, Cost & Career
Primary search intent: Learn how Azure Activity Log, diagnostic settings and auditing work together to investigate changes and preserve useful records.
A reliable Azure auditing approach needs more than a single log view. Azure Activity Log records management-plane events about operations on Azure resources and subscriptions, while diagnostic settings route supported platform logs and metrics to selected destinations. Resource logs, identity audit events and application-level records can provide additional evidence that the Activity Log alone does not contain. Understanding these boundaries helps teams investigate changes without assuming one data source captures every action.
This tutorial explains how to inspect Activity Log events, configure diagnostic settings, route records to Log Analytics, Storage or Event Hubs where supported, build simple queries and alerts, and plan retention and access. A useful audit design maps each requirement to a source, destination, owner and retention period. Exact categories, supported destinations and cost behavior can vary by resource type, so check the current Microsoft documentation before treating a design as complete.
What You Will Learn
- Distinguish management-plane activity from resource logs and data-plane records.
- Understand the scope and default retention of Azure Activity Log and how to export it.
- Configure diagnostic settings and validate that events arrive at the intended destination.
- Query and alert on audit-relevant events while preserving least-privilege access.
- Design a practical evidence workflow for incident response, governance and compliance.
Quick Reference: Core Concepts
| Concept | Purpose |
|---|---|
| Azure Activity Log | Subscription-level record of management-plane events, including resource changes and initiated operations. |
| Resource log | Record emitted by an individual Azure service about its operations, requests or diagnostics. |
| Diagnostic setting | Rule that routes supported logs and metrics to configured destinations. |
| Log Analytics | Queryable storage and analysis experience for supported log data. |
| Storage account | Destination for supported long-term or lower-cost log archival. |
| Event Hubs | Streaming destination for supported events and integration with external analytics tools. |
| Retention | Period for which records remain available in a chosen destination. |
| Audit evidence | Records and change history used to investigate activity and demonstrate control operation. |
1. What Azure Activity Log Records
Azure Activity Log records subscription-level management events associated with Azure resources and the control plane. Examples include creating, updating or deleting a resource and initiating supported management operations. It is available in the Azure portal and through supported programmatic interfaces. The log helps answer who initiated a change, what operation was attempted, what scope was affected and whether the operation succeeded or failed.
Activity Log is not a complete record of every interaction with every service. It typically does not capture ordinary read operations, and it should not be confused with resource logs that describe service-specific activity or data-plane access. Treat it as one important source in an evidence model. When an investigation concerns a secret read, file download, database query or application action, confirm which additional service and identity logs are needed.
2. Management Plane and Data Plane
The management plane is the set of operations used to create, configure and manage Azure resources. The data plane is where the resource’s data or application-specific operations occur. For example, creating a storage account is a management operation, while reading a blob is a data operation. These activities may be recorded in different sources with different schemas and collection requirements.
An auditor should start from the action they need to prove and identify the source that records it. If the question is who changed a network rule, Activity Log may be relevant. If the question is which identity read a stored object, storage resource logs and identity evidence may be required. Do not claim that a resource is fully audited until you have tested the relevant management and data operations.
3. Event Fields, Status and Scope
Activity Log entries include properties such as event time, operation, status, caller, affected resource and other contextual information depending on the event. These fields allow an operator to filter to a time range, resource group, subscription, category, or operation. A failed management request can be as important as a successful one because repeated failures may indicate a misconfiguration, automation defect or suspicious attempt.
Use timestamps carefully when correlating Activity Log with application, identity or network evidence. Record the investigation time zone and retain enough context to distinguish an event time from the time a record became searchable. A single event may not explain the whole change; group related events by caller, operation, resource and time range, and examine surrounding deployment or automation activity.
4. Default Retention and Why Export Matters
Azure retains Activity Log events for 90 days by default, after which events are deleted from that default retention store. This can be sufficient for routine troubleshooting but may not satisfy an organization’s audit, investigation or long-term evidence needs. A diagnostic setting can route activity events to an external destination such as a Log Analytics workspace, Storage account or Event Hubs where supported.
Choose retention based on actual obligations and operational requirements rather than a vague preference to keep everything. Longer retention can increase storage or analytics cost, and some destinations have different query and retrieval characteristics. Test that export is active, determine when records become available, and document what happens when a destination is misconfigured or the receiving service is temporarily unavailable.
5. Understanding Diagnostic Settings
Diagnostic settings define which supported categories to export and where to send them. For Azure Activity Log, the configuration is made at the subscription scope, while individual Azure resources can have their own settings for service logs and metrics. This distinction is important: configuring diagnostics on a resource does not automatically export the subscription Activity Log, and enabling subscription-level Activity Log export does not capture every service-specific data event.
Choose categories based on required evidence and destination support. A setting may allow multiple destinations, but each destination should have an identified consumer and purpose. Avoid duplicating exports without a reason, because duplicates can complicate queries and costs. After changing a setting, generate a controlled action and verify the data arrives. A configuration blade showing a saved rule proves configuration was attempted, not that downstream evidence is usable.
6. Choosing a Destination
A Log Analytics workspace is appropriate when investigators need to search, filter, correlate and alert on records using queries. A Storage account can support archival and retrieval approaches aligned to the organization’s retention controls. Event Hubs can stream supported events to downstream processing or external security and analytics systems. The right choice depends on search frequency, query needs, retention, access boundaries, integrations and total cost.
Some systems use more than one destination for different purposes, such as queryable recent records in a workspace and longer-term export to storage. Design the flow explicitly: what is sent where, what process monitors it, and how the organization proves that data is retained. Apply access controls and lifecycle policies at each destination, and test retrieval before relying on a storage archive as a recovery or compliance control.
7. Querying Activity Log in Log Analytics
After Activity Log export is configured to a Log Analytics workspace, events can be analyzed in the `AzureActivity` table. Queries can filter by `TimeGenerated`, operation name, resource group, resource ID, status or other available columns. Start with a short query to verify recent events, then add summaries or joins only after checking the table schema. Queries should answer a concrete question such as which operations failed or which principal changed a sensitive resource.
An illustrative query is `AzureActivity | where TimeGenerated > ago(24h) | where ActivityStatusValue =~ "Failure" | project TimeGenerated, Caller, OperationNameValue, ResourceGroup, ResourceId`. The field names and data availability should be verified in the actual workspace. If no records appear, confirm that export is enabled, the correct workspace is selected, the time range is appropriate and the query uses the right schema.
8. Alerts for Important Changes
Activity Log alerts can notify operators about selected management events. Examples include a resource deletion, a change to a security boundary or a failed deployment operation. Log-based alerts can support more complex query conditions after data has been exported to a workspace. Choose alert rules around business impact: not every administrative event needs immediate paging, but sensitive changes may require prompt notification and review.
Keep notification rules understandable and owned. Include resource scope, event condition, severity and next steps. Test the alert by using a safe non-production change rather than assuming it will trigger. Consider false positives caused by normal deployments and approved automation. A rule that sends too many messages will be ignored; a rule that is too narrow may miss important changes. Review alert effectiveness as the environment and risk profile evolve.
9. Resource Logs and Diagnostic Coverage
Resource logs are generated by supported Azure services and can record service-specific operations or diagnostics. Their categories differ by resource type and they are not generally collected by default in the same manner as Activity Log entries. For auditing, examples may include storage access, Key Vault audit events, network diagnostics or database activity, subject to product capabilities and configuration.
Build a coverage matrix listing the resource or service, the event that must be captured, the source category, the destination, retention, access owner and validation test. This prevents a broad statement such as “diagnostics are enabled” from substituting for actual evidence. Review category changes when new services are added and verify that sensitive data is not exported to a destination with overly broad access.
10. Identity and Caller Attribution
Audit investigation often needs to connect a management event to a human identity, workload identity, service principal or automation process. Activity Log may include caller information, but a complete interpretation can require Microsoft Entra ID sign-in or audit logs, deployment history and pipeline records. Workload identities should be named and owned clearly so operators can distinguish expected automation from unexplained activity.
Avoid treating a username or principal ID as sufficient explanation. Determine whether the principal was authorized, what role assignment gave access, which deployment or ticket supported the action, and whether the event matches the expected workflow. Keep credentials out of audit notes and query output. If the initiating identity is unfamiliar, preserve the relevant records and follow the organization’s incident process before making assumptions about intent.
11. Audit Integrity and Access Boundaries
Audit records are valuable only if access, retention and modification risks are considered. Restrict who can create or change diagnostic settings, disable collection, change destinations or delete archived evidence. Use separate operational and audit roles where practical, and review permissions on workspaces, storage containers and downstream event consumers. Centralization can improve oversight, but it can also create a sensitive repository with a broad blast radius.
For critical evidence, consider controls supported by the selected destination such as restricted write access, retention or immutability features where appropriate, separate administrative ownership, and monitored changes to configuration. Document who is permitted to alter retention and how evidence is retrieved. Never assume that a log destination is immutable simply because it is separate from the source resource; verify the destination’s actual protection settings.
12. Retention, Archival and Retrieval
Different records may need different lifetimes. A team might query recent events interactively, retain selected records for an extended period and preserve a subset under a formal records policy. Retention decisions should identify the relevant data categories, scope, start date, retrieval method and deletion process. Where logs are archived, document the process for restoring or searching data so it remains useful during an investigation.
Test retrieval periodically with a realistic scenario. Confirm the organization can find events from the required period, map the records to the correct resource and understand the schema. Include storage lifecycle rules and access reviews in the retention plan, but make sure cost optimization does not delete records that must be preserved. If retention obligations vary by data type or geography, do not apply a single uniform policy without review.
13. Cost and Data Volume Management
Activity Log has default retention behavior, but additional collection, query, export and storage features can have different billing implications. Resource logs can be high-volume, so selecting every category for every resource may create substantial data growth. A cost-aware audit design begins with the evidence requirements, measures expected volume and validates the current billing model for each destination and category.
Reducing cost should mean removing unnecessary duplicates and keeping records in an appropriate tier, not eliminating controls without risk assessment. Establish ownership for new diagnostic settings and review unexpected volume changes. Check whether a resource type’s log category is billable to export before enabling it at scale. Make trade-offs explicit when choosing a long-term archive instead of a highly queryable analytics destination.
14. Change Management and Infrastructure as Code
Important diagnostic settings should be included in repeatable deployment standards where supported. Treat logging configuration, destination permissions and alert rules as part of the resource’s operational definition. Infrastructure as code can reduce the risk that a manually created resource is missing required diagnostics, and code review can make changes to collection or retention visible before deployment.
A repeatable template still needs validation because categories and features can vary by resource type. Test a deployed setting, inspect the destination and intentionally simulate a missing permission or misconfigured workspace in a safe environment. Document exceptions that cannot be managed through the standard template and assign an owner to close the gap. Configuration drift checks can reveal when a required audit rule has been removed or changed.
15. Investigation Workflow: From Alert to Evidence
An investigation should preserve a clear timeline. Start with the triggering alert, record its timestamp and scope, and capture the relevant Activity Log events. Expand into diagnostic logs, identity records and application evidence when the event requires more context. Distinguish facts from hypotheses and keep the original query, time range and filtering logic so another investigator can reproduce the analysis.
Collect only the evidence needed for the incident and store it in approved locations. Protect personal or security-sensitive fields and use established incident handling procedures. Identify the change owner, approval record and deployment pipeline where applicable. After resolution, write down which evidence confirmed the cause, which source was missing, and what collection or alert change would improve future investigation.
16. Practical Lab: Export and Verify an Activity Log
Use a non-production subscription and an authorized role to create a diagnostic setting for Activity Log. Select an available destination such as a test Log Analytics workspace, then generate a low-risk management event such as creating or updating a disposable resource. Wait for the supported ingestion window and query the expected table or destination. Record the setting name, destination and test event so the procedure can be repeated.
Next, create a focused alert rule for an agreed test condition if available in the selected workflow. Confirm that the notification reaches the intended test recipient and includes enough context to locate the event. Review access to the workspace or archive and check whether the data is retained for the expected period. Remove disposable resources and alert rules after the exercise, but do not delete evidence needed for a formal test record.
17. Auditing in Multi-Subscription Environments
Large environments need a consistent model for collecting events across subscriptions. Centralized workspaces or event pipelines can improve investigation and reporting, while scoped separation can help meet access or regulatory requirements. The design should specify how subscriptions are onboarded, how newly created subscriptions inherit the expected diagnostic configuration, and who responds when a destination or policy assignment stops working.
Use a standard template, policy or automation process to reduce manual omissions, but validate that every subscription is covered. A central query should show both event records and gaps in collection, rather than just returning data from the resources that were configured correctly. Maintain documented exceptions and review them periodically as ownership, subscription structure and data boundaries change.
18. Troubleshooting Missing Audit Events
When an expected event is absent, verify whether the action should appear in Activity Log at all or belongs to a data-plane or resource-log source. Confirm the scope, time window, diagnostic category, export setting, destination, permissions and ingestion delay. Check for changes to a setting or role assignment, and make a safe test event if required. A query that returns no result is a symptom to investigate, not proof of a security event or a successful control.
If data arrives in storage but not in a workspace, examine destination configuration and supported categories before rewriting the query. If only some subscriptions are missing, compare configuration across those scopes. For unexpectedly large volumes, group by source, category or operation and identify which change caused the increase. Record root causes and remediation steps in the runbook so future operators can distinguish a known limitation from a new gap.
19. Production Audit Readiness Checklist
Before relying on Azure auditing, list the required events, confirm source coverage, configure diagnostic settings, validate arrival and queryability, and decide retention by record type. Ensure that sensitive destinations have least-privilege access, changes to collection are monitored, and critical events have alert or review procedures. Document where archived records live and how they can be retrieved during an incident or audit.
Run periodic evidence tests rather than treating configuration as a one-time task. Verify that new subscriptions and resource types are included, destination access has not widened, and retention rules still match obligations. Confirm owners can explain what the Activity Log does not capture. A mature process records the limitations of each source and combines the sources necessary to answer the actual audit question.
Frequently Asked Questions
Does Azure Activity Log capture every Azure operation?
No. It records management-plane events and typically does not include ordinary read operations or every data-plane action. Use supported resource and identity logs when the audit question concerns access to data or service-specific activity.
How long are Activity Log events retained by default?
Azure’s default Activity Log retention is 90 days. Configure export through diagnostic settings when you need longer retention or additional analysis capabilities.
What does a diagnostic setting do?
It routes selected supported log categories and metrics to destinations such as Log Analytics, Storage or Event Hubs, subject to the source and destination capabilities.
Can Activity Log be queried with KQL?
Yes, when Activity Log data is exported to Log Analytics and available in the expected table, such as `AzureActivity`. Confirm the actual schema and ingestion before relying on a query.
Should I send all resource logs to one workspace?
Not automatically. Choose a workspace model based on access boundaries, retention, investigation needs, residency, ownership and cost. Validate that all required categories are included.
Does a saved diagnostic setting prove auditing is working?
No. Generate a known event, confirm it arrives at the intended destination, and test that authorized investigators can retrieve it for the required period.
Conclusion
Azure Activity Log is a useful foundation for tracking management-plane changes, but complete auditing requires a deliberate combination of sources. Diagnostic settings can route supported records to query, archive or streaming destinations; resource logs and identity evidence fill important gaps. Identify the actions you must prove, configure the corresponding collection paths, validate them with controlled tests and apply least privilege and retention controls. The result is an audit process that can answer real investigation questions rather than relying on a configuration checkbox alone.
20. Build an Audit Coverage Matrix
Create a matrix that lists each important action, its source, scope, destination, retention, owner and test. Include actions that should be detected, such as a sensitive configuration change, as well as actions that require service-specific data-plane records. The matrix makes unmonitored areas visible and provides a practical review artifact for engineering and security teams.
21. Alerts Versus Periodic Audits
Alerts are useful for changes that require prompt attention, while periodic reviews can detect patterns, access drift and lower-severity deviations. Use both deliberately. Do not create an alert for every benign operation, and do not assume an alert replaces an evidence retention requirement. Define which events page an operator, which go to a queue for review and which are retained for future investigation.
22. Common Audit Design Mistakes
Mistakes include confusing management and data plane, exporting only a subset of subscriptions, leaving default retention as the only evidence store, sending sensitive logs to broad audiences and never testing recovery. Another mistake is keeping too many logs without a clear question they are intended to answer. A clear audit matrix and repeated test events help prevent these failures.
23. Governance and Ownership
Each diagnostic pipeline should have a named owner for configuration, destination health, access control and retention. Use organizational policy or automation where practical to establish a baseline, then record any justified exceptions. Include diagnostics in resource onboarding and offboarding, because ownership changes can otherwise leave orphaned destinations or resources that no longer send records.
24. Evidence for Compliance Reviews
A useful evidence package includes a documented requirement, the source configuration, a sample record from a known test event, the retention policy and the access review process. Avoid storing secrets or unnecessary personal information in the evidence package. Explain any known gaps and compensating controls; a precise, bounded claim is more credible than asserting complete coverage without proof.
25. Retention and Cost Trade-Offs
Compare the cost and functionality of recent analytics data, longer-term searchable data and archival records. Define retrieval time expectations before moving evidence to a lower-cost destination. Cost optimization should remove duplication and unnecessary collection but preserve records needed by security response, operations or regulatory processes.
26. Hands-on Extension
Extend the lab by adding one relevant resource diagnostic setting and a safe alert on a selected management event. Query both the Activity Log and resource-specific table, then write a short incident narrative that distinguishes what each source proved and what it did not. This exercise makes the difference between configuration, evidence and interpretation concrete.
Example: Filter failed management operations
In a workspace that receives Activity Log records, start with a small time-bounded query:
`AzureActivity | where TimeGenerated > ago(24h) | where ActivityStatusValue =~ "Failure" | project TimeGenerated, Caller, OperationNameValue, ResourceGroup, ResourceId`
Confirm the column names in the current workspace schema. If records are missing, check that subscription-level Activity Log export is configured and that the time range is covered.
Related Azure Topics
Continue with these related tutorials to connect this topic to the wider Azure learning path:
- Azure Monitor, Metrics and Log Analytics
- Microsoft Entra ID and Azure Identity
- Azure RBAC: Roles, Assignments and Scopes
- Azure Policy, Management Groups and Governance
- Azure Security Best Practices
References and Further Reading
Use the following Microsoft documentation as the primary technical references. Check current command syntax, product capabilities, service limits and pricing before production use:
- Activity Log in Azure Monitor
- Diagnostic settings in Azure Monitor
- Diagnostic settings FAQ
- Log Analytics workspace overview
- Azure Monitor Logs query overview
- Azure role-based access control overview
- Azure Policy overview
- Azure Monitor alerts overview
SEO and Editorial Metadata
| Document ID | Azure-058 |
|---|---|
| Article Title | Azure Activity Log, Diagnostic Settings and Auditing |
| Primary Search Intent | Learn how Azure Activity Log, diagnostic settings and auditing work together to investigate changes and preserve useful records |
| Suggested URL | /azure-activity-log-diagnostic-settings-auditing/ |
| Canonical URL | https://kodestree.com/azure-activity-log-diagnostic-settings-auditing/ |
| Pillar Page | https://kodestree.com/azure-tutorial/ |
| Content Cluster | Azure Monitoring, Architecture, Cost & Career |
| Recommended Internal Links | Link contextually to the Azure pillar and adjacent Azure tutorials where the reader benefits. |