Azure / Azure/arm-template-whatif
whatIf breaks on Microsoft.Network/privateEndpoints/privateDnsZoneGroups
- Dominant language
- HTML
- Stars
- 101
- Forks
- 21
- Avg merge
- 3h 35m
- Merged PRs (30d)
- 1
Description
**Describe the bug**
Trying to do WhatIf on a deployment of Microsoft.Network/privateEndpoints/privateDnsZoneGroups failes with the following error:
```
An error occurred while deploying this offering. Error:
DeploymentWhatIfResourceInvalidResponse - Long running
operation failed with status 'Failed'. Additional Info:'The
request to predict template deployment changes to scope
'/subscriptions/1c914d97-9725-4deb-b857-269c4c416949' has
failed due to missing or unexpected response on request
'/subscriptions/1c914d97-9725-4deb-b857-269c4c416949/resourceGroups/acc-vnet-rg/providers/Microsoft.Network/privateEndpoints/privateEndpoint-michiel20210903-Blob/privateDnsZoneGroups/default?api-version=2021-05-01'. Diagnostic information: timestamp '20220712T071310Z', tracking id 'c1446b9b-35de-4018-ac86-ef2585e06c6f', request correlation id '6310f502-8211-47c0-a07f-5e889d26c7de', location 'westeurope'.'
```
The deployment itself succeeds completely and results in the requested resources being created, so this seems to be an issue in the handling of WhatIf in this resource type.
**To Reproduce**
Steps to reproduce the behavior:
Use the following Bicep template to deploy a private dns zone config to a private endpoint:
```
param dnsConfig object
param privateEndpointName string
resource privateEndpoint 'Microsoft.Network/privateEndpoints@2022-01-01' existing = {
name: privateEndpointName
}
resource privateDnsZone 'Microsoft.Network/privateDnsZones@2020-06-01' existing = {
name: dnsConfig.name
scope: resourceGroup(dnsConfig.subscriptionId, dnsConfig.resourceGroup)
}
resource dnsZoneConfig 'Microsoft.Network/privateEndpoints/privateDnsZoneGroups@2021-05-01' = {
name: 'default'
parent: privateEndpoint
properties: {
privateDnsZoneConfigs: [
{
name: replace(dnsConfig.name, '.', '-')
properties: {
privateDnsZoneId: privateDnsZone.id
}
}
]
}
}
```
The config used is as follows:
```
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dnsConfig": {
"value": {
"subscriptionId": "1c914d97-9725-4deb-b857-269c4c416949",
"resourceGroup": "michieltest",
"name": "privatelink.blob.core.windows.net"
}
},
"privateEndpointName": {
"value": "privateEndpoint-michiel20210903-Blob"
}
}
}
```
The private endpoint resource's properties are as follows:
```
{
"name": "privateEndpoint-michiel20210903-Blob",
"type": "Microsoft.Network/privateEndpoints",
"location": "westeurope",
"properties": {
"privateLinkServiceConnections": [
{
"name": "serviceConnection-michiel20210903-Blob",
"properties": {
"provisioningState": "Succeeded",
"privateLinkServiceId": "/subscriptions/1c914d97-9725-4deb-b857-269c4c416949/resourceGroups/michieltest/providers/Microsoft.Storage/storageAccounts/michiel20210903",
"groupIds": [
"Blob"
],
"requestMessage": "AutoApproved",
"privateLinkServiceConnectionState": {
"status": "Approved",
"description": "Auto-Approved"
}
}
}
],
"subnet": {
"id": "/subscriptions/1c914d97-9725-4deb-b857-269c4c416949/resourceGroups/acc-vnet-rg/providers/Microsoft.Network/virtualNetworks/acc001-vnet/subnets/globaludr001a-subnet"
}
}
}
```
**Expected behavior**
A WhatIf output of the changes that the deployment entices
**Client**
PowerShell
**Additional context**
Add any other context about the problem here.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing WhatIf with the provided Bicep template, deployment parameters, and Microsoft.Network/privateEndpoints/privateDnsZoneGroups resource. Compare the successful deployment with the failed WhatIf response and investigate handling of the 2021-05-01 privateDnsZoneGroups API response; done means WhatIf reports the expected deployment changes without the invalid-response error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, powershell
- Domain
- cloud, devops
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100