Azure / Azure/azure-cli

Can't delete DNS record with the Complete deployment mode.

Open
#23,219 8 comments 4 reactions 0 assignees View on GitHub
act-identity-squad ARM Auto-Assign customer-reported Service Attention
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

### **This is autogenerated. Please review and update as needed.**

## Describe the bug
The DNS record is not deleted with the Complete deployment mode.

**Command Name**
`az deployment group create`

**Errors:**
```

```

## To Reproduce:
1. Create bicep file sample.dns.bicep:
```
param zoneName string = 'my.local'
var defaultTtl = 3600

resource zone 'Microsoft.Network/dnsZones@2018-05-01' = {
name: zoneName
location: 'global'
}

resource _root_A 'Microsoft.Network/dnsZones/A@2018-05-01' = {
name: '@'
parent: zone
properties: {
TTL: defaultTtl
ARecords: [
{
ipv4Address: '1.1.1.1'
}
]
}
}

```
2. Run the deployment
`az deployment group create --name test1 --resource-group dns-test --template-file .\sample.dns.bicep --mode Complete`
All good, records created
3. Change the file to (so remove the record):
```
param zoneName string = 'my.local'
var defaultTtl = 3600

resource zone 'Microsoft.Network/dnsZones@2018-05-01' = {
name: zoneName
location: 'global'
}

```
2. Run the deployment
`az deployment group create --name test1 --resource-group dns-test --template-file .\sample.dns.bicep --mode Complete`

Deployment is OK, but record is still there.

## Expected Behavior
DNS Record deleted

## Environment Summary
```
Windows-10-10.0.19044-SP0
Python 3.10.4
Installer: MSI

azure-cli 2.37.0 *

Extensions:
account 0.2.1
scheduled-query 0.5.0

Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1
```
## Additional Context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.