Skip to content

LearnCloud

Azure Activity Log review

Brief

The Azure Activity Log records every write, delete and action on a subscription's control plane for 90 days, and nothing that only reads. The review matches each change the test made to its record, shows the review itself left none, and states where the log goes, how long it stays and which operations raise an alert.

Track
Cloud
Stage
Impact
Reviewed
On this page
  1. Check first
  2. Azure
  3. The defender sees
  4. Done when
  5. Not covered
  6. Tools
  7. Related research
  8. Where this page fits
  9. Reviewed

All commands

Situation
A finished test in the Azure subscriptions the scope letter names, our operator log with the UTC time and identity of each step, and a review identity with Reader on those subscriptions and Log Analytics Reader on the workspace the log is exported to, if there is one. Every command reads logs or settings; nothing changes a diagnostic setting, an alert rule or a record. Run it within 90 days of the test, or the copy Azure keeps is gone.
Goal
A defender's view for the Azure control plane: each change the test made matched to its Activity Log record and any alert, with the export, retention and the reads the log never holds stated plainly.
Outputs
Representative examples on placeholder hosts, trimmed to the lines that matter. Not captured from a public fixture yet.

Check first

  • Our operator log: UTC time, identity and the exact operation for every change the letter permitted, and the window's start and end.
  • The object ids or names of the test identities and of the review identity, so every filter matches ours only.
  • Every subscription in scope; the Activity Log is per subscription, so each command runs once for each.
  • Whether the client exports the log, and to which workspace, storage account or SIEM.
  • Who on the client side reads Azure alerts, so the defender's view can say whether anyone acted.

Steps

Azure

Where does the Activity Log go, and for how long?

az monitor diagnostic-settings subscription list \
  --query "value[].[name, workspaceId, join(',', logs[?enabled].category)]" -o tsv

Expected output

to-law-security	/subscriptions/55555555-6666-7777-8888-999999999999/resourceGroups/rg-sec/providers/Microsoft.OperationalInsights/workspaces/law-security	Administrative,Security,Policy,Alert   # <- exported to a workspace in another subscription

Azure keeps 90 days of Activity Log events for every subscription with no setting. Anything older exists only where a diagnostic setting sends it, and the workspace's own retention then decides. Administrative is the category that holds role assignments, deployments, key listings and deletions, so a setting that leaves it out exports the wrong half. A workspace in a subscription the workload owners also administer can be changed by the same people the log is meant to watch.

Negative result. One setting per subscription in scope, Administrative and Security enabled, sent to a workspace in a separate subscription with retention past the client's investigation window.

Fix. Export the Activity Log from every subscription, ideally through Azure Policy so new subscriptions inherit it, to a workspace in a security subscription that workload owners cannot change, and keep it for at least a year.

What did the test write, and did the review write anything?

az monitor activity-log list --start-time 2026-11-02T14:00:00Z --end-time 2026-11-06T22:00:00Z --max-events 1000 \
  --query "[?authorization.action != null].[eventTimestamp,operationName.value,caller,status.value]" -o tsv
az monitor activity-log list --start-time 2026-11-02T14:00:00Z --end-time 2026-11-06T22:00:00Z --max-events 1000 \
  --caller <review-sp-id> --query 'length(@)'

Expected output

$ az monitor activity-log list ... --query "[?authorization.action != null]..." -o tsv
2026-11-04T15:28:02.1174480Z	Microsoft.Resources/tags/delete	atarus-test1@corp.example.com	Succeeded
2026-11-04T15:21:44.5512340Z	Microsoft.Resources/tags/write	atarus-test1@corp.example.com	Succeeded
2026-11-04T15:21:43.9907711Z	Microsoft.Resources/tags/write	atarus-test1@corp.example.com	Started   # <- the one tag the letter named
2026-11-03T10:12:07.3340192Z	Microsoft.Storage/storageAccounts/listKeys/action	atarus-test1@corp.example.com	Succeeded   # <- an action, logged even though it only returned keys
$ az monitor activity-log list ... --caller <review-sp-id> --query 'length(@)'
0   # <- the review wrote nothing

The Activity Log holds control-plane writes, deletes and actions, and never a read: every list and show the review ran is absent by design, which is why the second command printing 0 is the evidence that the review changed nothing. A long-running write appears as several records under one correlation id, usually Started then Succeeded, so one change is one correlation id, not one line. caller is a user principal name for users and a GUID for service principals. The listKeys line matters: an az storage command run without --auth-mode login fetches the account key through that action on its own, so a test that only meant to list containers leaves a key retrieval in the log, and the report has to say so.

Negative result. Every write by the test identities matches a line in the operator log, and the review identity has none.

Fix. Give review identities Reader only, so a review leaves no Activity Log record, and use --auth-mode login in every az storage command the client's own scripts run.

Which sensitive operations are in the window, and from whom?

