How to enable ASR for Azure VMs using scripts such as ARM or Bicep

Tony Acchar 5 Reputation points
2024-07-11T16:05:43.46+00:00

Hello,

I need to setup Azure Site Recovery for VMs using Bicep or ARM template. I setup the Recovery Service Vaults through the portal and I added a VM to the replicated items. The replication works fine on the portal and it is healthy. I exported the Resource Group which held all the resources needed for ASR to an ARM template and decompiled to bicep script. When running the script it stopped on a step:

resource vaults_Site_recovery_vault_canadaeast_name_default 'Microsoft.RecoveryServices/vaults/replicationVaultSettings@2024-01-01' = {
  parent: vaults_Site_recovery_vault_canadaeast_name_resource
  name: 'default'
  properties: {
  }
}

Asking for two parameters:

Status Message: Operation failed as replication provider settings were not specified. (Code: BadRequest)
 - Operation failed as replication provider settings were not specified. (Code:ReplicationProviderSettingsNotSpecified)
Status Message: An invalid parameter MigrationSolutionId and VMwareToAzureProviderType was passed. (Code: BadRequest)
 - An invalid parameter MigrationSolutionId and VMwareToAzureProviderType was passed. (Code:InvalidParameter)

Looking on Microsoft documentation, these two properties are not required and my ASR does not suppose to replicate any VMware machines.

https://learn.microsoft.com/en-us/azure/templates/microsoft.recoveryservices/vaults/replicationvaultsettings?pivots=deployment-language-bicep

Thanks,

Azure Site Recovery
Azure Site Recovery
An Azure native disaster recovery service. Previously known as Microsoft Azure Hyper-V Recovery Manager.
724 questions
{count} vote

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.