Map an existing custom DNS name to an App Service
By default, an App Service creates a DNS entry for the name of your App Service resource with the azurewebsites.net domain. For example, examrefaz104.azurewebsites.net. Most organiza- tions prefer to use their own custom domain names for security, brand recognition, ease of use, and more. To add a custom domain to an App Service, navigate to the Custom Domains blade of your App Service resource, as shown in Figure 3-73.
If you or your organization already have a custom domain, click Add Custom Domain. If you do not already own a registered domain name, you can purchase one through a Microsoft partner directly from the Azure portal. For this example, you will focus on adding a domain that has already been purchased.
FIGURE 3-73 App Service Custom Domains
To add an existing domain to an App Service, you first need to verify that you actually own the domain you are trying to add. This security measure prevents other App Services from trying to impersonate your web app.
The Add Custom Domain blade, shown in Figure 3-74, provides these options:
■ Domain Provider Specify whether you purchased the domain through the App Service or through a third party.
■ TLS/SSL Certificate Specify whether to use an App Service Managed Certificate or add a certificate later. We discuss certificates later in this skill.
■ Domain The custom domain you are adding to the App Service.
■ Domain Validation The DNS records required to validate that you own the domain. To complete the domain validation, add the DNS records that are presented to your public DNS records. In the case shown in Figure 3-74, the App Service requires that a CNAME for app1.
hugelab.net points to examrefaz104.azurewebsites.net. Additionally, a TXT record named asuid.app1 requires a specific key string be added for the text value. The type of records you are required to create depends on the domain, but they’re typically CNAME, A, and TXT record types.
After you have added the DNS records, click Validate. The service will check the public DNS to verify you have added the records. If successful, the required rows will show checkmarks, and you will receive a note that it has passed validation, as shown in Figure 3-75.
FIGURE 3-74 Add Custom Domain
FIGURE 3-75 Domain validation
To complete the process, click Add to associate the custom domain with the App Service.
The custom domain will be added to the App Service and will respond when accessing the ser- vice using the new URL. By adding the domain without configuring TLS/SSL, you will receive an error that the domain is not secured and does not have any bindings, as shown in Figure 3-76. This is expected. Certificates for App Service apps are discussed later in this skill.
FIGURE 3-76 Newly added custom domain