1. Home
  2. Training Library
  3. Microsoft Azure
  4. Courses
  5. Configuring Networking in Azure App Service

Custom Domains

Custom Domains
Overview
Difficulty
Intermediate
Duration
13m
Students
507
Ratings
4.9/5
starstarstarstarstar-half
Description

In this course, we’ll cover the most commonly used networking configurations in Azure App Service, including how to create a custom domain name for your app, how to enable TLS/SSL, and different ways of controlling inbound and outbound connections to and from your app.

Learning Objectives

  • Create a custom domain name for your Azure App Service app
  • Enable TLS/SSL so people can reach your Azure App Service app using HTTPS
  • Control inbound and outbound connections to and from your Azure App Service app

Intended Audience

  • Anyone who needs to configure networking on Azure App Service

Prerequisites



Transcript

One of the most common things you’ll need to do when you create an app using Azure App Service is to set it up with a custom domain name. That’s because, by default, an App Service app has a URL that ends with the “.azurewebsites.net” domain, which probably isn’t what you want for a commercial website. For example, if you have an app that should be hosted at a site called contoso.com, then you’ll need to tell App Service to use that custom domain name. 

Here’s how to do that. First, you need to make sure your App Service Plan is using a paid tier because custom domains are not supported in the free F1 tier.

Next, let’s assume that you’ve already registered your domain name with a domain provider and that you can edit the DNS records for your domain. This isn’t a DNS course, so I’m not going to go into detail about how DNS works. I’ll just explain what you need to do to set up a custom domain for an App Service app. If you’re not familiar with DNS, then it would be a good idea to learn more about it before you make changes to your DNS records.

Okay, now go into the Custom Domain settings for your app in App Service and find the Custom Domain Verification ID. This is something that you’ll add to your domain records to prove to Microsoft that you own the domain. Copy the verification ID and paste it into a text editor. You’ll also need to copy the IP address of your app and the existing URL of the app from the Custom Domains page. The existing URL will end in “.azurewebsites.net”. Paste both of these values into a text editor as well.

Now go to your domain provider’s website and open your DNS records. If you’re going to use a root domain, such as contoso.com, for your app, then create an A record. If you’re going to use a subdomain, such as www.contoso.com, then create a CNAME record. You’ll often want to do both.

In the A record, set the name to ‘@’ (which means the root domain), and set the value to the IP address of your app. In the CNAME record, set the name to the subdomain, such as www, and set the value to the existing URL of your app.

Now to prove to Microsoft that you own this domain and its subdomain, you need to create a TXT record for each of them. A TXT record is just an informational record that doesn’t affect the resolution of your domain name. For the root domain, set the name to asuid, which I’m assuming stands for “App Service Unique Identifier”, and set the value to the Custom Domain Verification ID that you copied from App Service. For the subdomain, set the name to asuid dot and the subdomain, so it would be asuid.www in our example. And set the value to the Custom Domain Verification ID.

 

Now you need to go back to the Custom Domains page for your App Service app and add your custom domain. You just need to put in the name of the domain and the DNS record type, which will be either A or CNAME, depending on whether you’re adding the root domain or a subdomain. Then you click the “Validate” button, and Azure checks for the DNS records that you added. If it works, then your app is now accessible using your custom domain name.

About the Author
Avatar
Guy Hummel
Azure and Google Cloud Content Lead
Students
139411
Courses
82
Learning Paths
113

Guy launched his first training website in 1995 and he's been helping people learn IT technologies ever since. He has been a sysadmin, instructor, sales engineer, IT manager, and entrepreneur. In his most recent venture, he founded and led a cloud-based training infrastructure company that provided virtual labs for some of the largest software vendors in the world. Guy’s passion is making complex technology easy to understand. His activities outside of work have included riding an elephant and skydiving (although not at the same time).