bicep icon indicating copy to clipboard operation
bicep copied to clipboard

Azure Front Door Standard/Premium custom domain infinite pending state

Open vinhent opened this issue 5 years ago • 12 comments

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:

  1. Create a CDN profile and a Front Door Standard/Premium endpoint.
  2. Create a custom domain.
  3. Create a TXT record set in the same deployment as the custom domain.
  4. Use customDomain.properties.validationProperties.validationTokenas the value of the TXT record set.

Additional context None.

vinhent avatar Sep 17 '21 17:09 vinhent

See discussion here: https://github.com/MicrosoftDocs/azure-docs/issues/78229

miqm avatar Sep 19 '21 13:09 miqm

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 avatar Sep 22 '21 17:09 alex-frankel

@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.

ttq-ak avatar Sep 23 '21 07:09 ttq-ak

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 avatar Sep 23 '21 07:09 ttq-ak

@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.

vinhent avatar Sep 23 '21 13:09 vinhent

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 avatar Sep 29 '21 20:09 harvey-k

@harvey-k - can you share the support ticket ID so we can follow up on our side?

alex-frankel avatar Oct 05 '21 16:10 alex-frankel

@alex-frankel Of course. Service Request #2106300010003066

harvey-k avatar Oct 05 '21 18:10 harvey-k

FYI this is still underway. I am working with the Front Door team on this.

johndowns avatar Nov 09 '21 19:11 johndowns

any news about that issue?

CharlesToniolo avatar Jan 20 '22 13:01 CharlesToniolo

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.

johndowns avatar Jan 20 '22 17:01 johndowns

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.

johndowns avatar Mar 10 '22 22:03 johndowns