Azure Backup checklist: find unprotected VMs
Backup center shows one vault at a time. To see every VM with no backup across all subscriptions, query Azure Resource Graph instead:
it is free, needs only the Reader role, and runs in the portal (Resource Graph Explorer) or with az graph query.
Based on the Microsoft Learn page Query your backups using Azure Resource Graph (ARG) and the protected items API reference, checked 2026-12-01.
Checklist
- VMs with no Azure Backup
- Protected items whose last backup failed or is older than 24 hours
- SQL Server VMs with no database backup
- Unattached managed disks with no backup
- Vaults with soft delete or immutability off
- Tag the resources you leave unprotected on purpose (for example
backup=skip) so the list shows only real gaps. - Run the list on a schedule and send it to the resource owners.
1. VMs with no Azure Backup
Query: Microsoft Learn sample, unchanged.
Resources
| where type in~ ('microsoft.compute/virtualmachines','microsoft.classiccompute/virtualmachines')
| extend resourceId=tolower(id)
| join kind = leftouter ( RecoveryServicesResources
| where type == "microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers/protecteditems"
| where properties.backupManagementType == "AzureIaasVM"
| project resourceId = tolower(tostring(properties.sourceResourceId)), backupItemid = id, isBackedUp = isnotempty(id) ) on resourceId
| extend isProtected = isnotempty(backupItemid)
| where (isProtected == (0))
| project id,name,resourceGroup,location,tags
Excludes nothing. Add `| where tags['backup'] != 'skip'` to skip VMs you tagged on purpose.
2. Protected items whose last backup failed or is older than 24 hours
Query: PuzariCloud.
RecoveryServicesResources
| where type =~ 'microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers/protecteditems'
| extend status = tostring(properties.lastBackupStatus), lastBackup = todatetime(properties.lastBackupTime),
state = tostring(properties.protectionState), item = tostring(properties.friendlyName),
workload = tostring(properties.workloadType), vault = split(id, '/')[8]
| where status =~ 'Unhealthy' or isnull(lastBackup) or lastBackup < ago(26h) or state in ('ProtectionError', 'ProtectionStopped')
| project item, workload, vault, status, state, lastBackup, resourceGroup, subscriptionId
| order by lastBackup asc
26 hours leaves room for a daily schedule that drifts. For weekly policies use ago(8d).
3. SQL Server VMs with no database backup
Query: PuzariCloud.
Resources
| where type =~ 'microsoft.sqlvirtualmachine/sqlvirtualmachines'
| extend vmId = tolower(tostring(properties.virtualMachineResourceId))
| join kind = leftouter (RecoveryServicesResources
| where type =~ 'microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers/protecteditems'
| where properties.workloadType in ('SQLDataBase', 'SQLInstance')
| summarize dbs = count() by vmId = tolower(tostring(properties.sourceResourceId))) on vmId
| where isnull(dbs)
| project name, resourceGroup, location, vmId
A VM-level backup alone does not give point-in-time restore of the databases.
4. Unattached managed disks with no backup
Query: PuzariCloud.
Resources
| where type =~ 'microsoft.compute/disks' and isempty(managedBy)
| extend diskId = tolower(id)
| join kind = leftouter (RecoveryServicesResources
| where type =~ 'microsoft.dataprotection/backupvaults/backupinstances'
| project diskId = tolower(tostring(properties.dataSourceInfo.resourceID)), instance = id) on diskId
| where isempty(instance)
| project name, resourceGroup, location, sku = tostring(sku.name), sizeGB = toint(properties.diskSizeGB)
Attached disks are covered by their VM's backup. Unattached disks are often left behind, so check whether you still need them.
5. Vaults with soft delete or immutability off
Query: PuzariCloud.
Resources
| where type in~ ('microsoft.recoveryservices/vaults', 'microsoft.dataprotection/backupvaults')
| extend softDelete = coalesce(tostring(properties.securitySettings.softDeleteSettings.softDeleteState),
tostring(properties.securitySettings.softDeleteSettings.state)),
immutability = tostring(properties.securitySettings.immutabilitySettings.state)
| where softDelete in ('Disabled', 'Off') or isempty(immutability) or immutability == 'Disabled'
| project name, type, resourceGroup, location, softDelete, immutability
Soft delete keeps deleted backups for 14+ days. Locked immutability stops anyone deleting recovery points early.
Run a query from the Azure CLI
Save the query to query.kql, then (needs az extension add --name resource-graph):
az graph query -q "$(cat query.kql)" --first 1000 -o table
Good to know
- Resource Graph shows backup and restore jobs up to 14 days old. Older job history needs Azure Monitor Logs.
- Resource Graph returns only what your account can read (RBAC). The Reader role on the subscriptions is enough.
- lastBackupStatus on a protected item is documented as Healthy or Unhealthy (also Invalid and IRPending); lastBackupTime is the time of the last backup.
Automate it
Azure Backup Coverage Gaps Report runs these checks every day across your subscriptions, adds file shares and storage accounts, applies your tag exclusions and emails a weekly report with a CSV. Disclosure: we wrote this page and sell the tool.
Corrections: support@puzaricloud.in. Azure is a trademark of Microsoft. This site is not run by Microsoft.