Skip to main content

Configuring Azure Backup and Recovery Vaults

Learn to configure Azure Backup with a Recovery Services Vault, and why testing an actual restore matters more than a completed backup job.

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.

◈ DIAGRAM
+------------------------------------------+
| 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

  1. Create a Resource Group, a Recovery Services Vault, and a VM to back up:
Bash
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
  1. Enable backup protection for the VM using the default daily backup policy:
Bash
az backup protection enable-for-vm \
--resource-group rg-backup-lab-mumbai \
--vault-name rsv-backup-lab \
--vm vm-backup-lab \
--policy-name DefaultPolicy
  1. Trigger an on-demand backup rather than waiting for the next scheduled run:
Bash
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')
  1. Check the backup job's status until it completes:
Bash
az backup job list \
--resource-group rg-backup-lab-mumbai \
--vault-name rsv-backup-lab \
--output table
  1. List the recovery points now available for this VM:
Bash
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
  1. Perform an actual test restore - this is the step that genuinely proves the backup works, rather than just assuming it does:
Bash
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>
Note

This 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.

  1. Clean up:
Bash
az group delete --name rg-backup-lab-mumbai --yes --no-wait

Production Best Practices & Common Pitfalls

Common Mistake

Configuring 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.

Tip

Schedule 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

Explore More in Azure Monitoring, Identity, and Production Readiness

All 6 Topics

Frequently Asked Questions

Is Configuring Azure Backup and Recovery Vaults free to learn on DevOps Network?

Yes - this topic, like everything on DevOps Network, is 100% free with no paywall or sign-up gate.

What does the Configuring Azure Backup and Recovery Vaults topic cover?

Learn to configure Azure Backup with a Recovery Services Vault, and why testing an actual restore matters more than a completed backup job.