Overview and What You Will Learn
In this lab, you will create a Recovery Services Vault, enable backup for a VM with a defined retention policy, trigger a backup manually, and then perform an actual test restore - the step most teams skip, and the one that actually proves the backup works.
Why This Matters in Production
A team configures nightly backups for their production database, sees the backup job report success every single night for a year, and only discovers during a real data-loss incident that the backup has actually been silently failing to capture a critical table for months. A completed backup job only proves data was written somewhere - it says nothing about whether that data can actually be restored into a working state.
Core Principles
Azure Backup centralizes backup policy and storage inside a Recovery Services Vault, which manages the schedule, retention, and the actual recovery points created over time.
+------------------------------------------+| Recovery Services Vault |+------------------------------------------+ | v+------------------------------------------+| Backup Policy: how often, how long kept || (e.g. daily backup, 30-day retention) |+------------------------------------------+ | v+------------------------------------------+| Recovery Points created over time || Each one: data as of that specific moment |+------------------------------------------+ | v+------------------------------------------+| Restore: pick a recovery point, recover it || (this is the step that must actually be || tested, not assumed to work) |+------------------------------------------+A recovery point is only as trustworthy as the last time someone actually restored from one and confirmed the result was usable.
Detailed Step-by-Step Practical Lab
- Create a Resource Group, a Recovery Services Vault, and a VM to back up:
az group create --name rg-backup-lab-mumbai --location centralindia az backup vault create \ --resource-group rg-backup-lab-mumbai \ --name rsv-backup-lab \ --location centralindia az vm create \ --resource-group rg-backup-lab-mumbai \ --name vm-backup-lab \ --image Ubuntu2204 \ --size Standard_B1s \ --admin-username azureadmin \ --generate-ssh-keys- Enable backup protection for the VM using the default daily backup policy:
az backup protection enable-for-vm \ --resource-group rg-backup-lab-mumbai \ --vault-name rsv-backup-lab \ --vm vm-backup-lab \ --policy-name DefaultPolicy- Trigger an on-demand backup rather than waiting for the next scheduled run:
az backup protection backup-now \ --resource-group rg-backup-lab-mumbai \ --vault-name rsv-backup-lab \ --container-name vm-backup-lab \ --item-name vm-backup-lab \ --retain-until $(date -u -d "+30 days" '+%d-%m-%Y')- Check the backup job's status until it completes:
az backup job list \ --resource-group rg-backup-lab-mumbai \ --vault-name rsv-backup-lab \ --output table- List the recovery points now available for this VM:
az backup recoverypoint list \ --resource-group rg-backup-lab-mumbai \ --vault-name rsv-backup-lab \ --container-name vm-backup-lab \ --item-name vm-backup-lab \ --output table- Perform an actual test restore - this is the step that genuinely proves the backup works, rather than just assuming it does:
az backup restore restore-disks \ --resource-group rg-backup-lab-mumbai \ --vault-name rsv-backup-lab \ --container-name vm-backup-lab \ --item-name vm-backup-lab \ --rp-name <recovery-point-name-from-step-5> \ --storage-account <a-storage-account-to-restore-into>NoteThis restore command creates the VM's disks in a specified storage account, from which you would then create a new VM to actually verify the restored data looks correct - this final verification step is what actually confirms the backup is trustworthy, not just that the restore command completed without an error.
- Clean up:
az group delete --name rg-backup-lab-mumbai --yes --no-waitProduction Best Practices & Common Pitfalls
Common MistakeConfiguring backups, seeing the job report success repeatedly, and never actually performing a test restore. A backup job completing successfully only proves data was written to the vault - it does not prove that data can actually be restored into a working state when it's genuinely needed.
TipSchedule a real restore test periodically - quarterly is a reasonable starting cadence for most production workloads - rather than treating backup configuration as a one-time setup task that never needs revisiting.
- Retention policy should match actual business and compliance requirements, not an arbitrary default. A workload with a 7-year regulatory retention requirement needs a policy configured for that, not the default short retention window.
- Recovery Services Vaults have their own independent access controls (RBAC). Consider carefully who has permission to delete backup data, since backup data itself becoming compromised or deleted defeats its entire purpose as a safety net.
Quick Reference & Troubleshooting Commands
| Command | Description |
|---|---|
az backup vault create |
Create a Recovery Services Vault |
az backup protection enable-for-vm |
Enable backup for a specific VM |
az backup protection backup-now |
Trigger an on-demand backup |
az backup restore restore-disks |
Restore from a specific recovery point |