Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use -WhatIf on New-AzResourceGroupDeployment with PrivateDnsZoneGroup in template #26763

Open
weevil44 opened this issue Nov 26, 2024 · 2 comments
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.

Comments

@weevil44
Copy link

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

New-AzResourceGroupDeployment -ResourceGroupName "my-rg" -TemplateFile key-vault-template.json -TemplateParameterFile key-vault-parameters.json -WhatIf

New-AzResourceGroupDeployment:
DeploymentWhatIfResourceInvalidResponse - Long running operation failed with status 'Failed'. Additional Info:'The request to predict template deployment changes to scope '/subscriptions/<subscription id>/resourceGroups/my-rg' has failed due to missing or unexpected response on request '/subscriptions/<subscription id>/resourceGroups/my-rg/providers/Microsoft.Network/privateEndpoints/kv-test-cus-4-pep/privateDnsZoneGroups/vaultPrivateDnsZoneGroup?api-version=2020-03-01'

Environment data

Name                           Value
----                           -----
PSVersion                      7.4.6
PSEdition                      Core
GitCommitId                    7.4.6
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Module versions

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Script     3.0.1                 Az.Accounts                         {Add-AzEnvironment, Clear-AzConfig, Clear-AzContext, Clear-AzDefault…}
Script     7.2.0                 Az.Resources                        {Export-AzResourceGroup, Export-AzTemplateSpec, Get-AzDenyAssignment, Get-AzDep

Error output

@weevil44 weevil44 added bug This issue requires a change to an existing behavior in the product in order to be resolved. needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Nov 26, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Nov 26, 2024
@VeryEarly VeryEarly added ARM - Templates Service Attention This issue is responsible by Azure service team. and removed customer-reported labels Nov 28, 2024
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/deployments-owners.

1 similar comment
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/deployments-owners.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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.
Projects
None yet
Development

No branches or pull requests

2 participants