Custom Domains in Windows Azure
Pointing your own domain at your app is one of the last steps before launch. Here's the simplest way I've found to set up a custom domain for a Windows Azure web app when the domain is registered somewhere else. I'll use GoDaddy as the domain provider in this example.
This guide assumes you already own the domain and already have an app running on Azure at its standard address, something like site-name.azurewebsites.net.
Find your app's details in Azure
- Go to portal.azure.com and sign in.
- Select All resources, then select the web app you want the domain to point to. This opens the App Service blade.
- In the panel on the left, under Settings, select Custom domains.
- Write down the IP address and the URL of your app. You'll need both in the next step.
Add the DNS records at your domain provider
Open the DNS settings for your domain and add these records.
| Record type | Name | Value | TTL |
|---|---|---|---|
| A | @ | IP address of your app | Leave as is |
| TXT | @ | URL of your app (for example site-name.azurewebsites.net) | Leave as is |
| A | * | IP address of your app | Leave as is |
| TXT | * | URL of your app | Leave as is |
| A | www | IP address of your app | Leave as is |
| TXT | www | URL of your app | Leave as is |
Add the hostnames in Azure
- Go back to your web app in Azure and open Custom domains again.
- Select Add hostname, enter your domain (for example site-name.com) and select Validate.
- If everything checks out, Azure tells you the hostname was validated and assigned to your app. Close the blade.
- Select Add hostname again and do the same for the www version (for example www.site-name.com).
Test the domain
Browse to both your domain and the www version. DNS changes can take a while to spread, and how long varies. If you don't see your app yet, you may just need to wait a bit and try again.
That's it. You should now have your custom domain working on your web app. If this helped you launch your app, I'd love to hear about it, and questions are always welcome. Feel free to email me or send me a message on LinkedIn.