DR as a Service using Azure

Before getting into DR as a service(DRAAS), let me give you my personal opinion about the cloud and why we should create or move workloads to the cloud.

The cloud has brought a lot of benefits to businesses  and it has help how humans consume services and businesses has been disrupt  in no time. There are a lot of businesses still skeptical of the cloud and with reason but if those business want to be around the next couple of years, they need to figure out how to ship their ideas to the customers faster.

Most businesses have to remember spending resources on a datacenter, servers, network equipment, storage does not make them more money. The application is what is important and that is what stakeholders or business owners care about it “Revenue”. This is an exciting technology revolution lead by Amazon, Microsoft and Google that has bring the benefits of economics of scale to us.

I personally think the way this revolution is going to play out  is with Hybrid-Cloud scenarios. There are lot of regulations in different industries, concerns with data sovereignty, governance,  some business may need to be self sustained like hospitals, electrical plants, nuclear plants that may never be able to move critical workloads to the cloud. My point is take advantage of the cloud where it makes sense and help your business delivery ideas faster.

Please do not drink Kool Aid that the cloud will help you save money that should not be the main reason to move the cloud.


At this point of time there a lot of companies that do not have a solid disaster recovery and business continuity plan(BCP). This could be  for many reasons cost, resources, and we know many companies have never test their DR solution.

If you are looking to have solid BCP plan and save in datacenter cost at the same  time consider Azure Site Recovery to cover your DR needs. Also remember it does not mean that you need to move all the workloads to the cloud; part of your plan can be to have a smaller foot print at a physical location for critical workloads. Start moving non-critical workloads to the cloud and when you  feel comfortable move others. Remember small wins is the key.



The way I am going to approach this is from scratch starting on how to setup PowerShell to talk to Azure and test your DR plan. The following technologies will be used:


Azure /  Backup and Site Recovery(OMS)

ARM Templates


Visual Studio Code


  1. Make sure you have an Azure subscription setup and ready to go
  2. If you have WMF 5.0 installed or are running Windows10 run the following  cmdlet within PowerShell to find the moduleFind-Module *azureRM*

    Click Yes to to download and install the NuGet provides 1
  3. Now lets run install module
    Find-Module *azurerm* | Install-ModuleThis way we can make sure all ARM resources are installed even though we are not going to use all of them
  4. Now that you have installed all the modules lets connect to you azure subscription
    Login-AzureRMAccountType the username and password for the account subscription
  5. After you login successfully you should see you account information display on your PowerShell window
  6. Now that we are connected the first step is to create a resource group in Azure to contain all of our resources. When planning for you DR site make sure there are 30 miles of distance between your datacenter and the Azure Region. You can Azure locations here https://azure.microsoft.com/en-us/regions/
  7. The first step is to create resource group where all your objects will be groupedNew-AzureRmResourceGroup -Name ‘dr_site_rg’ -Location ‘East US 2’


  8. Now the fun begins we need to create a storage account to hold your VMs. For the demo we are going to use one storage account but Azure recommends to have one storage account per VM. We are going to use ARM template to create this. For more information about ARM you can go here
  9. To run the template from PowerShell type the followingNew-AzureRmResourceGroupDeployment -ResourceGroupName ‘dr_site_rg’ -TemplateFile C:\draas\stroage.json



  10. The next step is to create the network. Make sure that the network space does not overlap with your on-premises network address space, for this case we are going to use flat network just backendhttps://gist.github.com/gabrielrojasnyc/04473afb840d314ce7313237774cd89f

    This is the command to run the template

    New-AzureRmResourceGroupDeployment -ResourceGroupName ‘dr_site_rg’ -TemplateFile C:\draas\network.json


  11. Now lets create the backup and Site recovery resource. We are going to use the portal because I could not find a resource to use in ARM.In the portal click on the plus side and type backup and site recovery
  12. Select name and make sure to select the resource group created before
  13. Click on Settings and click on step 1 Prepare your infrastructure
  14. For protection goal I am going to use Azure because I am using Hyper-V replication with no VMM
  15. Type a name for the Hyper-V site and then you need to add Hyper-V server
  16. Now you need to download the provider and the keys on your hyper-v host
    Click next and the installation may take some minutes to complete
  17. Click on register and add the key
  18. The process will create a certificate and register the server on Azure. If you check in the portal after 20 minutes you should you see the hyper-v host1
  19. Now lets setup the target and the information is going to be pick up automatically
  20. Now lets choose a replication policy. The min replication is 30 seconds, keep in mind you know the requirement from the business for your RPO recovery point object and RTO recovery time objective1
  21. Now lets do step 2. Choose from the resources created before
  22. If everything is OK you should see your VMs
  23. After this has configure you have to wait until the initial seeding finish. This takes a long time but after they are small increments.1.png



After the replication has finished, it is time to test your DR strategy. Before anythin check the console to make sure the vm is protected


Now click on test failover and choose the Vnet network to start the test



Finally, you can follow the Failover test and automate this every month if needed to be.




This service is a great way to have an automated DR test every month without disrupting the business. If you have a requirement this can be done every weekend fully automated and with no human intervention.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s