Home:ALL Converter>Availability Set in Availability Zone Arm Configuration

Availability Set in Availability Zone Arm Configuration

Ask Time:2021-03-30T06:02:31         Author:Norrin Rad

Json Formatter

I'm trying to build out a script which deploys a vm into an availability set within an Azure availability zone.

However I keep getting the following error. I think (guessing) that it's to do with the fact the av set is not deployed to the same zone as the vm, but cannot find anywhere to set the zone on the availability set.

Error:

 New-AzResourceGroupDeployment : 22:41:38 - Error: Code=InvalidRequestContent; Message=The request content was invalid and could not be deserialized: 'Could not find member 'zone' on 
object of type 'TemplateResource'. Path 'properties.template.resources[3].zone', line 217, position 17.'.
At C:\ps\test-vm-build.ps1:182 char:7
+       New-AzResourceGroupDeployment -Name "SapTestDeploy" -ResourceGr ...
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-AzResourceGroupDeployment], Exception
    + FullyQualifiedErrorId : Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.NewAzureResourceGroupDeploymentCmdlet

The ARM template has been uploaded to:

https://pastebin.com/embed_js/5Afn6Pip

Hoping someone has ome across this and can point me in the right direction, Thanks in advance :)

Author:Norrin Rad,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/66862226/availability-set-in-availability-zone-arm-configuration
yy