az monitor log-analytics query --workspace 0f1e2d3c-4b5a-4978-8a9b-0c1d2e3f4a5b --analytics-query "
  AzureActivity
  | where TimeGenerated between (datetime(2026-11-02T14:00Z) .. datetime(2026-11-06T22:00Z))
  | where OperationNameValue in~ (
      'Microsoft.Authorization/roleAssignments/write',
      'Microsoft.Storage/storageAccounts/listKeys/action',
      'Microsoft.Compute/virtualMachines/runCommand/action',
      'Microsoft.Web/sites/config/list/action',
      'Microsoft.Insights/diagnosticSettings/delete')
  | summarize Events = dcount(CorrelationId) by OperationNameValue, Caller, ActivityStatusValue" \
  --query '[].[OperationNameValue,Caller,ActivityStatusValue,Events]' -o tsv

Expected output

MICROSOFT.STORAGE/STORAGEACCOUNTS/LISTKEYS/ACTION	atarus-test1@corp.example.com	Success	1
MICROSOFT.STORAGE/STORAGEACCOUNTS/LISTKEYS/ACTION	<app-id>	Success	288   # <- a backup job's daily key fetch, the baseline our one call hides in
MICROSOFT.AUTHORIZATION/ROLEASSIGNMENTS/WRITE	<app-id>	Success	2

These five operations are the ones an intruder reaches for: granting a role, fetching storage keys, running a command on a VM, reading an app's settings and its connection strings, and deleting the log's own export. The workspace stores operation names in upper case, so the comparison uses in~, which ignores case. Counting correlation ids rather than rows counts operations, not their status records. The second line is not ours and is not a finding by itself; it is the baseline that shows whether one key fetch by a new caller would stand out. The role assignment writes by a deployment principal are reported to the client for their own review, without our judgement on them, since the letter scopes us to our activity.

Negative result. Our operations appear once each, and each sensitive operation in the window has a known caller the client can name.

Fix. Alert on any of the five by a caller outside an allow list of deployment principals, and on diagnosticSettings/delete by anyone.

Which alert rules watch the Activity Log?

az monitor activity-log alert list \
  --query "[].[name, to_string(enabled), join(',', condition.allOf[?field=='operationName'].equals)]" -o tsv

Expected output

alert-role-assignment	true	Microsoft.Authorization/roleAssignments/write
alert-diag-delete	false	Microsoft.Insights/diagnosticSettings/delete   # <- the rule exists and is switched off

Activity Log alert rules fire on one operation each, scoped to a subscription or resource group, and send to an action group. Listing them shows what the client meant to watch; whether one fired for our test is a question for whoever receives the action group's mail or webhook, so we ask and write down the answer. A sensitive operation from the previous step with no rule here is a gap even where a SIEM rule on the workspace might cover it, and the client confirms which.

Negative result. An enabled rule, or a confirmed SIEM rule, for each of the five operations, and the client can show the alert our tag or key fetch raised.

Fix. Create enabled Activity Log alerts or workspace rules for the five operations with an action group that reaches a person on call, and test each one at the next change window.

The defender sees

The review reads leave nothing in the Activity Log, because the log holds no reads; its traces are the review identity's sign-in in Entra ID and, where the workspace audits queries, the queries themselves. The test's own changes look like this:

Our stepWhat the Activity Log keptWhat alerted
Tag written on one resource and removedMicrosoft.Resources/tags/write and tags/delete, one correlation id eachNothing
Container listing without --auth-mode loginMicrosoft.Storage/storageAccounts/listKeys/action, one operationNothing; 288 daily fetches by a backup job hide it
Every list and showNo record, by designNot applicable

The paragraph in the report follows the same order as the Entra page: what was kept, what was never logged and why, what alerted and who acted, and retention as a date.

Defender's view, Azure. The Activity Log for subscription corp-prod kept both changes we
made on 3 and 4 Nov 2026: one storage key retrieval and one tag written and removed, each
by atarus-test1 from 203.0.113.24. Our reads, by design, left no Activity Log record. No
Activity Log alert fired; the rule for deleted diagnostic settings exists and is disabled.
The platform copy of the first change expires on 1 Feb 2027; the export to law-security keeps it for 365 days.

It covers our activity only and never claims the subscription is clean of anyone else's. Where nothing alerted, that is its own finding, written as on the cloud finding write-up.

Done when

Export and retention are stated per subscription, every write and action by the test identities in the window is listed and matched to the operator log, the review identity shows no writes, sensitive actions are checked in the workspace, and the alert rules that cover them are named.

Not covered

Entra sign-in, audit and Graph activity logs (see the Entra sign-in and audit log review), resource and data-plane logs such as Key Vault and storage, Defender for Cloud alerts, and AWS (see its own page); the outputs shown are representative examples on a placeholder tenant, not captured runs.