Apart from having a highly scalable, self-patching web hosting service while hosting your Web application using the Azure Web apps service, you have also the possibility to publish it using a public custom DNS name in a very easy manner.
When you create an Azure Web app, Azure will add the azurewebsites.net suffix to the name of your Web application. For instance, if your Azure Web app is named vadmin-land, it will be accessible through a URL similar to vadmin-land.azurewebsites.net.
While this may be acceptable for development and testing purpose, you might prefer to make your Web site/app looks more professional by making it accessible through a public domain like www.vadmin-land.com. Consequently, you will need to do some tweaking on your Web site and make sure some prerequisites are there to proceed.
We will see in this post necessary actions that need to be done to make your Azure Web app accessible through a public DNS name.
Prior to proceed, the following things are required:
- You have an existing Web app running on Azure and hosted on a paid tier (Shared, Basic, Standard, or Premium). If your Web app has the F1 Free tier, custom DNS will not be supported. We will see how to change to the appropriate tier in this post.
- You already have a public domain name and have administrative access to your domain provider portal to manage your DNS records.
Step 1. Get your Web app URL
You need to have the URL that has been assigned by Azure during the creation your Web app. You can check it from the Overview property in the Azure portal.
Log in to Azure Portal and go to your Web app properties.
Click on Overview and check your Web app URL. Copy it in the clipboard for later use
Step 2. Make sure your Azure Web app has a supported tier
While creating your Web app, you had to choose an App Service Plan Tier, which defines the set of compute resources for your application to run. You might have chosen the entry level Free tier, which is free to use, as it is intended for test/dev scenarios, but also for temporary websites where the domain name is not that important.
In fact, all other tiers accept custom DNS configuration, except the F1 Free tier. If your Web app is F1 on the Free tier, make sure you change it to another tier that supports custom DNS.
For more information about Azure App Service plan, check out this link.
Log in to Azure Portal and go to your Web app properties. On the properties pane, select the Scale up (App Service plan) option and check your Web app tier.
In this example, I will choose the D1 tier and click on Apply. Note that the custom domain option shows up as soon as I change the tier
Make sure your Web app plan is changed successfully
Step 3. Map your public domain name to your Azure Web app
Login to your DNS domain provider and go to the DNS records sections. I am using name.com to for my DNS hosting, so the screenshots below might be different from the one that you have if you are using a different provider.
Go to your domain DNS records management page and add a CNAME record that maps to your Azure Web App.
For my Web site, I will add a CNAME record named www.vadmin-land.com that maps to my Azure Web app vadmin-land.azurewebsites.net
Step 4. Enable the CNAME record mapping in Azure
This step needs to be done to be sure our Web app is aware of the requests coming from the custom CNAME record that we want to map it to.
On your Azure Wep app property, go to Custom domains, then click on the Add hostname button. If for some reason you are not able to see the option to add an additional domain even after making your Web app running tier that support custom DNS, just log off from Azure portal and close all your browser windows, log in again and you should be good to go.
You domain name CNAME is now added to the list of hostnames assigned to the site The final part will be to check whether our domain CNAME is now operative. Launch the browser of your choice, enter your Wep app domain address and see if it is accessible.
That was quick and easy guide on how make your Azure Wep app looks professional by using a custom domain name.
Thanks for reading!