Skip to main content
emnode
Site Reliability

Set up disaster recovery with Azure Site Recovery

One capability for business continuity: replicate your business-critical VMs to a second region, keep the copy continuously up to date, and rehearse the failover regularly so that an outage in one region does not become an outage for your customers.

14 min·10 sections·AZURE

Last reviewed

Disaster recovery with Site Recovery: the basics

What does it actually mean for a VM to survive a region outage?

A virtual machine lives in one Azure region. If that region has a problem, a power event, a networking fault, a rare but real regional outage, every VM that lives only there goes down with it, and stays down until the region recovers, which is not on your timetable. Azure Site Recovery is the managed service that removes that single point of failure. It continuously replicates a VM's disks to a second region you choose, keeps that copy current, and gives you a single orchestrated action to bring the workload up in the secondary region when you need it. The copy is not running and not billed as a second live VM; it is replication data plus a small cache, waiting.

Two numbers describe how good your recovery is. The recovery point objective, or RPO, is how much data you can lose, measured as how far behind the replica is. Site Recovery writes a crash-consistent recovery point roughly every five minutes and an application-consistent one on a schedule you set, so the replica is typically only minutes behind. The recovery time objective, or RTO, is how long it takes to be running again in the secondary region after you trigger a failover. Replication keeps the RPO low continuously; an orchestrated failover, and rehearsing it, keeps the RTO low and predictable.

The part teams skip is the rehearsal. Replication that has never been failed over is a hope, not a plan. Site Recovery has a test failover, a disaster recovery drill, that spins the workload up in an isolated network in the secondary region without touching production or interrupting replication. Running that drill on a schedule is what turns 'we have Site Recovery configured' into 'we know our failover works and roughly how long it takes', which is the only version of disaster recovery worth having.

In this lesson you will learn how Azure Site Recovery protects a virtual-machine workload against a region outage, how to read the recovery point and recovery time objectives it gives you, how to enable replication and rehearse failover with a non-disruptive test failover, and how to scale protection across an estate with Azure Policy. The focus throughout is business continuity: keeping workloads available, not securing them.

Fun fact

The drill nobody ran

The recurring lesson from real cloud outages is rarely that a region failed; it is that the recovery plan had never been exercised. Teams discover at the worst possible moment that a dependency was never replicated, that a recovery network was never wired up, or that nobody had permission to trigger the failover. This is exactly why Site Recovery ships a test failover, a disaster recovery drill, that brings the workload up in an isolated network in the secondary region without touching production and without pausing replication. A drill you run every quarter costs almost nothing in compute, because the test VMs only run for the length of the test, and it converts an untested assumption into a known recovery time.

Checking what is actually protected across a subscription

Priya is the platform reliability lead at a SaaS company that has grown faster than its disaster-recovery posture. Leadership has asked a direct question after a competitor's region outage: if our primary region went down, which of our workloads could we actually bring back, and how fast?

Rather than assume the Recovery Services vault tells the whole story, Priya starts by listing the items that are genuinely under replication and checking their health, so the gap between 'VMs we run' and 'VMs we could recover' is visible before anyone promises a recovery time.

List the replication-protected items in the vault and check each one's replication health. Anything critical that is missing from this list has no disaster-recovery plan at all.

$ az site-recovery vault list-protected-item --resource-group dr-rg --vault-name prod-asr-vault --query "[].{name:friendlyName, health:replicationHealth, state:protectionState}" -o table
Name Health State
--------------- --------- ----------
checkout-api-vm Normal Protected
billing-db-vm Warning Protected
# orders-api-vm is business critical and does NOT appear: it is not replicated at all.

The vault lists only what is protected. The dangerous gap is the critical VM that is absent from this list entirely, plus any protected item whose replication health is Warning rather than Normal.

How Site Recovery keeps a workload recoverabledeep dive

Replication is continuous, not scheduled. The Site Recovery mobility agent on each protected VM captures disk writes and ships them, via a cache storage account in the source region, to managed disks in the secondary region. From that stream Site Recovery builds recovery points: a crash-consistent point roughly every five minutes, which captures what was on disk, and an application-consistent point on a configurable schedule, which additionally flushes in-memory data and pending transactions so that applications like databases come back cleanly. The application-consistent frequency defaults to every four hours and can be set as low as one hour; more frequent application-consistent points cost some performance on a busy workload, which is the trade-off you tune per workload.

When you fail over, you choose which recovery point to use, and that choice is the RPO-versus-RTO trade made concrete. 'Latest processed' uses the most recent point Site Recovery has already prepared, so there is nothing to process and recovery is fastest, the lowest RTO. 'Latest' processes everything received up to the moment of failover before bringing the VM up, giving the least data loss, the lowest RPO, at the cost of a little more time. 'Latest app-consistent' uses the most recent application-consistent point, and 'Custom' lets you pick a specific point in time, which is useful if a bad change needs to be left behind.

