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://learn.microsoft.com/en-us/azure/static-web-apps/custom-domain
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 App Service
-
SnehaAgrawal-MSFT 17,771 Reputation points
2020-06-24T17:40:48.663+00:00 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.
-
Dave Slinn 1 Reputation point
2020-06-24T18:59:04.107+00:00 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.
-
Dave Slinn 1 Reputation point
2020-06-25T05:16:31.677+00:00 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?
-
SnehaAgrawal-MSFT 17,771 Reputation points
2020-06-25T06:09:07.587+00:00 Thanks for response! We are looking into this will get back to you soon.
-
SnehaAgrawal-MSFT 17,771 Reputation points
2020-06-25T07:50:26.707+00:00 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.
-
Kyle Burns 1 Reputation point • Microsoft Employee
2020-06-25T11:01:42.567+00:00 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.
-
Dave Slinn 1 Reputation point
2020-06-25T15:42:53.477+00:00 So are you saying that once I validate the CNAME record using www, I can change it to whatever subdomain I want? If so, then that is a problem - I cannot perform the www step because our main website is hosted on Azure App Service and there is already a CNAME record in our DNS with the value of that Azure App Service website, so I will never be able to validate a www CNAME with the new static web app name.
-
SnehaAgrawal-MSFT 17,771 Reputation points
2020-06-25T18:44:19.897+00:00 To elaborate on this: No, you should create a CNAME entry with the desired host name and perform all steps with that, instead of www
-
Dave Slinn 1 Reputation point
2020-06-25T19:27:59.717+00:00 But when you click Add on the Custom Domain settings for a Static Web App, it says you must create a CNAME record with www as the name. I have no option to change that. See picture I attached earlier.
-
SnehaAgrawal-MSFT 17,771 Reputation points
2020-06-26T07:00:41.753+00:00 Thanks for the clarification. Could you please send an email to AzCommunity[at]Microsoft[dot]com referencing this issue, we would like to work closer with you on this matter.
-
Ryan Hill 25,216 Reputation points • Microsoft Employee
2020-06-26T16:37:27.597+00:00 Hi anonymous userSlinn-1175,
You can still enter your subdomain myapp.mydomain.com assuming you have your CNAME record. The www wording on the UI and doc needs to be updated but if you run into problems, please let us know using the email @SnehaAgrawal-MSFT posted below.
-
Taras Tyrsa 1 Reputation point
2021-04-12T11:55:05.457+00:00 It seems that www is not only ui label as it is still impossible to enter anything else except www. Almost year passed...
Sign in to comment
1 answer
Sort by: Most helpful
-
Anthony Chu - MSFT 856 Reputation points • Microsoft Employee
2021-05-12T23:47:22.503+00:00 -
Piotr Czyz 1 Reputation point
2021-12-17T11:29:39.537+00:00 Is there any possibility to add more than 5 custom domains? It is a huge blocker for us.
-
Ankush Brahmbhatt 1 Reputation point
2022-02-17T16:20:13.267+00:00 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
-
Ryan Hill 25,216 Reputation points • Microsoft Employee
2022-02-18T03:29:15.743+00:00 @Piotr Czyz @Ankush Brahmbhatt 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.
Sign in to comment -