I am trying to replace an existing DNS A record with CNAME record having same name using ARM template. I have A record in DNS zone that looks like the following
- name - mylink
- value - 10.22.31.3
- Type - A
- TTL - 60
I want to have CNAME record in the same DNS zone that should look like following
- name - mylink
- value - cos.myaddress.test.net
- Type - CNAME
- TTL - 60
Currently my ARM template looks like following that creates A record
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"resources": [
{
"type": "Microsoft.Network/dnszones/A",
"apiVersion": "2018-05-01",
"name": "mylink",
"properties": {
"TTL": 60,
"ARecords": [
{
"ipv4Address": "10.22.31.3"
}
]
}
},
]
}
I tried to add another CNAME record to this are template which gave error on deployment.
"code": "Conflict",
"message": "The CNAME record could not be created because another record with the same name already exists in this zone."