Create custom domain names
When you create a web app, Azure assigns the app to a subdomain of azurewebsites.net
. Suppose your web app is named contoso
. Azure creates a URL for your web app as contoso.azurewebsites.net
. Azure also assigns a virtual IP address for your app. For a production web app, you might want users to see a custom domain name.
How to add and secure a custom domain on your App Service web app
Steps to configure a custom domain name for your app
There are three steps to create a custom domain name. The following steps outline how to create a domain name in the Azure portal.
Important
To map a custom DNS name to your app, you need a paid tier of an App Service plan for your app.
Reserve your domain name. The easiest way to set up a custom domain is to buy one directly in the Azure portal. (This name isn't the Azure assigned name of
\*.azurewebsites.net
.) The registration process enables you to manage your web app's domain name directly in the Azure portal instead of going to a third-party site. Configuring the domain name in your web app is also a simple process in the Azure portal.Create DNS records to map the domain to your Azure web app. The Domain Name System (DNS) uses data records to map domain names to IP addresses. There are several types of DNS records.
For web apps, you create either an
A
(Address) record or aCNAME
(Canonical Name) record.- An
A
record maps a domain name to an IP address. - A
CNAME
record maps a domain name to another domain name. DNS uses the second name to look up the address. Users still see the first domain name in their browser. As an example, you could mapcontoso.com
to yourwebapp.azurewebsites.net
URL.
- An
If the IP address changes, a
CNAME
entry is still valid, whereas anA
record must be updated.Some domain registrars don't allow
CNAME
records for the root domain or for wildcard domains. In such cases, you must use anA
record.
Enable the custom domain. After you have your domain and create your DNS record, use the Azure portal to validate your custom domain and add it to your web app. Be sure to test your domain before publishing.