azurecloudflareazure-front-doorazure-custom-domain

Azure Front Door custom domain not using correct cert


I'm trying to setup a Storage account (static hosted app) with Azure Front Door, and while the routing to my static app is working, for some reason the certificate being used still points to the *.azuredge.net (as opposed to *.mydomain.com)

For the most part of a day I was fighting an issue where the domain would have a "succeeded" provision state, but then it'd revert back to "failed". After lot's googling (note this isn't really my area of expertise) it appeared the issue was due to my certificate not including Cloudflare's root cert. After re-creating the cert, I was finally able to provision the custom domain correctly, and the routing starting working fine. However, the site is still using the original edge certificate (the one the default endpoint would use) and therefore the browser flags it as insecure.

The summary of it is

  1. I purchased a domain via Cloudflare
  2. I provisioned an Azure Front Door Service (Standard)
  3. As part of the AFD provisioning, an endpoint got created with the default route and routing group which points to a storage account static hosting url. That AFD endpoint url looks like myapp-xxxxxcmdmd4.z01.azurefd.net. As expected, if navigate to it, it all works as expected
  4. I created an origin cert using Cloudflare and uploaded it to the key vault (for both wildcard subdomain and domain, so *.mydomain.com & domain.com)
  5. Added a CNAME (wildcard) to point to the endpoint
  6. Created a custom wildcard domain, and linked it to the uploaded cert. Note - I used the "Non-Azure validated domain" and "All other DNS services" options.
  7. I added a TXT DNS record to the domain so it could validated
  8. The provisioning of the domain was successful, and the routing works. I can navigate to https://testing.mydomain.com and the app renders fine, however the SSL issue is still there.

Here's a couple of pics below. Any help would be greatly appreciated

enter image description here

enter image description here

enter image description here


Solution

  • Create an alias (A record) in DNS instead of CNAME record. The IP is the address of the front door host (myapp-xxxxxcmdmd4.z01.azurefd.net).

    I had the same problem and it was solved like this.