Buy a custom domain name for Azure App Service
App Service domains are custom domains that are managed directly in Azure. They make it easy to manage custom domains for Azure App Service. This tutorial shows you how to buy an App Service domain and assign DNS names to Azure App Service.
For Azure VM or Azure Storage, see Assign App Service domain to Azure VM or Azure Storage. For Cloud Services, see Configuring a custom domain name for an Azure cloud service.
Prerequisites
To complete this tutorial:
- Create an App Service app, or use an app that you created for another tutorial. The app should be in an Azure Public region. At this time, Azure National Clouds are not supported.
- Remove the spending limit on your subscription. You cannot buy App Service domains with free subscription credits.
Buy an App Service domain
For pricing information on App Service domains, visit the App Service Pricing page and scroll down to App Service Domain.
Open the Azure portal and sign in with your Azure account.
In the search bar, search for and select App Service Domains.
In the App Service Domains view, click Add.
Select Click to try the newer version of the App Service Domains create experience.
Basics tab
In the Basics tab, configure the settings using the following table:
Setting Description Subscription The subscription to use to buy the domain. Resource Group The resource group to put the domain in. For example, the resource group your app is in. Domain Type the domain you want. For example, contoso.com. If the domain you want is not available, you can select from a list of suggestions of available domains, or try a different domain. Note
The following top-level domains are supported by App Service domains: com, net, co.uk, org, nl, in, biz, org.uk, and co.in.
When finished, click Next: Contact information.
Contact information tab
Supply your information as required by ICANN for the domain registration.
It is important that you fill out all required fields with as much accuracy as possible. Incorrect data for contact information can result in failure to buy the domain.
When finished, click Next: Advanced.
Advanced tab
In the Advanced tab, configure the optional settings:
Setting Description Auto renewal Enabled by default. Your App Service domain is registered to you at one-year increments. Auto renewal makes sure that your domain registration doesn't expire and that you retain ownership of the domain. Your Azure subscription is automatically charged the yearly domain registration fee at the time of renewal. To opt out, select Disable. If auto-renewal is disabled, you can renew it manually. Privacy protection Enabled by default. Privacy protection hides your domain registration contact information from the WHOIS database. Privacy protection is already included in the yearly domain registration fee. To opt out, select Disable. When finished, click Next: Tags.
Finish
In the Tags tab, set the tags you want for your App Service domain. Tagging is not required for using App Service domains, but is a feature in Azure that helps you manage your resources.
Click Next: Review + create.
In the Review + create tab, review your domain order. When finished, click Create.
Note
App Service Domains use GoDaddy for domain registration and Azure DNS to host the domains. In addition to the yearly domain registration fee, usage charges for Azure DNS apply. For information, see Azure DNS Pricing.
When the domain registration is complete, you see a Go to resource button. Select it to see it's management page.
You're now ready to assign an App Service app to this custom domain.
Prepare the app
To map a custom DNS name to a web app, the web app's App Service plan must be a paid tier (Shared, Basic, Standard, Premium, or Consumption for Azure Functions). In this step, you make sure that the App Service app is in the supported pricing tier.
Note
App Service Free and Shared (preview) hosting plans are base tiers that run on the same Azure virtual machines as other App Service apps. Some apps might belong to other customers. These tiers are intended to be used only for development and testing purposes.
Navigate to the app in the Azure portal
From the top search bar, search for and select App Services.
Select the name of the app.
You see the management page of the App Service app.
Check the pricing tier
In the left navigation of the app page, scroll to the Settings section and select Scale up (App Service plan).
The app's current tier is highlighted by a blue border. Check to make sure that the app is not in the F1 tier. Custom DNS is not supported in the F1 tier.
If the App Service plan is not in the F1 tier, close the Scale up page and skip to Buy the domain.
Scale up the App Service plan
Select any of the non-free tiers (D1, B1, B2, B3, or any tier in the Production category). For additional options, click See additional options.
Click Apply.
When you see the following notification, the scale operation is complete.
Map App Service domain to your app
It's easy to map a hostname in your App Service domain to an App Service app, as long as it's in the same subscription. You map the App Service domain or any of its subdomain directly in your app, and Azure creates the necessary DNS records for you.
Note
If the domain and the app are in different subscriptions, you map the App Service domain to the app just like mapping an externally purchased domain. In this case, Azure DNS is the external domain provider, and you need to add the required DNS records manually.
Map the domain
In the left navigation of the app page, scroll to the Settings section and select Custom domains.
Select Add custom domain.
Type the App Service domain (such as contoso.com) or a subdomain (such as www.contoso.com) and click Validate.
Note
If you made a typo in the App Service domain name, a verification error appears at the bottom of the page to tell you that you're missing some DNS records. You don't need to add these records manually for an App Service domain. Just make sure that you type the domain name correctly and click Validate again.
Accept the Hostname record type and click 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.
Note
A Not Secure label for your custom domain means that it's not yet bound to a TLS/SSL certificate. Any HTTPS request from a browser to your custom domain will receive an error or warning, depending on the browser. To add a TLS binding, see Secure a custom DNS name with a TLS/SSL binding in Azure App Service.
Test the custom domain
To test the custom domain, navigate to it in the browser.
Renew the domain
The App Service domain you bought is valid for one year from the time of purchase. By default, the domain is configured to renew automatically by charging your payment method for the next year. You can manually renew your domain name.
If you want to turn off automatic renewal, or if you want to manually renew your domain, follow the steps here.
In the search bar, search for and select App Service Domains.
In the App Service Domains section, select the domain you want to configure.
From the left navigation of the domain, select Domain renewal. To stop renewing your domain automatically, select Off. The setting takes effect immediately.
Note
When navigating away from the page, disregard the "Your unsaved edits will be discarded" error by clicking OK.
To manually renew your domain, select Renew domain. However, this button is not active until 90 days before the domain's expiration.
If your domain renewal is successful, you receive an email notification within 24 hours.
When domain expires
Azure deals with expiring or expired App Service domains as follows:
- If automatic renewal is disabled: 90 days before domain expiration, a renewal notification email is sent to you and the Renew domain button is activated in the portal.
- If automatic renewal is enabled: On the day after your domain expiration date, Azure attempts to bill you for the domain name renewal.
- If an error occurs during automatic renewal (for example, your card on file is expired), or if automatic renewal is disabled and you allow the domain to expire, Azure notifies you of the domain expiration and parks your domain name. You can manually renew your domain.
- On the 4th and 12th days day after expiration, Azure sends you additional notification emails. You can manually renew your domain. On the 5th day after expiration, DNS resolution stops for the expired domain.
- On the 19th day after expiration, your domain remains on hold but becomes subject to a redemption fee. You can call customer support to renew your domain name, subject to any applicable renewal and redemption fees.
- On the 25th day after expiration, Azure puts your domain up for auction with a domain name industry auction service. You can call customer support to renew your domain name, subject to any applicable renewal and redemption fees.
- On the 30th day after expiration, you're no longer able to redeem your domain.
Manage custom DNS records
In Azure, DNS records for an App Service Domain are managed using Azure DNS. You can add, remove, and update DNS records, just like for an externally purchased domain. To manage custom DNS records:
In the search bar, search for and select App Service Domains.
In the App Service Domains section, select the domain you want to configure.
From the Overview page, select Manage DNS records.
For information on how to edit DNS records, see How to manage DNS Zones in the Azure portal.
Cancel purchase (delete domain)
After you purchase the App Service Domain, you have five days to cancel your purchase for a full refund. After five days, you can delete the App Service Domain, but cannot receive a refund.
In the search bar, search for and select App Service Domains.
In the App Service Domains section, select the domain you want to configure.
In the domain's left navigation, select Hostname bindings. The hostname bindings from all Azure services are listed here.
Delete each hostname binding by selecting ... > Delete. After all the bindings are deleted, select Save.
In the domain's left navigation, select Overview.
If the cancellation period on the purchased domain has not elapsed, select Cancel purchase. Otherwise, you see a Delete button instead. To delete the domain without a refund, select Delete.
Confirm the operation by selecting Yes.
After the operation is complete, the domain is released from your subscription and available for anyone to purchase again.
Direct default URL to a custom directory
By default, App Service directs web requests to the root directory of your app code. To direct them to a subdirectory, such as public
, see Redirect to a custom directory.
Next steps
Learn how to bind a custom TLS/SSL certificate to App Service.