Unable to use -WhatIf on New-AzResourceGroupDeployment with PrivateDnsZoneGroup in template #26763
Labels
ARM - Templates
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
Service Attention
This issue is responsible by Azure service team.
Description
There appears to be a bug when using -WhatIf on an existing resource that does not already have a PrivateDnsZoneGroup associated with the pricate endpoint.
To reproduce this bug:
Using an ARM template, create any resource with a private endpoint but without a private DNS zone group included in the ARM template
Add the Private DNS Zone Group creation to the template
Run the command to verify what is going to change with the redeployment
New-AzResourceGroupDeployment -ResourceGroupName "my-rg" -TemplateFile key-vault-template.json -TemplateParameterFile key-vault-parameters.json -WhatIf
It fails with a missing or unexpected response on request error. If the -WhatIf is removed, the resource is successfully deployed, adding the Private DNS Zone group and I can then run the -WhatIf command successfully
Expected result: The -WhatIf would tell me it is going to add a Private DNS Zone Group in addition to any other changes that it will make
Workaroune: Make a copy of the template file. Remove the PrivateDnsZoneGroup creation from the new file. Execute the -WhatIf to verify other changes. Execute the redeployment of the resource. This workaround only works if I execute the deployment manually, not through automation.
Issue script & Debug output
Environment data
Module versions
Error output
The text was updated successfully, but these errors were encountered: