Azure playbooks
This page covers Azure subscriptions and the Microsoft Entra ID tenant behind them: the logs to keep, what to search, and the playbooks for 22 incident types in seven categories. Each playbook lists where to look and the commands to contain it. Commands use the Azure CLI and Microsoft Graph PowerShell, and queries are Kusto Query Language (KQL) for a Log Analytics workspace or Microsoft Sentinel.
Playbooks
Identity and access
Stolen credentials, taken-over accounts and the access an attacker leaves behind.
Compute and containers
Workloads, servers and clusters used or abused by an attacker.
Data and storage
Exposed, copied, encrypted or deleted data, and stolen secrets.
Network and edge
Attacks on availability and on names and endpoints you own.
Pipelines and supply chain
Build systems and image registries that reach production.
Evasion and guardrails
Logging and controls turned off to hide an attack.
Provider and accidental
Incidents with no attacker: a vendor's bug, a provider's or operator's mistake, or a provider outage.
First 15 minutes, any incident
| # | Item |
|---|---|
| 1 | Save the Activity Log for each affected subscription. The Activity Log keeps 90 days: az monitor activity-log list --start-time <yyyy-mm-dd> --offset 30d --max-events 10000 -o json > activity-<sub>.json |
| 2 | Export Entra audit and sign-in logs for the window before the 7-day or 30-day limit removes them |
| 3 | Identify the caller from Caller and CallerIpAddress in AzureActivity and from InitiatedBy in AuditLogs |
| 4 | List the caller's Azure roles in each subscription: az role assignment list --assignee <object-id> --all --include-inherited |
| 5 | Snapshot the disks of affected virtual machines (VMs): az snapshot create -g <rg> -n <case-id>-<disk> --source <disk-id> --tags case=<case-id> |
| 6 | Lock the Log Analytics workspace against deletion: az lock create --name ir-nodelete --lock-type CanNotDelete -g <rg> --resource <workspace> --resource-type Microsoft.OperationalInsights/workspaces |
| 7 | Record every command, its time and its operator in T3 |
Native detections to playbooks
Each row names a built-in alert or risk detection, the service that raises it, and the playbook to open when it fires.
| Detection | Source | Open |
|---|---|---|
| Leaked Credentials | Entra ID Protection, workload identities | Service principal secret |
| Unfamiliar sign-in properties | Entra ID Protection | Entra ID user |
| Attacker in the Middle | Entra ID Protection | Entra ID user |
| Anomalous service principal activity | Entra ID Protection, workload identities | Apps, credentials, federation |
| Token issuer anomaly | Entra ID Protection | Apps, credentials, federation |
| Usage of NetSPI techniques to maintain persistence in your Azure environment | Defender for Resource Manager | Apps, credentials, federation |
| Suspicious elevate access operation | Defender for Resource Manager | Global Administrator |
| Anomalous user activity | Entra ID Protection | Global Administrator |
| Azure Resource Manager operation from suspicious IP address | Defender for Resource Manager | Managed identity |
| Run Command with a suspicious script was detected on your virtual machine (Preview) | Defender for Cloud, Azure VM extension alerts | Virtual machine |
| Kubernetes control plane and workload runtime alerts. The reference lists categories without alert names | Defender for Containers | Azure AKS |
| Suspicious creation of compute resources detected | Defender for Resource Manager | Virtual machines |
| Digital currency mining related behavior detected | Defender for Servers | Virtual machines |
| The access level of a potentially sensitive storage blob container was changed to allow unauthenticated public access | Defender for Storage | Storage accounts |
| Unusual amount of data extracted from a storage account | Defender for Storage | Storage accounts |
| Login from a suspicious IP | Defender for SQL | SQL and databases |
| Potential SQL injection | Defender for SQL | SQL and databases |
| Unusual deletion in a storage account | Defender for Storage | Deletion and ransomware |
| Suspicious invocation of a high-risk 'Impact' operation detected (Preview) | Defender for Resource Manager | Deletion and ransomware |
| Suspicious secret listing and query in a key vault | Defender for Key Vault | Key Vault |
| Suspicious key vault recovery detected | Defender for Resource Manager | Key Vault |
| DDoS Attack detected for Public IP | Azure DDoS Protection, in Defender for Cloud | DDoS Protection and WAF |
| Dangling DNS alert, raised when an App Service site is deleted and its custom domain remains. The reference publishes no alert name | Defender for App Service | Azure DNS records |
| Azure DevOps Service Connection Abuse | Microsoft Sentinel, Azure DevOps Auditing solution | DevOps and federated credentials |
| Suspicious invocation of a high-risk 'Defense Evasion' operation detected (Preview) | Defender for Resource Manager | Diagnostic settings, Defender, Policy |
AI.Azure_DOWVolumeAnomaly | Defender for Cloud, AI services plan | Azure OpenAI |
AI.Azure_AccessFromSuspiciousIP | Defender for Cloud, AI services plan | Azure OpenAI |
AI.Azure_CredentialTheftAttempt | Defender for Cloud, AI services plan | Azure OpenAI |
AI.Azure_Jailbreak.ContentFiltering.DetectedAttempt | Defender for Cloud, AI services plan | Azure OpenAI |
Microsoft Learn: Defender for Cloud alerts reference for Resource Manager, Storage, Key Vault, SQL Database and Azure Synapse Analytics, Windows and Linux machines, Azure VM extensions, containers, App Service, DDoS Protection and AI services; Defender for App Service introduction; Entra ID Protection risk detections; securing workload identities. Microsoft Sentinel repository: Azure DevOps Auditing solution analytic rules. Defender for Cloud alert references checked October 2026. Defender for App Service introduction, Entra ID Protection risk detections, workload identities and the Sentinel rules: checked September 2026.
Before an incident
| Log | Default retention | Turn on / keep |
|---|---|---|
| Azure Activity Log (control plane) | 90 days, collected automatically | Subscription diagnostic setting to the workspace, table AzureActivity. The first 90 days there carry no retention charge. Include the Administrative, Security and Policy categories |
| Entra audit logs | 7 days on Entra ID Free, 30 days with P1 or P2 | Entra diagnostic setting, category AuditLogs, table AuditLogs |
| Entra sign-in logs: interactive, non-interactive, service principal, managed identity | 7 days on Free, 30 days with P1 or P2 | Categories SignInLogs, NonInteractiveUserSignInLogs, ServicePrincipalSignInLogs, ManagedIdentitySignInLogs. Tables SigninLogs, AADNonInteractiveUserSignInLogs, AADServicePrincipalSignInLogs, AADManagedIdentitySignInLogs |
| Entra ID Protection risk data | Risky sign-ins 7 days on Free, 30 days on P1, 90 days on P2. Risky users stay until the risk is remediated | Categories RiskyUsers and UserRiskEvents, tables AADRiskyUsers and AADUserRiskEvents |
| Microsoft Graph activity logs | Off by default, and kept only where you send them | Category MicrosoftGraphActivityLogs, same table name. Needs Entra ID P1 or P2 |
| Blob storage resource logs | Not collected by default | Diagnostic setting on each account's blobServices/default with StorageRead, StorageWrite, StorageDelete. Table StorageBlobLogs |
| Virtual network flow logs | Off by default. Retention is set per flow log | Network security group (NSG) flow logs accept no new creation and retire on September 30, 2027. Create virtual network flow logs: az network watcher flow-log create --location <region> --name <name> --vnet <vnet> --storage-account <account> --retention <days> |
| Microsoft Defender for Cloud alerts | Shown in the portal for 90 days | Enable Defender plans. Turn on continuous export to the workspace, tables SecurityAlert and SecurityRecommendation |
| Log Analytics workspace | 30 days analytics retention per table, 90 days for AzureActivity | Raise retention on identity and storage tables (up to 730 days analytics, 12 years total). Add a CanNotDelete lock |
| Azure Policy | Policy events in the Activity Log, 90 days | Assign the built-in Allowed locations policy (e56962a6-4747-49cd-b67b-bf8b01975c4c) at the management group |
Microsoft Learn: Entra data retention, Entra diagnostic setting log options, ID Protection data export, Azure Monitor activity log, diagnostic settings, Log Analytics retention, Graph activity logs, secure Network Watcher (VNet and NSG flow logs), Azure Policy tutorial, Azure CLI reference for az monitor activity-log and az network watcher flow-log. Checked October 2026, including the 90-day Defender for Cloud alert display (alerts overview). Continuous export: checked September 2026.