2 July 2017

Azure Web App not found if a custom domain is used

When you add a custom domain to Azure by default, the domain name and the TLD extension are added. The "www" is considered a subdomain so it is when you access a webpage in Azure with www.domain.com it will be redirected to the error page 404 by defined as the following image.

I'll show you how you can add any subdomain to a Web App in Azure. 

First you have to access the DNS management of the domain and create a CNAME (Alias) with the 'www' ID and point to the URI address of the Web App in Azure, for example.

Make sure the new setting has been accepted before you proceed with the Azure setup.

In Azure go to the Web App, select "Custom domains" and then select the "Add hostname".

On the hostname enter the domain with the www subdomain then select the record type "CNAME (www.example.com or any subdomain)" and click the validate button.

If Azure can confirm to validate the "Domain owenership" the option "Add hostname" is active and you can continue with the process.

In the notifications you will receive the information that the new subdomain was added successfully.

You can now try accessing your web app with the www subdomain.

You can add any other subdomain to a Web App that is not required to be the "www". And that's how you add subdomain in Azure Web Apps.

There are Internet browsers like Firefox ESR that already do this compensation internally but not all browsers can do this. For example Firefox on Linux may be able to do the validation but on Windows not and is not an operating system problem. So it is always recommended in any cloud system or another set the www subdomain.

No comments:

Post a Comment