Enable vm replication using azure bicep

Satish B 70 Reputation points
2023-09-23T10:34:24.1233333+00:00

Hi All,

I have deployed vms in norway east using azure bicep & also I have created recovery service vault in norway west using azure bicep. I need to enable vm replication from norway east to norway west using azure bicep. What is process to execute vm replication though azure bicep

Azure Site Recovery
Azure Site Recovery
An Azure native disaster recovery service. Previously known as Microsoft Azure Hyper-V Recovery Manager.
731 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. JimmySalian-2011 42,176 Reputation points
    2023-09-23T11:12:21.3+00:00

    Hi Sathish,

    For this requirement you will have to enable the Azure Replication services and using the modules listed in this document please review the script and this should help you - https://learn.microsoft.com/en-us/azure/site-recovery/quickstart-create-vault-bicep?tabs=CLI

    Hope this helps.

    JS

    ==

    Please Accept the answer if the information helped you. This will help us and others in the community as well.


  2. Ryan Hill 29,131 Reputation points Microsoft Employee
    2023-09-29T18:51:47.6866667+00:00

    Hey @Satish B

    Have a look at Backup Resource Manager VMs using Recovery Services vault. The bicep uses a flag to determine if to create a new resource or not, but since you already have the resources created, you can leverage the existing keyword instead.

    resource existingSiteRecovery 'Microsoft.SiteRecovery/vaults@2021-03-01' existing = {
      name: 'myExistingSiteRecoveryVault'
      scope: resourceGroup('myResourceGroup')
    }
    
    resource existingVM 'Microsoft.Compute/virtualMachines@2021-03-01' existing = {
      name: 'myExistingVM'
      scope: resourceGroup('myResourceGroup')
    }
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.