Skip to content
WETNav

Microsoft

Azure Activity Log

Every control-plane write in an Azure subscription: role assignments, VM run commands, key listing, disk exports and logging changes, with caller and IP.

Why it matters

Once an attacker has an identity with Azure RBAC rights, the Activity Log is the record of what they changed and which data they reached through the management plane. It is the place to find role grants, Run Command, storage key listing and disk exports.

How long it lasts

  • 90 days in the Azure portal and through the REST API or Azure CLI, per subscription.
  • Keep longer by sending it to Log Analytics (the AzureActivity table), a storage account or an event hub with a diagnostic setting on each subscription.
  • Reads are not recorded. Data-plane access (blob reads, Key Vault secret reads) is in each resource's own diagnostic logs, which are off unless configured.
Plan collection order across every source

Get the data

az monitor activity-log list --offset 30d --caller [email protected] \
  --query "[].{time:eventTimestamp, op:operationName.value, status:status.value, ip:httpRequest.clientIpAddress, resource:resourceId}" -o table

Fields that matter

operationName.valueSentinel: OperationNameValue

The action, as Provider/resourceType/action. This is what you hunt on.

callerSentinel: Caller

UPN for users; object or application ID for service principals and managed identities.

httpRequest.clientIpAddressSentinel: CallerIpAddress

Source IP of the management call.

status.valueSentinel: ActivityStatusValue

Started, Accepted, Succeeded or Failed. One operation writes several records with the same correlation ID.

resourceIdSentinel: _ResourceId

The full resource path: subscription, resource group, provider and name.

correlationIdSentinel: CorrelationId

Groups the records of one operation, and of one deployment.

authorization.scopeSentinel: Authorization_d

The scope the caller was authorized at.

propertiesSentinel: Properties_d

Operation detail, including the request body for many writes (role definition and principal for role assignments).

claimsSentinel: Claims_d

Token claims of the caller, including the app ID and authentication method.

Values to know

Traps

  • A diagnostic setting is per subscription. Subscriptions created after logging was set up are often missing from the SIEM.
  • Each operation writes Started and Succeeded (or Failed) records. Count operations by correlation ID, not rows.
  • The Activity Log shows that keys were listed or a disk export URL was created, not what was done with them. Pull the storage account and disk access logs separately, if they were enabled.
  • Tenant-level actions such as elevating a Global Administrator to User Access Administrator at root scope are recorded outside a normal subscription's log. Check the directory activity logs as well.

Playbooks that use it