By default when users create a website on WAWS they hostname would be SITENAME.azurewebsites.net. So when I create a website called Kaushalz then the hostname would be Kaushalz.azurewebsites.net.
Windows Azure Web Sites allows user to configure custom domains as well. But this option is available when the website is scaled to either SHARED or STANDARD (Previously called RESERVED) mode.
There is already documentation on how to configure custom domain. Here is the link: http://www.windowsazure.com/en-us/develop/net/common-tasks/custom-dns-web-site/
However, I have still seen few customers running into issues in spite of this. I will be discussing in as much detail as possible.
So as we know there are 2 ways to configure domain names:
- Add an A record.
- Or you can add a CNAME record.
To explain this scenario I purchased a domain called www.kaushalz.org from GoDaddy.
Now I will show step by step how to configure this.
Create a website and scale it to SHARED/STANDARD
Logon to the Azure portal and create a website. If this is the first site being created in a specific data center then it would be scaled to FREE mode by default. You will have to scale it to either SHARED or STANDARD.
Refer this URL on how to do so: http://www.windowsazure.com/en-us/develop/net/common-tasks/custom-dns-web-site/#bkmk_configsharedmode
Once the website has been scaled to either SHARED or STANDARD, we can proceed further.
Configuration on the DNS Service Provider/DNS Server
As I stated earlier, I purchased a domain www.kaushalz.org form GoDaddy. So I will have to configure the routings on GoDaddy’s DNS servers.
When you click on Manage Domains under the DASHBOARD management page, you will see the following pop-up window providing the details on how to configure:
As seen above it provides the IP which needs to be used while configuring A records on the DNS server.
Additionally it also suggests that before we add custom domains for the site Azure needs to verify that the user is authorized to use the domain name or not.
|
|
|
CNAME | kaushalz.azurewebsites.net |
My DNS service provider is GoDaddy so I need to have www pointing to kaushalz.azurewebsites.net. Below is a snapshot of my DNS Manager.
SCENARIO: MIGRATION FROM PRODUCTION SITE TO WAWS
Now consider a scenario where the user is wants to migrate his production websites to AZURE, without affecting any of his current sites. He would like to perform the verification of the hostname and then would like to modify his DNS records to point to the site hosted on Azure. What should he do?
For this he would have to create CNAME records on the DNS service provider as shown below:
|
|
|
awverify.kaushalz.org | CNAME | awverify.kaushalz.azurewebsites.net |
awverify.www.kaushalz.org | CNAME | awverify.kaushalz.azurewebsites.net |
I’m going to point both kaushalz.org and www.kaushalz.org to kaushalz.azurewebsites.net. Therefore I’m adding the above entries.
Note that kaushalz.org and www.kaushalz.org are 2 different hostnames. The above step is only for verification.
Below is a snapshot of my configuration from GoDaddy. I don’t need any other records apart from these 2 CNAME entries.
You can skip this, if you have an CNAME entry pointing to SITENAME.azurewebsites.net on the DNS server.
DNS VERIFICATION LOGICThe WAWS verification logic has 2 steps:
TXT records are also supported. It is another alternative, because some DNS registrars don’t support CNAME’s pointing to invalid hostnames (the “awverify” version doesn’t truly exist). So one can also create just a TXT record instead of a CNAME (otherwise it is completely same setup as in validations above). Thanks to Petr Podhorsky (DEV on WINDOWS AZURE WEB SITES) who shared the above information with me. |
Add the Domain Name in WAWS Portal
Lets assume the DNS records have propagated successfully, now the only task is to add the domain name to the portal.
Go to the DASHBOARD Management page and click on MANAGE DOMAINS at the bottom of the page.
Enter the domain name and give it some time to verify. If it succeeds, then you would see something as shown below:
If the verification fails then you would get a corresponding warning message that it was unable to perform the 2 step verification logic and would request the user to update the DNS entries.
You will have to try resolving the hostname and confirm that it is resolving to the entries you specified.
As I suggested earlier, go to dnsquery.org and query the hostname and see what does the hostname resolves to. This will indicate whether the propagation of entries has been done or not.
Once the verification is done, user can modify the DNS entries to point to the AZURE front end IP Address provided to him. Below is a snapshot of the final configuration of my domain name on GoDaddy.
***MORE INFORMATION***
NOTE: You will have to add both www.SITENAME.com and SITENAME.com in the portal as they are 2 different hostnames. Below is a snapshot: ![]() |
Once added successfully you are ready to go. Browse the url’s to confirm the site’s availability.