Your profile

One profile for every MSDEVBUILD site. Only you can see it, and the site owner if you write in.

Lesson 47 of 47

Azure Site Recovery: Replicate and Fail Over to Another Region

Module 5: Monitor & Backup ⏱ 12 min read Updated

Your note

My notes for this lesson

Select any text in the lesson to highlight it or add a note. Saved in this browser.

    No highlights yet. Select a sentence in the lesson, then pick a colour or add a note.

    All my bookmarks and notes

    Reading settings

    For every lesson, saved in this browser.

    Text size
    Line spacing
    Font

    With IaaS you rent the virtual machine. Microsoft looks after the building, power and hardware; you patch the operating system.

    30-second answer

    Azure Site Recovery (ASR) continuously replicates an Azure VM's disks to another region, so you can run the VM there within minutes if the primary region fails. You enable it from the VM's Disaster recovery blade, and the Recovery Services vault must be in the target region. A replication policy sets how long recovery points are kept (up to 15 days) and how often app-consistent snapshots are taken; crash-consistent points come every 5 minutes. You rehearse with a test failover into an isolated virtual network and then clean it up. In a real outage you fail over (choosing a recovery point such as Latest processed for the lowest RTO), commit, then re-protect to replicate back, and later fail back the same way.

    Simulate it » No Azure account needed

    Exam objective: 5.2.5 Configure Azure Site Recovery for Azure resources. 5.2.6 Perform a failover to a secondary region by using Site Recovery. (Skills measured as of April 17, 2026)

    Simulations

    Feel it before you read it. No account needed, nothing leaves this page.

    Azure portal: Replicate a VM with Site Recovery and fail over Enable replication, test failover, fail over and commit.
    </> Embed

    Embed this simulation

    Free for trainers, teachers and bloggers. Paste this into your page:

    Loading the portal…

    Open the VM and select <strong>Backup + disaster recovery → Disaster recovery</strong>.

    👆 Click the glowing item in the portal to continue

    Read the steps as text
    1. Open the VM and select Backup + disaster recovery → Disaster recovery.
    2. Pick the target region. Replication goes to another region in the same geography, often the paired one.
    3. The vault sits in the target region. The cache storage account sits in the source region and buffers changes before they’re sent.
    4. After initial replication the item is Protected. Crash-consistent points come every 5 minutes; the RPO is a few minutes.
    5. Run a Test failover into an isolated network. Production keeps running and replicating, so you can rehearse any time.
    6. When the app checks out, Cleanup test failover deletes the test VM. Add notes for your DR drill record.
    7. East US is down. Failover: pick a recovery point. Latest processed gives the lowest RTO; Latest gives the lowest RPO. Shut down the source first if it’s still reachable.
    8. Commit makes the recovery point final. Then Re-protect replicates West US 2 back to East US, so you can fail back later the same way.

    🧪 Simulation for learning. Screens are simplified versions of the Azure portal; names, prices and IDs are examples. Nothing here touches real Azure.

    😟 THE PROBLEM

    If East US goes down, the order system goes down with it.

    😊 THE SOLUTION

    Replicate the VMs to West US 2 and rehearse the failover.

    • Region-wide outage✓ Continuous replication to another region
    • DR plan never tested✓ Test failover into an isolated VNet
    • No way back✓ Commit, re-protect and fail back
    🛠️ Solved with: Azure Site Recovery

    Start with a question

    If your office building flooded tonight, where would everyone work tomorrow?

    A sensible company has a second office in another city with desks ready and copies of every file synced overnight, or better, every few minutes. Twice a year they send a small team there for a day to prove the laptops log in, without closing the main office.

    Azure Site Recovery is that second office for your VMs. It keeps copying every change to another region. A test failover is the practice day. A real failover is moving everyone when the main office floods, and re-protect is setting up the sync in the other direction so you can move back later.

    Explain it like I’m 10

    The technical explanation

    How Azure-to-Azure replication works

    1. 1 Enable

      From the VM, choose the target region. Site Recovery installs the Mobility service extension.

    2. 2 Cache

      Disk writes are captured and buffered in a cache storage account in East US.

    3. 3 Replicate

      Changes are sent to replica managed disks in West US 2. No VM runs there yet.

    4. 4 Recover

      Crash-consistent points every 5 minutes, app-consistent on the policy schedule, kept up to 15 days.

    vm-erp01 protected from East US to West US 2

    What lives where:

    ComponentRegionNotes
    Source VM, cache storage accountSource (East US)The cache buffers changes before they’re sent
    Recovery Services vaultTarget (West US 2)Must be in a different region from the VM
    Replica disks, target resource group, target VNetTargetCreated at enable time or chosen by you. The target VM itself is created only at failover

    You can replicate to any region in the same geographic cluster (often the paired region), and into an availability zone. You pay a Site Recovery fee per protected VM (about $25 a month, illustrative, first 31 days free) plus storage, and compute in the target region only while a failed-over or test VM runs.

    Enable replication

    Portal path: VM > Backup + disaster recovery > Disaster recovery. Tabs: Basics (target region, replicate to availability zones), Advanced settings (target subscription, VM resource group, virtual network, availability, capacity reservation, cache storage, replication policy, Recovery Services vault), Review + Start replication. You can also start from the vault: Site Recovery > Azure virtual machines > Enable replication.

    The default replication policy keeps recovery points for 24 hours and takes app-consistent snapshots every 4 hours; you can keep points up to 15 days. Multi-VM consistency groups VMs that must share consistent recovery points, such as an app tier and its database.

    Most admins enable replication in the portal. From the command line it’s PowerShell (New-AzRecoveryServicesAsrReplicationProtectedItem with fabrics, containers and mappings) or the az site-recovery extension, which needs fabric, protection container and provider JSON. The practice lab below uses a simplified version of those commands.

    Test failover: rehearse without risk

    Vault > Protected items > Replicated items > the VM > Test failover. Pick a recovery point and an Azure virtual network that’s isolated from production (a separate test VNet in the target region, so IP addresses don’t clash). Site Recovery creates a VM from the recovery point; production keeps running and replicating. Check the app, then run Cleanup test failover with notes, which deletes the test VM.

    $item = Get-AzRecoveryServicesAsrReplicationProtectedItem -ProtectionContainer $container -FriendlyName vm-erp01
    $job = Start-AzRecoveryServicesAsrTestFailoverJob -ReplicationProtectedItem $item -Direction PrimaryToRecovery -AzureVMNetworkId $testVnetId
    Start-AzRecoveryServicesAsrTestFailoverCleanupJob -ReplicationProtectedItem $item -Comment "Drill passed"

    Real failover, commit, re-protect, fail back

    StepWhat it does
    FailoverChoose a recovery point and create the VM in the target region. Tick Shut down machine before beginning failover if the source is still reachable, to avoid data loss
    CommitMakes the chosen recovery point final and removes the others. Until you commit, you can change recovery point
    Re-protectStarts replication from the target region back to the original region (uses the original disks where possible)
    Fail backA planned failover back to the original region when it’s healthy, then commit and re-protect again

    Recovery point choices: Latest (lowest RPO, processes all pending data first, slower), Latest processed (lowest RTO, default), Latest app-consistent, Latest multi-VM processed or app-consistent for multi-VM groups, and Custom.

    Start-AzRecoveryServicesAsrUnplannedFailoverJob -ReplicationProtectedItem $item -Direction PrimaryToRecovery
    Start-AzRecoveryServicesAsrCommitFailoverJob -ReplicationProtectedItem $item
    Update-AzRecoveryServicesAsrProtectionDirection -ReplicationProtectedItem $item -AzureToAzure `
      -ProtectionContainerMapping $reverseMapping -LogStorageAccountId $cacheId -RecoveryResourceGroupId $rgId

    Recovery plans

    A recovery plan groups replicated VMs into ordered groups (database first, then app, then web), with pre and post actions: Azure Automation runbooks (for example to update DNS or a load balancer) and manual steps. You run test failover, failover and failback on the plan as a whole, which turns a 40-step runbook into one button.

    Architect level Things that break a real failover

    Capacity: in a big regional outage, many customers fail over to the same region. Capacity reservation in the target region guarantees the VM sizes you need. Networking: map the target VNet, subnets, NSGs and public IPs in advance, and plan DNS changes (Traffic Manager or a runbook in the recovery plan). Identity: make sure domain controllers or Microsoft Entra Domain Services are reachable from the target region. And remember that replication copies everything, including ransomware encryption, within minutes. That’s why Site Recovery sits next to Azure Backup, not instead of it.

    Real-world business scenario

    Wholesale

    Woodgrove Distribution (fictional)

    The problem
    The order management system ran on four VMs in East US. A regional outage would stop order intake for the hours it took to restore from backup, which the contract with their largest customer didn't allow.
    What they used
    Site Recovery replicated the four VMs to West US 2 into a vault there, with multi-VM consistency for the app and database tiers and capacity reservation for their sizes. A recovery plan failed over the database group first, then the app group, with a runbook updating the Traffic Manager endpoint. Every quarter they ran a test failover of the plan into an isolated VNet and cleaned it up.
    Why that choice
    Replication kept data loss to minutes, the recovery plan made failover one action, and quarterly drills proved it worked without touching production.
    The result
    During a later East US networking incident they failed over in 22 minutes, committed, re-protected, and failed back the next weekend.

    When to use it and when not to

    ✓ Use it when…

    • A VM must run again within minutes if its region fails.
    • Several VMs must come back together in a set order: use a recovery plan.
    • You need to prove DR regularly without downtime: test failover.

    ✕ Think twice when…

    • Recovering from deletion, corruption or ransomware. Replication copies the damage; use Azure Backup.
    • PaaS services with their own geo-replication (Azure SQL Database, Cosmos DB, storage GRS). Use their native options.
    • Workloads that can wait hours for a restore. Backup with Cross Region Restore costs less.

    ↔ Alternatives to consider

    • Azure Backup with Cross Region Restore when hours of RTO are acceptable.
    • Availability zones for datacenter-level failures within one region.
    • Active-active deployments across regions behind Front Door or Traffic Manager for near-zero downtime.
    Ready for more?The full lesson adds the technical explanation, when to use it, interview questions and revision notes.

    Test yourself with exercises

    5 original practice questions in the AZ-104 style. Pick your answers, then check them. You will see why each option is right or wrong. Score 75% or more and this topic is marked complete.

    Question 1

    Question 1 of 5

    You plan to replicate an Azure virtual machine in East US to West US 2 by using Azure Site Recovery. Where should you create the Recovery Services vault?

    Question 2

    Question 2 of 5

    You must validate the disaster recovery plan for a replicated virtual machine every quarter. The validation must not affect production workloads or ongoing replication. What should you do?

    Question 3

    Question 3 of 5

    A replicated virtual machine must be failed over to the secondary region during a regional outage. You must minimize the recovery time objective (RTO). Which recovery point should you select?

    Question 4

    Question 4 of 5

    You failed over a virtual machine from East US to West US 2 by using Azure Site Recovery. You must protect the virtual machine so that it can later be failed back to East US. Which three actions should you perform in sequence?

    Question 5

    Question 5 of 5

    A three-tier application runs on six virtual machines that replicate with Azure Site Recovery. During failover, the database virtual machines must start before the application servers, and a script must update a DNS record. What should you create?

    Interview preparation

    Say your answer out loud first, then open the model answer. Interviewers care more about your reasoning than the exact words.

    Beginner What's the difference between Azure Backup and Site Recovery?

    Model answer

    Backup keeps copies from points in time so you can go back after a deletion or ransomware, but restoring takes hours. Site Recovery keeps a constantly updated replica in another region so a VM can be running there in minutes if the region fails. Most production VMs have both.

    Intermediate Where does the Recovery Services vault go for Azure-to-Azure disaster recovery, and why?

    Model answer

    In the target region. If the source region goes down, the vault and its replication metadata have to survive and be usable to run the failover, so they live where you're failing over to. A cache storage account sits in the source region to buffer changes before they're sent.

    Experienced developer Which recovery point would you pick in a real failover?

    Model answer

    Latest processed if I want the VM up fastest, because the data is already processed. Latest gives the lowest data loss but processes pending data first, which takes longer. Latest app-consistent if the app needs a clean, application-consistent state, like a database server, at the cost of losing up to the snapshot interval.

    Scenario The board wants proof every quarter that the ERP system can run in West US 2, without downtime. How?

    Model answer

    A recovery plan for the ERP VMs with the database group first and the app group second, and a test failover of the plan into an isolated VNet in West US 2 each quarter. We check the app, record the results, then run cleanup test failover. Production keeps running and replicating the whole time.

    Quick revision

    Key points

    • ASR replicates Azure VMs to another region continuously. Enable it on the VM's Disaster recovery blade or from the vault.
    • The Recovery Services vault is in the target region. A cache storage account is in the source region. The Mobility service extension is installed for you.
    • Replication policy - recovery point retention up to 15 days, app-consistent snapshot frequency. Crash-consistent points every 5 minutes.
    • Test failover goes to an isolated VNet and doesn't affect replication; always clean it up.
    • Real failover - choose a recovery point, fail over, commit, re-protect, then fail back and re-protect again. Recovery plans fail over groups of VMs in order.

    Important terminology

    Azure Site Recovery
    The Azure service that replicates VMs to a secondary location and orchestrates failover and failback.
    Azure-to-Azure replication
    Site Recovery replicating Azure VMs from one Azure region to another.
    Replication policy
    Recovery point retention (up to 15 days) and app-consistent snapshot frequency for replicated VMs.
    Recovery point
    A point the VM can be failed over to. Crash-consistent every 5 minutes; app-consistent on the policy's schedule.
    Test failover
    Creates a copy of the replicated VM in an isolated network without affecting production or replication.
    Commit
    Confirms a failover, after which you can no longer switch to a different recovery point.
    Re-protect
    Starts replicating the failed-over VM back to the original region so you can fail back.
    Recovery plan
    A group of replicated VMs that fail over together in a defined order, with optional scripts, runbooks and manual steps.

    Common mistakes

    • Putting the vault in the same region as the source VM.
    • Running a test failover into the production VNet in the target region, causing IP conflicts.
    • Forgetting to re-protect after failover, leaving the VM with no disaster recovery.

    Exam tips

    • "Validate the DR plan without affecting production" = test failover to an isolated VNet, then cleanup.
    • "Lowest RTO" recovery point = Latest processed. "Lowest RPO" = Latest.
    • Order after an outage - failover → commit → re-protect → (fail back → re-protect).

    Five quick revision questions

    1. 1.Which region must the Recovery Services vault be in for Azure-to-Azure replication?Show

      The target (secondary) region.

    2. 2.How often are crash-consistent recovery points created?Show

      About every 5 minutes.

    3. 3.What's the maximum recovery point retention in a replication policy?Show

      15 days.

    4. 4.What do you run after a test failover?Show

      Cleanup test failover.

    5. 5.What makes the failed-over VM replicate back to the original region?Show

      Re-protect.

    Official references

    Finished this lesson? Tick it off. Your progress is saved in this browser.

    Studying with a friend? Send them this lesson

    It's free and needs no sign-up. Their progress saves in their own browser.

    Lesson done? Make it stick with a quick gameSort It, Match the Pairs, Lightning Round and Who Am I? Earn XP and badges. Play ❯

    Install MSDEVBUILD Azure

    Free · no account · works offline

    Save the whole course for offline ›

    Hi, I’m your Nimbus

    Your study buddy. Pick what we do next.

    MSDEVBUILD · Multi-Stack Dev Build

    Sign in to MSDEVBUILD

    One account for Azure certifications and the blog: sign in here and you are signed in on both. Your XP, streak, practice deck and certificate stay in sync on every device. Optional: everything works without an account.