Wednesday, December 16, 2015

Custom FQDN for Azure WebApps (previously known as WebSites)

Pre-requisite: Create a website with App Service Plan/pricing tier with any but not a Free Tier. Free Tier doesn’t allow custom domains to be mapped. Ensure that the website is accessible (through a webbrowser)
Steps:
1.       Create a cname in your registrar to verify that you own the domain
 To point a custom domain name to your app, Microsoft Azure must verify that you are authorized to do so. First, create a CNAME resource record with your DNS provider that points from either www.yourdomain.com to webappbaredptest.azurewebsites.net, or from awverify.www.yourdomain.com to awverify.<yourwebsite>.azurewebsites.net.
2.       Create a cname form your custom domain to the website
3.       Associate the website FQDN with the custom domain
4.       Access the website via the custom domain name

Troubleshooting tips:
1.       If you try to enter a custom domain before registering the domain (cname) then Azure throws the error
Error: The DNS record for '<yoursubdomain>.<yourdomain>' that points to 'webappbaredptest.azurewebsites.net' could not be located. If you want to configure an A record, you must first create a CNAME record with your DNS provider for 'awverify.myweb.<yourdomain>' that points to 'awverify.webappbaredptest.azurewebsites.net'. First allow the resource record to propagate, and then create the A record.
2.       If you try to enter a custom domain before verifying Azure wont let you enter custom domain
3.       DNS propagation takes sometime. (In reality, in my case took me couple of minutes (~ 1min) to propagate the DNS cname. I configure multiple cname for all kind of use case.)
4.       If you get a message from the website with Error 404 (image below)
Problem:
Solution: Dig/nslookup/ http://digwebinterface.com to ensure that cname has been propagated to the system (might need to flush your ARP records, if you are reusing an existing FQDN)


No comments:

Post a Comment