Azure activity logs not exported or retained
The activity log records control-plane actions across a subscription — who created, changed or deleted resources. Azure retains it for only 90 days unless you export it to a Log Analytics workspace or storage account.
Why it matters
Investigations often start weeks after an incident; with only 90 days and no export, the evidence of how an attacker got in may already be gone.
Compliance frameworks expect audit logs to be retained for a year or more and protected from tampering.
How to check for it
- Portal → Monitor → Activity log → Export activity logs: there should be a diagnostic setting sending logs to a workspace or storage.
- az monitor diagnostic-settings subscription list — confirm a destination exists.
How to fix it
- Create a diagnostic setting that exports the activity log to a Log Analytics workspace (for querying) or immutable storage (for long-term retention).
- Set a retention policy that meets your compliance requirement, and restrict who can change the setting.
SkyShield checks this automatically
Connect your AWS, Cloudflare, GitHub, GitLab, Hetzner or DigitalOcean account read-only and SkyShield flags this across every account and region, with the fix in plain words — alongside the agent that watches your servers. Start free.
FAQ
- Log Analytics or storage account?
- Log Analytics for search and alerting; a storage account (with immutability) for cheap long-term retention. Many teams send to both.