The test failover is the mechanism that makes all of this trustworthy. It provisions the recovery VMs into a separate, isolated network you nominate, entirely parallel to production, so you can validate that the workload actually boots and serves traffic without any impact on the live system and without interrupting ongoing replication. After you have verified it, a cleanup action tears the test VMs and resources down. Because the test environment is isolated and short-lived, a drill is cheap to run, which removes the usual excuse for never running one.

What is the impact of leaving a critical workload unprotected?

The direct impact is unbounded downtime. A VM that exists only in one region is available only while that region is. Most of the time that is fine, because regions are reliable, but the whole point of disaster recovery is the rare day when it is not. Without replication, your recovery time is whatever the region's recovery time turns out to be, which you do not control and cannot predict, and your data loss is everything since your last backup, which for many VM workloads is measured in hours.

The second-order impact is the false sense of safety that comes from configuration without rehearsal. A vault with replication enabled but no tested failover is the worst of both worlds: it carries the cost of disaster recovery and the belief that you are covered, but the first real failover is also the first failover, run under pressure, often revealing a missing dependency, an unwired recovery network, or a permissions gap at exactly the wrong moment. Replication without a drill protects the data but not the recovery.

On the business-continuity side, customers, contracts and increasingly regulators expect evidence that critical systems can survive the loss of a region and that the plan has been exercised. A workload that is replicated to a second region with a recent, documented test failover is the cheapest and most defensible piece of continuity evidence you can produce, and the difference between an outage that is a survivable inconvenience and one that is an existential event.

How do you set up disaster recovery without surprises?

Work disaster recovery as a deliberate loop rather than a one-off switch. The order matters: decide what is worth protecting before you enable anything, and rehearse the failover before you ever need it.

1. Decide what is worth protecting

List the VM workloads and attach an hourly cost of downtime to each. Protect the ones where that cost clearly exceeds the recurring Site Recovery premium, and consciously leave out development, staging and other low-stakes machines. Disaster recovery is insurance: buy it for what you cannot afford to lose, not for everything.

2. Enable replication to a second region

For each protected workload, enable replication into a Recovery Services vault, choosing a target region, a recovery resource group and a recovery network. Set the application-consistent recovery-point frequency to match how cleanly the workload needs to come back, more frequent for databases, less for stateless services. Replication runs continuously from then on, keeping the RPO to minutes.

3. Rehearse with a test failover

Run a test failover into an isolated network so the recovery VMs boot in parallel with production and you can confirm the workload actually serves traffic, without touching the live system and without pausing replication. Verify it, record the recovery time, then run the cleanup to tear the test resources down. Schedule this drill to repeat, quarterly is a common cadence, so your recovery time stays a known number.

4. Scale it with Azure Policy

Once the pattern is proven, assign the built-in policy 'Configure disaster recovery on virtual machines by enabling replication via Azure Site Recovery' to the subscriptions or resource groups that hold critical workloads. New VMs in scope then get replication enabled automatically, and a remediation task brings existing VMs into protection, so disaster recovery becomes the default for the workloads that need it rather than something each team has to remember.

# 1. See exactly what is protected and how healthy replication is.
az site-recovery vault list-protected-item \
  --resource-group dr-rg \
  --vault-name prod-asr-vault \
  --query "[].{name:friendlyName, health:replicationHealth, state:protectionState}" \
  -o table

# 2. Scale protection: assign the built-in DR policy by its EXACT display name,
#    so new business-critical VMs get Site Recovery enabled automatically.
pid=$(az policy definition list \
  --query "[?displayName=='Configure disaster recovery on virtual machines by enabling replication via Azure Site Recovery'].name" \
  -o tsv)

az policy assignment create \
  --name enable-vm-dr \
  --display-name "Enable VM disaster recovery via Site Recovery" \
  --policy "$pid" \
  --scope "/subscriptions/<subscription-id>/resourceGroups/critical-workloads-rg" \
  --location <secondary-region> \
  --mi-system-assigned \
  --params '{"effect":{"value":"DeployIfNotExists"}}'

Quick quiz

Question 1 of 5

What does Azure Site Recovery actually provide for a virtual-machine workload?

You can now treat disaster recovery as one deliberate capability rather than a switch on a vault: decide which workloads' downtime is genuinely expensive, replicate those to a second region, rehearse the failover with a non-disruptive test failover so your recovery time is a known number, and scale the pattern with Azure Policy. The difference between configured and proven disaster recovery is the drill, and running it regularly is what makes the recovery real.

Back to the library