Azure Static Web App Certificate Renewal Failing to Verify External Provider (Cloudflare DNS)

Daniel-4204 105 Reputation points
2025-08-07T20:39:11.37+00:00

Cloudflare is currently both our domain registrar and DNS provider for several domains used as custom subdomains with Azure Static Web Apps.

About one year ago, we configured 3 Azure Static Web Apps to use custom domains.

Based on Microsoft’s documentation, Azure is supposed to automatically renew SSL certificates annually by verifying domain ownership typically through checking the existing CNAME record.

As of today, two of the custom domains are no longer working due to expired certificates in our development environment. The certificate for our production environment is set to expire on August 10, so we’re hoping to resolve this before that date to avoid a service disruption.

I’ve seen other users report similar issues, and some mentioned that Microsoft support advised them privately to add the following CAA records to allow Azure (via DigiCert) to issue certificates:

@ 0 issue "digicert.com"

and another

@ 0 issuewild "digicert.com"

But there was no update on that thread to as if that worked.

These records have been added to the domain's DNS, but so far, domain verification has not succeeded. I still suspect that the issue may be caused by the CNAME record being proxied through Cloudflare, which could be preventing Azure from validating the domain ownership required for certificate renewal. That said, this is only an assumption.

We would prefer not to use Azure Front Door or switch to manual certificate management unless absolutely necessary.

Can you confirm whether Cloudflare’s proxying or automated CAA injection could be interfering with certificate renewal by Azure? And is there a recommended solution that allows us to continue using Cloudflare DNS and Azure Static Web Apps without needing Azure Front Door?

What must be done in order for Azure to be able to verify domain ownership of an existing custom domain instead of deleting the custom domain in Azure and re-adding (which can take days to verify when starting over) I have seen.

Is the solution for now, to delete the custom domain and re-add using TXT record, then proceed with CNAME record after validation. If so, will TXT record value given stay valid long term for future annual domain verifications so that certificate renwal wont fail? How can we make this sustainable to void this downtime?

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
{count} votes

1 answer

Sort by: Most helpful
  1. Siva Nair 345 Reputation points Microsoft External Staff Moderator
    2025-08-08T18:47:11.8833333+00:00

    Hi Daniel-4204

    Glad the first two points were helpful. Let me address your follow-up questions and give you a plan that will work reliably going forward.

    1. About the /.well-known/pki-validation/fileauth.txt endpoint
    • This path is part of DigiCert’s HTTP-based domain validation process. When Azure Static Web Apps requests a certificate from DigiCert, DigiCert may try to confirm domain ownership by checking this file.
    • If the domain is proxied through Cloudflare or has security rules blocking that path, DigiCert cannot reach it, and renewal fails.
    • Microsoft does not document this file path specifically for Static Web Apps, but they do confirm that domain ownership validation is handled through CNAME, TXT, or HTTP checks as part of the binding process: doc- https://learn.microsoft.com/en-us/azure/static-web-apps/custom-domain?tabs=azure-dns#custom-domain-validation
    1. Why you’ve had failures and how to fix it permanently
    • Your domains were originally bound using CNAME only (proxied via Cloudflare), so when Azure tries to re-verify at renewal, it cannot see the underlying Azure hostname.
    • If there’s no permanent TXT record in DNS for that domain, Azure has no alternate validation path and renewal fails.
    1. Long-Term Solution (No Annual Downtime)

    One-time setup:

    1. Remove and re-add each domain via TXT verification in Azure Static Web Apps:
      • In the Azure Portal, go to your Static Web App → Custom domains → Add.
      • Choose the TXT record verification option.
      • Add the TXT record exactly as Azure provides to your DNS in Cloudflare.
      • Once verified, keep the TXT record in DNS permanently.
    2. Keep your Cloudflare proxy ON if you want, but ensure:
      • CAA records for digicert.com are present (you’ve already done this).
      • The TXT verification record is never removed, even after future renewals.
    3. Optional: If you want HTTP validation to work as a fallback, create a Cloudflare Page Rule or Firewall Rule to allow public access to: https://<yourdomain>/.well-known/pki-validation/fileauth.txt without blocking or redirecting it.
    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.