question

DaveSlinn-1175 avatar image
0 Votes"
DaveSlinn-1175 asked ryanchill commented

Custom Domain for Static Web App that isn't www possible?

I have created a new Static Web App at https://calm-river-02866fe10.azurestaticapps.net/ and want to define a custom domain for it, but when I try to via Azure Portal, it requires a CNAME record in our DNS registrar with a host of www. However, we already have a www CNAME record for our main website. I would like this web app to run on a different subdomain - something like customapp.mydomain.com.

Is this possible, and if so, how do I accomplish this?

azure-webapps-developmentazure-webapps-custom-domains
· 12
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for asking question! If I have understood right, you want all traffic to be sent to a subdomain to route to another domain. If you want to point all subdomains to www.example.com then map a wildcard.

You may want to investigate official doc Setup a custom domain in Azure Static Web Apps Preview might be helpful.


Let me know if issue persists.

0 Votes 0 ·

When I go to configure the custom domains for my static web app, the first step tells me to add a CNAME record with my DNS provider with the name of www and value of my azure static app default url.

But I can't do that, because we already have a CNAME record with www in to validate a separate web site running on Azure App Service. How can I validate the domain if I can't create that www record? Note: I don't want to run my static web app as www.mydomain.com but instead as myapp.mydomain.com.

10566-annotation-2020-06-24-120809.png


0 Votes 0 ·

Thanks for the reply. So, the www is just an exemplary, and you can register any custom domain. You may consider the www a doc-placeholder for the desired hostname and so if you want myapp.mydomain.com, instead of www.mydomain.com, just add a CNAME record for myapp to your domain’s DNS as documented, and add the myapp.mydomain.com in the SWA domain registration dialog.

0 Votes 0 ·
Show more comments

I have given up trying to get my static web app running under subdomain on my existing domain, and registered a new domain for my app so i can run it at www.myapp.com. I've configured the CNAME record and everything validated correctly, however I don't know what to configure for the A record. My DNS provider has defaulted the A record to the value of "PARK", which is what they set it to when you first create a new domain record with them. But don't I need to update the A record for my DNS with an actual IP address? If so, how do I get that?

0 Votes 0 ·

Thanks for response! We are looking into this will get back to you soon.

1 Vote 1 ·

Hi Dave. When you set up the CNAME, it should be mapping your custom DNS name to the default DNS name for your static website. Because the default DNS name is not in your domain, the lookup will use Microsoft's DNS to resolve for the A record and you do not need one of your own.

0 Votes 0 ·

1 Answer

anthonychu-msft avatar image
0 Votes"
anthonychu-msft answered ryanchill commented

Any subdomain should work with CNAME. In addition, today it was announced that Static Web Apps is now generally available. As part of the announcement, it's now possible to use apex / root domains as well. https://docs.microsoft.com/en-us/azure/static-web-apps/custom-domain

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Is there any possibility to add more than 5 custom domains? It is a huge blocker for us.

0 Votes 0 ·

I had similar question as you PiotrCzyz but it seems currently there is no way to allow more than 5 domains and you have to use azure front door to achieve the same

0 Votes 0 ·
ryanchill avatar image ryanchill AnkushBrahmbhatt-6861 ·

@PiotrCzyz @AnkushBrahmbhatt-6861 I didn't see anything on the Azure Feedback. I would suggest posting this feedback as this limitation is listed on Quotas in Azure Static Web Apps.


0 Votes 0 ·