This post is about how To Map Custom Domain To Azure Web App. By default azure web app comes with a subdomain.azurewebsites.net. In this post I am explaining how to map a custom domain to an azure web app.
You can map domain or sub domain to an azure web app. If you’re mapping a domain, you need to modify your
A NAME records and for subdomain’s you need to configure
C NAME records.
- First you need to create azure web app. For configuring custom domain’s you need to choose
D1 (Shared Infrastructure)or more, which supports Custom domains.
- I created this web app with shared pricing plan. Once you created the web app, select custom domain option from the overview blade.
- Click on the Add HostName option, enter a Hostname and click on
Validatebutton. This will show configuration details for the hostname. If it is domain, then it will show A NAME configuration, and if you’re entering a subdomain, it will show C NAME configuration details, since you didn’t configured it, it is showing
Domain Ownershipas error.
- You will get IP Address of your azure web app, you need to configure A NAME records and TXT records of your domain provider to azure web app. Here is the A NAME configuration.
- And next you need to configure TXT records. Here is the screenshot for the same.
You can check whether the DNS records updated or not using websites like
https://www.whatsmydns.net, this app will help you to verify the A NAME and TXT records got updated or not. Depends on your domain name provider, it might take sometime. Once it is done, you need to click on the
Validate button again. Then you will be able to see the domain ownership also changed to green.
- Next click on the
Add Hostnamebutton. This will display the domain name under
Hostname Assigned to Site.
Now onwards if you browse the site, it will bring your azure web app. In this way you can configure custom domain to azure web app. In the next blog post I will explain how to enable SSL for azure web app with custom domain.
Happy Programming :)