How do we configure custom domain names in Azure PaaS subscription?
Summary:
When a new PaaS site is created and configured in Azure, the default URL will be something like domain-com.azurewebsites.net.
When we are ready to cut-over to using PaaS, we must do the following (ref. https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-custom-domain-name#a)):
- Get app's IP address.
- Create the DNS records that map your domain to your app.
- Where: your domain registrar's own management tool (e.g. Azure DNS, GoDaddy, etc.).
- Why: so your domain registrar knows to resolves the desired custom domain to your Azure app.
- Enable the custom domain name for your Azure app.
- Where: the Azure portal.
- Why: so your app knows to respond to requests made to the custom domain name.
- Verify DNS propagation.
Here is an example of the data used for a real case:
| Domain | Azure | www. (current) | (current) | Change to | www. | TXT | TXT | |
|---|---|---|---|---|---|---|---|---|
| www.amezcua.com | www-amezcua-com.azurewebsites.net | 202.147.21.213 | 202.147.21.213 | à | 13.94.47.87 | 13.94.47.87 | Host: www Value: www-amezcua-com.azurewebsites.net | Host: @ Value: www-amezcua-com.azurewebsites.net |
Detailed steps (ref. https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-custom-domain-name#vip)):
Step 1. Get app's IP address ¶
To map a custom domain name using an A record, you need your Azure app's IP address. If you will map using a CNAME record instead, skip this step and move onto the next section.
- Log in to the Azure portal.
- Click App Services on the left menu.
- Click your app, then click Custom domains.
- Take note of the IP address above Hostnames section..

- Keep this portal blade open. You will come back to it once you create the DNS records.
Step 2. Create the DNS record(s) ¶
Log in to your domain registrar and use their tool to add an A record or CNAME record. Every registrar’s UI is slightly different, so you should consult your provider's documentation. However, here are some general guidelines.
- Find the page for managing DNS records. Look for links or areas of the site labeled Domain Name, DNS, orName Server Management. Often, you can find the link by viewing your account information, and then looking for a link such as My domains.
- Look for a link that lets you add or edit DNS records. This might be a Zone file or DNS Records link, or an Advanced configuration link.
- Create the record and save your changes.
Step 3. Enable the custom domain name for your app ¶
Back in the Custom Domains blade in the Azure portal (see Step 1), you need to add the fully-qualified domain name (FQDN) of your custom domain to the list.
- If you haven't done so, log in to the Azure portal.
- In the Azure portal, click App Services on the left menu.
- Click your app, then click Custom domains > Add hostname.
-
Add the FQDN of your custom domain to the list (e.g. www.contoso.com).
Note
Azure will attempt to verify the domain name that you use here. Be sure that it is the same domain name for which you created a DNS record in Step 2.
-
Click Validate.
- Upon clicking Validate Azure will kick off Domain Verification workflow. This will check for Domain ownership as well as Hostname availability and report success or detailed error with prescriptive guidence on how to fix the error.
- Upon successful validation Add hostname button will become active and you will be able to the assign hostname.
- Once Azure finishes configuring your new custom domain name, navigate to your custom domain name in a browser. The browser should open your Azure app, which means that your custom domain name is configured properly.