Home Microsoft AzureBack Up Azure VMs with Azure Backup and Managed Snapshots

Back Up Azure VMs with Azure Backup and Managed Snapshots

by Knowledge Base Linux
Back Up Azure VMs with Azure — Back Up Azure VMs with Azure Backup and Managed Snapshots

A virtual machine without backups is just a disaster waiting for a date. Whether the threat is ransomware, a bad update or an accidental deletion, a tested Azure VM backup strategy is what turns a catastrophe into an inconvenience. This guide sets up Azure Backup for a Linux VM, explains managed disk snapshots, and shows how each fits into a sysadmin’s toolbox. This article covers Back Up Azure VMs with Azure in detail.

Azure VM Backup vs Snapshots: What Is the Difference? – Back Up Azure VMs with Azure

  • Azure Backup is a managed service that copies your VM into a Recovery Services vault on a schedule, with retention from days to years, application-consistent restore points and file-level recovery. It is designed for disaster recovery.
  • Managed snapshots are manual, point-in-time copies of a single disk. They are perfect before a risky change — a major upgrade, a migration — but they live in your resource group and are not a retention strategy.

Serious environments use both: Azure Backup for the daily safety net, snapshots as pre-change insurance.

Prerequisites – Back Up Azure VMs with Azure

  • An existing Azure VM, for example the one from our Azure Linux VM guide
  • Azure CLI signed in with Contributor rights on the VM’s resource group

Step 1: Create a Recovery Services Vault

az backup vault create \
  --resource-group rg-linux-prod \
  --name vault-prod-01 \
  --location eastus

Step 2: Enable Azure VM Backup and Run the First Job

az backup protection enable-for-vm \
  --resource-group rg-linux-prod \
  --vault-name vault-prod-01 \
  --vm vm-web-01 \
  --policy-name DefaultPolicy

az backup protection backup-now \
  --resource-group rg-linux-prod \
  --vault-name vault-prod-01 \
  --container-name vm-web-01 \
  --item-name vm-web-01 \
  --retain-until 31-12-2026

The DefaultPolicy backs up daily and keeps restore points for 30 days. For production databases you may prefer an enhanced policy with multiple daily backups — create it in the portal or with az backup policy create, then assign it the same way. Watch job progress with az backup job list --vault-name vault-prod-01 --resource-group rg-linux-prod --output table.

Azure VM backup snapshots arranged on a restore timeline

Step 3: Create a Managed Snapshot Before a Risky Change

First find the OS disk ID, then snapshot it:

az vm show \
  --resource-group rg-linux-prod \
  --name vm-web-01 \
  --query "storageProfile.osDisk.managedDisk.id" \
  --output tsv

az snapshot create \
  --resource-group rg-linux-prod \
  --name snap-web01-before-upgrade \
  --source /subscriptions/.../disks/vm-web-01_OsDisk_1_xxxx

Restoring means creating a new managed disk from the snapshot (az disk create --source snap-web01-before-upgrade) and attaching it to a VM — a few minutes of work instead of a full rebuild.

Step 4: Test a Restore

An untested backup is a hope, not a backup. Periodically restore the VM’s disks to an isolated resource group with az backup restore restore-disks, build a temporary VM from them, and verify the application boots. This mirrors the discipline of our local approach in automating Linux backups with rsync and cron, moved into the cloud. For service limits and retention details, consult the Azure Backup overview on Microsoft Learn.

Retention, Immutability and Cross-Region Protection

The DefaultPolicy is a starting point, not a strategy. Decide retention deliberately: daily points for 30 days covers operational mistakes, while monthly points kept for 12 months cover the auditor who arrives in October asking about January. Vaults support soft delete, which keeps recovery points for at least 14 extra days even after someone deletes them — a critical defense if an attacker or a disgruntled admin gains Contributor access. For the highest assurance, immutable vaults lock backups so they cannot be deleted before their retention expires at all. Geography matters too: vault storage defaults to geo-redundant in most regions, and cross-region restore lets you rebuild a VM in the paired region if the primary region is down. Note the trade-off — cross-region restore points carry extra cost and a recovery point objective measured in hours, not minutes, so reserve it for genuinely critical servers.

A Sensible Default Policy for Most Servers

If you are unsure where to start, this baseline serves most small and mid-sized environments well: one backup per day at a fixed off-peak hour, daily restore points retained for 30 days, one weekly point kept for 12 weeks, and one monthly point kept for 12 months. That schedule bounds storage growth — older points cost the most vault capacity — while still reaching back a full year for the slow-burn discovery that a file was corrupted months ago. Tag production VMs with their backup tier (backup=gold, backup=standard) and run a monthly report of protected versus unprotected VMs; in growing subscriptions, the VM created “temporarily” for a test is statistically the one that ends up running payroll with no backup at all.

Troubleshooting

  • Backup job fails with “VM agent not present”: install or update the Azure Linux agent (waagent) inside the guest and ensure outbound HTTPS to Azure is allowed.
  • Snapshot creation is slow: the first (full) snapshot copies all used data. Incremental snapshots afterwards are much faster and cheaper.
  • Vault deletion is blocked: a vault cannot be deleted while it holds protected items. Stop protection and delete the recovery points first.
  • Restore point exists but files are missing: crash-consistent restore points capture the disk as-is; for database workloads, stop the service or use application-consistent settings.

Conclusion

Azure VM backup gives you scheduled, vault-isolated protection, while managed snapshots give you instant pre-change rollback points. Enable both, test restores on a calendar, and your VMs stop being single points of failure.

You may also like

KbLinux

Typically replies within a day

Hello, Welcome to the site. Please click below button for chatting me through Telegram.