Map an existing custom DNS name to Azure App Service
Prepare your environment
- Create an App Service app, or use an app that you created for another tutorial. The web app’s App Service plan must be a paid tier and not Free (F1).
- Make sure you can edit the DNS records for your custom domain. To edit DNS records, you need access to the DNS registry for your domain provider, such as GoDaddy. For example, to add DNS entries for
contoso.com
andwww.contoso.com
, you must be able to configure the DNS settings for thecontoso.com
root domain. Your custom domains must be in a public DNS zone; private DNS zone is only supported on Internal Load Balancer (ILB) App Service Environment (ASE). - If you don’t have a custom domain yet, you can purchase an App Service domain.
Get a domain verification ID
- Search for and select App Services.
- On the App Services page, select the name of your Azure app.
You see the management page of the App Service app.
To add a custom domain to your app, you need to verify your ownership of the domain by adding a verification ID as a TXT record with your domain provider. - In the left pane of your app page, select Custom domains.
- Copy the ID in the Custom Domain Verification ID box in the Custom Domains page for the next step.
- (A record only) To map an A record, you need the app’s external IP address. In the Custom domains page, copy the value of IP address.
Create the DNS records
- Sign in to the website of your domain provider.
- Find the page for managing DNS records.
- The following screenshot is an example of a DNS records page:
Enable the mapping in your app
- In the left pane of the app page in the Azure portal, select Custom domains.
- Select Add custom domain.
- Type the fully qualified domain name that you configured the A record for, such as
contoso.com
. - Select Validate. The Add custom domain page is shown.
- Make sure that Hostname record type is set to A record (example.com). Select Add custom domain.
It might take some time for the new custom domain to be reflected in the app’s Custom Domains page. Refresh the browser to update the data.
- If you missed a step or made a typo somewhere earlier, a verification error appears at the bottom of the page.
Test in a browser
Browse to the DNS names that you configured earlier.
Tag:Azure