Unable to add custom domain to static web app

vezielos 20 Reputation points
2024-11-13T11:18:32.2633333+00:00

Hello,

I'm trying to add a custom domain to a static web app, but it's not possible.

I've deleted entirely the static web app and created again, but still it is not possible.

Please your help.

User's image

External DNS has been configured for more than 24hs. and works perfectly, below the evidence where azure respond 404, confirming that a custom domain has not been configured.User's image

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

Accepted answer
  1. Laxman Reddy Revuri 800 Reputation points Microsoft Vendor
    2024-11-18T09:19:39.5+00:00

    Hi @vezielos
    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to accept the answer

    Ask :Unable to add custom domain to static web app
    Solution:
    Finally I figured out on how to solve this issue. The problem is in the domain name textbox. Seems like Azure is assuming domain names with one dot only (.com, .net, .org). In my case, the domain name has two dots: .org.ar

    So, the trick to solve this "two dots issue" that worked for me was:

    When you are going to validate a custom domain using CNAME record and must indicate "domain" name, there you need to indicate "subdomain+domain" name. Example:

    www.mydomain.org.ar

    Instead of

    mydomain.org.ar

    Please don’t forget to Accept Answer and Yes for "was this answer helpful" wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Laxman Reddy Revuri 800 Reputation points Microsoft Vendor
    2024-11-14T09:27:04.32+00:00

    Hi @vezielos
    Thanks for the question and using MS Q&A platform.

    If you receive the message CNAME Record is invalid, then check that your DNS zone lists the Microsoft DNS services with your DNS registrar. If you have recently moved the domain to Azure DNS, you may need to wait for DNS propagation before adding the custom domain.
    For more information custom domain in Azure Static Web Apps
    https://learn.microsoft.com/en-us/azure/static-web-apps/custom-domain-azure-dns?source=recommendations
    Troubleshoot DNS Configuration for Azure Static Web App
    Verify DNS Configuration: Double-check that the CNAME record is correctly set up with your DNS provider. The name should match exactly what Azure provided, and the value should be happy-tree-[redacted].azurestaticapps.net.
    Add your custom domain again, ensuring that the domain name matches the CNAME record you set up.
    DNS Propagation: Although DNS changes can take up to 48 hours, they usually propagate faster. If it's been more than 24 hours, it might still be worth waiting a bit longer.

    Clear Browser and DNS Cache: Clear your browser cache and DNS cache to ensure you're not seeing a cached version of the site.

    Check for Typos: Ensure there are no typos in the domain name or the CNAME value.

    Use a DNS Checker: Use an online DNS checker tool to verify that the CNAME record is correctly set up and visible.

    I hope this information is helpful.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it.


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.