az-303,

How to do a Failover of a Windows Server VM with Azure Site Recovery

Sven Malvik Sven Malvik Connect Jan 04, 2021 · 3 mins read
How to do a Failover of a Windows Server VM with Azure Site Recovery

In this post I will create a Windows Server 2016 Datacenter and then do an automatic failover to another region with Azure Site Recovery. Azure Site Recovery is part of the AZ-303 exam for becoming an Azure Solution Architect.

Watch Azure Site Recovery in preparation for the AZ-303 exam

I have already created a Windows Server 2016 Datacenter in Azure. Checkout a previous post about how to Create a Windows Server 2016 Datacenter VM. After that we need the IIS Server. Here is how you can do this: Installing Internet Information Service (IIS).

I will first make a minor change in the IIS Server so we are sure that we did a correct failover later.

Open iisstart.htmlOpen iisstart.html

I make a minor text change and add ` - DR` in the title.

Minor html change in IIS ServerMinor html change in IIS Server

I took the public IP address that we can see in the overview of the virtual machine. If you don’t have a public IP address, you can watch the Video about Azure Site Recovery where I will walk through this. Everything works fine.

Testing changed IIS serverTesting changed IIS server

Switch now over to the Azure portal and select your virtual machine. In the menu you’ll find Disaster Recovery where you can choose the target region. It’s the region that Azure will use to deploy a failover VM for you.

Target region for failover of Azure Site RecoveryTarget region for failover of Azure Site Recovery

Set your target settings. Target settingsTarget settings

The Cache storage account is where the source VM data will be stored.

Storage settings for Azure Site RecoveryStorage settings for Azure Site Recovery

Replication Settings is where you tell Azure what Recovery Vault Service you would like to use.

Replication Settings for Azure Site RecoveryReplication Settings for Azure Site Recovery

I also set Extension settings with an Azure Automation Account so the entire failover flow will be managed by Azure.

Extension settings for Azure Site RecoveryExtension settings for Azure Site Recovery

Now when we take a look in the Backup Service Vault that we use, we see that an initial job for replication is in progress.

Enable replication for Azure Site RecoveryEnable replication for Azure Site Recovery

Enable replication for Azure Site Recovery takes time, in my case 25 minutes. I will now go over to my VM and initiate a test failover.

Start test failoverStart test failover

You will get asked to set the virtual network. Remember that we do a test failover and it might be a good idea to choose a different virtual network the current region.

Test failoverTest failover

After some while, the test failover VM is ready to test. What’s still missing is a public IP address. Follow the Video about Azure Site Recovery where I will walk through this.

VM with private IP addressVM with private IP address

VM with public IP addressVM with public IP address

Finally I test the failover VM with the new IP address.

Test of failover VMTest of failover VM

Join Newsletter
Get the latest updates right in your inbox. I never spam!
Sven Malvik
Written by Sven Malvik