Mapping a custom naked domain to your Azure App Service
A naked URL means that there is no www or any other sub-domain prefix before the domain name and domain extension. I wrote an updated version on how to configure a common www based custom domain here.
There are numerous articles about this which are posted here, but I though an update was in order. To configure a custom domain for your Azure App Service, the following steps are required: (Note: you can also purchase a custom domain right from within the portal itself, as described here. If you do that, many of these complexities are removed.)
- Create an A Record with your DNS provider
- Add the naked custom domain to the Azure App Service
Create an A Record with your DNS provider
If you attempt to configure the naked domain without an A Record in the Azure portal you will likely get an error similar to the following.
A records were found pointing to the following IP addresses: ###.###.###.###, etc... Please create an A record pointing to the following IP address: ###.###.###.### No TXT records were found. Please create a TXT record pointing from ****.com to ****.azurewebsites.net
You need to access the portal of your DNS provider and enter both the A Record and the TXT records as requested. The end result may look something like the following. You will also need to create a second CNAME record called AWVERIFY.
Figure 1, configure a naked custom domain, url with no www to an Azure App Service
Add the naked custom domain to the Azure App Service
In the Azure portal navigate to the Azure App Service to which you want to configure the naked custom domain to. Then click on the Custom domain link, followed by the Add hostname link as shown in Figure 2.
Figure 2, add a naked custom domain to an azure app service
Enter the hostname and press the validate button. Once validated, as shown in Figure 3, press the Add hostname button and you are all set.
Figure 3, add a naked hostname to an Azure App Service
If all works out then you see both the www and the naked domain on the Custom domain blade as shown in Figure 4.
Figure 4, configuring custom domains for an Azure App Service