Static Web App Custom Domain validation keeps failing with "Unknown error"

Shane Milton 5 Reputation points
2023-03-15T20:47:55.8966667+00:00

I'm attempting to host a 1-page (HTML) static web app, about as simple as possible. Everything's gone great except for adding a Custom Domain to it. No matter what I do, it keeps failing validation and the error message is "An unknown error has occurred while adding your custom domain. Please try again later." In my case, the DNS Zone is being managed in Azure in the same subscription, and other DNS things work just fine. I have attempted:

  1. Letting the Portal's UI create the CNAME in the DNS Zone for me. The results look correct, but I get that same "unknown error" message.
  2. Manually creating the CNAME in the DNS Zone for me. Same error.
  3. Creating the CNAME as an "Alias Record Set" in order to remove all doubt that I'm doing it wrong. Same error message.

I can even see the DNS records take hold when I do an NSLookup from my local laptop. But no matter what I do, the Static Web App's Custom DNS blade keeps saying it's failing validation. When I click on it for details, I just infinitely have a spinner that never gives me an actual status, which is below the "unknown error" error message.

I have custom DNS working great with this same DNS zone using it with Front Door in front of a suite of AAD B2C implementations. But no dice with this wildly simple static site. :-(

User's image

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

4 answers

Sort by: Most helpful
  1. brtrach-MSFT 17,731 Reputation points Microsoft Employee Moderator
    2023-03-21T03:34:23.39+00:00

    I'm sorry to hear that you're having trouble with adding a custom domain to your static web app. Unfortunately, the error message "An unknown error has occurred while adding your custom domain. Please try again later" is not very specific, and it's difficult to determine the root cause without more information.

    Here are a few things you can try to resolve the issue:

    1. Check the custom domain name: Make sure the custom domain name is correct and that it's not already in use by another Azure resource.
    2. Verify the CNAME record: Verify that the CNAME record is set up correctly in your DNS provider's control panel.
    3. Wait for propagation: It can take up to 72 hours for DNS changes to propagate. Wait for a few hours and try again.
    4. Check the Azure portal: Check the Azure portal to see if there are any error messages or warnings related to your custom domain.

    Please let me know if these suggestions do not resolve the issue. We can work with you further to see if we can locate the cause of the error. We look forward to your reply.


  2. Tuukka 0 Reputation points
    2023-11-28T15:55:08.8966667+00:00

    I have also the same problem. TXT code generation fails because:

    An unknown error has occurred while adding your custom domain. Please try again later.

    I copied the CNAME to my host DNS provider. The validation fails in every scenario I have tried.

    User's image


  3. Michael Offengenden 0 Reputation points
    2024-09-17T07:24:12.5033333+00:00

    I removed the domain and added it again and it worked.

    0 comments No comments

  4. Chrys Ngoma 0 Reputation points
    2024-10-10T10:41:59.8366667+00:00

    you should try https://github.com/Azure/static-web-apps/issues/1447#issuecomment-2404729057

    Free certificates are issued by DigiCert. For some domains, you must explicitly allow DigiCert as a certificate issuer by creating a CAA domain record with the value: 0 issue digicert.com. Add it for main domain. That was worked for me. You don' find it in documentation.


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.