Azure Front Door Standard/Premium custom domain infinite pending state
Bicep version Bicep CLI version 0.4.63 (7ebed03284)
Describe the bug
We are trying to do the automation of a custom domain creation and validation using Bicep. Once the Azure Front Door Standard/Premium endpoint is created, we create a CNAME record set, then we create a custom domain, and then we try to validate it by creating a TXT record set. This issue is that the creation of the customDomain resource never returns and stays in pending state forever so we can't use customDomain.properties.validationProperties.validationToken to automatically validate the custom domain as expected. It would be nice to get a response even though the custom domain is in updating/pending validation state so we can validate it afterwards in the same deployment.
resource customDomainRecordSet 'Microsoft.Network/dnsZones/CNAME@2018-05-01' = {
name: customDomainRecordSetName
parent: dnsZone
properties: {
TTL: 3600
CNAMERecord: {
cname: endpoint.properties.hostName
}
}
}
resource customDomain 'Microsoft.Cdn/profiles/customDomains@2020-09-01' = {
name: customDomainName
parent: profile
properties: {
hostName: customDomainHostName
tlsSettings: {
certificateType: 'ManagedCertificate'
minimumTlsVersion: 'TLS12'
}
}
dependsOn: [
customDomainRecordSet
]
}
resource validationRecordSet 'Microsoft.Network/dnsZones/TXT@2018-05-01' = {
name: validationRecordSetName
parent: dnsZone
properties: {
TTL: 3600
TXTRecords: [
{
value: [
customDomain.properties.validationProperties.validationToken
]
}
]
}
}
To Reproduce Steps to reproduce the behavior:
- Create a CDN profile and a Front Door Standard/Premium endpoint.
- Create a custom domain.
- Create a TXT record set in the same deployment as the custom domain.
- Use
customDomain.properties.validationProperties.validationTokenas the value of the TXT record set.
Additional context None.
See discussion here: https://github.com/MicrosoftDocs/azure-docs/issues/78229
This looks to be an RPC violation. All resource types should not return a terminal state so that the deployment can proceed. What happens when you reference this property? Does the bicep deployment never complete?
@alex-frankel I tried this a month ago or so, and it just got stuck "forever" (Until you verify the domain).
Running locally I gave up and quit after two hours, verified the domain then the bicep ran with no issue. Running in Azure DevOps the task was timed out after two hours.
The domain was still stuck in the "pending" state the next morning, until it's verified.
There was a thread about this on feedback.azure.com, but that's now gone and I don't know where it ended up going
@ttq-ak Exactly the same behavior that we are experiencing. I kept it in my bicep file but every time we deploy it for the first time or add a new custom domain we have to be aware to manually verify it in order to unblock the remaining of the deployment otherwise our Azure DevOps deployment will timeout after 60 minutes.
@alex-frankel The deployment would be in pending state and never compete until we manually verify it. After we manually verify the custom domain, the deployment continues.
I believe this issue is a duplicate of https://github.com/Azure/bicep/issues/3568 which is a bug in in the underlying ARM service.
I was told by Microsoft support it was scheduled to be fixed in the front door release at the end of August, but apparently they're still working on it.
See also https://github.com/Azure/bicep/discussions/3428
@harvey-k - can you share the support ticket ID so we can follow up on our side?
@alex-frankel Of course. Service Request #2106300010003066
FYI this is still underway. I am working with the Front Door team on this.
any news about that issue?
This is being tested in some staging environments at the moment. It should be released to the new Front Door Standard/Premium within a few weeks.
Per #3568, this change has been released. You should see the new behaviour now.
We also published some Bicep and ARM template samples showing how this works - see #3568 for links.
@alex-frankel I think this issue can be closed now.