Is it possible for an Azure static website and an Azure web-app to share a web-domain?

Bruce Bayley 20 Reputation points
2023-03-10T03:21:33.3466667+00:00

I have a Blazor app hosted in an Azure web app service with its own subdomain on GoDaddy (e.g., app.mydomain.com).

Now I want to have an Azure website in the root domain (e.g., mydomain.com).

Is this possible? If so, how would the DNS data be configured?

I tried replacing the DNS @ A-record (that was set to the Web-App IP-Address) with a DNS @ CNAME-record set to the Static website endpoint, however it was rejected by the GoDaddy DNS with "Missing/invalid data passed in request"). The Static website ip-address is dynamic so I can't set the A-record to that.

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

Accepted answer
  1. VenkateshDodda-MSFT 25,111 Reputation points Microsoft Employee Moderator
    2023-03-15T05:36:33.7566667+00:00

    @Bruce Bayley Thank you for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.

    As mentioned in this documentation here, Some domain registrars (like Google and GoDaddy) don't allow you to point the apex domain to an existing URL. If your registrar doesn't support ALIAS or ANAME records, or doesn't allow CNAME flattening, consider the following steps:

    • Configure your domain with Azure DNS.
    • Forward the apex domain to the www subdomain
    • Use an A record

    Also, adding @A record to static webapps is not suggested and your static webapp will no longer be benefited from global distributions.

    If you want to setup a CNAME flattering for the apex domain then you can configure the your doamin with Azure DNS and by using AFD you can acheive it.

    Feel free to reach back to me if you have any further questions on this.


0 additional answers

Sort by: Most 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.