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.
- 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
- 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.
- Long-Term Solution (No Annual Downtime)
One-time setup:
- 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.
- 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.
- CAA records for
- 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.