How To Add A Domain To App Service In Azure
This browser is no longer supported.
Upgrade to Microsoft Border to accept advantage of the latest features, security updates, and technical support.
Tutorial: Map an existing custom DNS proper name to Azure App Service
Azure App Service provides a highly scalable, self-patching web hosting service. This tutorial shows y'all how to map an existing custom Domain Proper noun System (DNS) name to App Service. To drift a live site and its DNS domain name to App Service with no downtime, run across Migrate an active DNS name to Azure.
In this tutorial, you lot acquire how to:
- Map a subdomain by using a CNAME tape.
- Map a root domain by using an A record.
- Map a wildcard domain by using a CNAME tape.
- Redirect the default URL to a custom directory.
i. Prepare your environment
- Create an App Service app, or utilise an app that you created for another tutorial. The web app'southward App Service programme must exist a paid tier and not Gratis (F1). See Scale upwardly an app to update the tier.
- Make certain you can edit the DNS records for your custom domain. To edit DNS records, y'all need access to the DNS registry for your domain provider, such equally GoDaddy. For example, to add together DNS entries for
contoso.com
andwww.contoso.com
, yous 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 take a custom domain all the same, you lot tin can purchase an App Service domain.
two. Get a domain verification ID
Sign in to Azure
Open the Azure portal, and sign in with your Azure account.
Select the app in the Azure portal
-
Search for and select App Services.
-
On the App Services page, select the proper noun of your Azure app.
You see the direction page of the App Service app.
To add a custom domain to your app, you need to verify your ownership of the domain past adding a verification ID every bit 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.
Warning
Adding domain verification IDs to your custom domain can prevent dangling DNS entries and help to avoid subdomain takeovers. For custom domains yous previously configured without this verification ID, you should protect them from the aforementioned risk by calculation the verification ID to your DNS record. For more information on this mutual loftier-severity threat, run into Subdomain takeover.
-
(A record merely) To map an A record, you need the app's external IP address. In the Custom domains page, copy the value of IP accost.
3. Create the DNS records
-
Sign in to the website of your domain provider.
You lot tin can use Azure DNS to manage DNS records for your domain and configure a custom DNS name for Azure App Service. For more information, run across Tutorial: Host your domain in Azure DNS.
-
Detect the page for managing DNS records.
Every domain provider has its own DNS records interface, and then consult the provider'southward documentation. Look for areas of the site labeled Domain Name, DNS, or Proper noun Server Direction.
Often, yous can find the DNS records page by viewing your account information and and so looking for a link such as My domains. Go to that folio, then await for a link that'southward named something like Zone file, DNS Records, or Advanced configuration.
The following screenshot is an example of a DNS records page:
-
Select Add or the advisable widget to create a record.
-
Select the type of tape to create and follow the instructions. You tin use either a CNAME tape or an A tape to map a custom DNS name to App Service.
DNS tape types
Scenario | Example | Recommended DNS record |
---|---|---|
Root domain | contoso.com | A record. Don't use the CNAME record for the root tape (for information, run across RFC 1912 Section 2.iv). |
Subdomain | www.contoso.com, my.contoso.com | CNAME record. You tin can map a subdomain to the app'southward IP accost directly with an A record, only it's possible for the IP address to change. The CNAME maps to the app's default hostname instead, which is less susceptible to change. |
Wildcard | *.contoso.com | CNAME record. |
- A
- CNAME
- Wildcard (CNAME)
-
For a root domain similar
contoso.com
, create 2 records according to the following tabular array:Record type Host Value Comments A @
IP address from Re-create the app's IP accost The domain mapping itself ( @
typically represents the root domain).TXT asuid
The verification ID you got earlier For root domain, App Service accesses asuid
TXT record to verify your ownership of the custom domain -
To map a subdomain like
www.contoso.com
with an A tape instead of a recommended CNAME record, your A record and TXT record should look like the following table instead:Record type Host Value Comments A <subdomain> (for case, www) IP address from Copy the app's IP address TXT asuid.<subdomain> (for case, asuid.www) The verification ID y'all got earlier
Note
For sure providers, such as GoDaddy, changes to DNS records don't become effective until you select a split up Salvage Changes link.
four. Enable the mapping in your app
After you create DNS records, you enable the mapping in your app.
- A
- CNAME
- Wildcard (CNAME)
-
In the left pane of the app page in the Azure portal, select Custom domains.
-
Select Add together custom domain.
-
Type the fully qualified domain name that yous configured the A tape for, such as
contoso.com
. -
Select Validate. The Add together custom domain page is shown.
-
Make sure that Hostname tape type is set to A tape (case.com). Select Add custom domain.
Information technology might take some time for the new custom domain to be reflected in the app'due south Custom Domains page. Refresh the browser to update the information.
If you missed a step or fabricated a typo somewhere before, a verification error appears at the lesser of the folio.
5. Test in a browser
Browse to the DNS names that you configured earlier.
If you receive an HTTP 404 (Non Institute) error when you scan to the URL of your custom domain, the 2 most common causes are:
- The custom domain configured is missing an A record or a CNAME record. Y'all may have deleted the DNS record after yous've enabled the mapping in your app. Check if the DNS records are properly configured using an online DNS lookup tool.
- The browser client has buried the former IP address of your domain. Articulate the enshroud, and test DNS resolution once more. On a Windows automobile, you clear the cache with
ipconfig /flushdns
.
(Optional) Automate with scripts
You tin automate management of custom domains with scripts by using the Azure CLI or Azure PowerShell.
- Azure CLI
- PowerShell
The following command adds a configured custom DNS name to an App Service app.
az webapp config hostname add \ --webapp-name <app-proper noun> \ --resource-group <resource_group_name> \ --hostname <fully_qualified_domain_name>
For more data, see Map a custom domain to a spider web app.
Side by side steps
Feedback
Submit and view feedback for
How To Add A Domain To App Service In Azure,
Source: https://docs.microsoft.com/en-us/azure/app-service/app-service-web-tutorial-custom-domain
Posted by: royacquaid.blogspot.com
0 Response to "How To Add A Domain To App Service In Azure"
Post a Comment