0

Iam Unable to add disaster recovery property to vm module in azure bicep.

disasterrecovery:[


recovery vault Name :myrsv

target availability set id : myavset

target resource group : mygroup

Cache storage account name : my storage 
]

Same like arm templates I mentioned. But it's throws error like template not valid. Some one help to fix the issue

Jahnavi
  • 3,076
  • 1
  • 3
  • 10
Satish B
  • 1
  • 1
  • AFAIK It only supports in ARM template but not in bicep. @Satish B – Jahnavi Aug 28 '23 at 10:39
  • Does this answer your question? [How to add disaster recovery properties in existing VM module in azure Bicep](https://stackoverflow.com/questions/76962189/how-to-add-disaster-recovery-properties-in-existing-vm-module-in-azure-bicep) – Thomas Aug 29 '23 at 02:16

1 Answers1

0

For virtual machine resources, Bicep does not include a disasterRecovery function. It allows you to define virtual machines and their related properties, but it does not allow to add disasterrecovery configurations at the virtual machine level directly. Rather bicep supports virtual machine backup functionality only.

After a workaround on your issue, I found an alternative approach as follows.

You can create a custom deployment script in bicep and pass the site recovery PowerShell script in scriptcontent{} block as detailed in the MS Doc.

By referring to the MSDoc template, I tried creating a backup for VM and was able to deploy it successfully.

Deployment succeeded:

enter image description here

enter image description here

enter image description here

Jahnavi
  • 3,076
  • 1
  • 3
  • 10