Question

Difficulty: HardConfigure Azure App Service Web Apps

You plan to map a custom domain to an Azure App Service web app and secure it using a free App Service Managed Certificate. You need to configure this using the Azure CLI.

Which sequence of steps should you perform to map the domain and configure the certificate? Arrange the steps in the correct order.

  1. 1Retrieve the custom domain verification ID of the web app by running the `az webapp show` command.
  2. 2At your DNS registrar, create the required TXT verification record and CNAME record pointing to the default App Service hostname.
  3. 3Add the custom domain hostname to the web app by running the `az webapp config hostname add` command.
  4. 4Create the App Service Managed Certificate for the custom domain by running the `az webapp config ssl create` command.
  5. 5Bind the generated certificate to the custom domain by running the `az webapp config ssl bind` command.

Answer

The correct sequence is: first, retrieve the web app's custom domain verification ID; second, create the TXT and CNAME records at your DNS registrar; third, add the custom domain hostname to the web app; fourth, generate the App Service Managed Certificate; and fifth, bind the certificate to the custom domain using SNI.
To successfully configure a custom domain with an App Service Managed Certificate, you must perform the steps in a strict logical order. First, get the verification ID using `az webapp show`. Second, configure the TXT and CNAME records at your DNS registrar. Third, map the hostname using `az webapp config hostname add`. Fourth, generate the certificate using `az webapp config ssl create`. Finally, bind the certificate to the domain using `az webapp config ssl bind`.

Step-by-Step Solution

1
Retrieve the custom domain verification ID using `az webapp show`.
The `customDomainVerificationId` property is retrieved.
This ID is required to create the TXT validation record at the DNS provider.
2
Create a TXT record (prefixed with `asuid.`) containing the verification ID, and a CNAME record pointing to the default app URL at the DNS registrar.
The DNS records are created and propagate.
Azure queries these records to verify ownership before allowing the custom hostname to be mapped.
3
Add the custom hostname to the web app using `az webapp config hostname add`.
The custom domain mapping is successfully added to the App Service.
You cannot issue an App Service Managed Certificate for a domain that is not mapped to the web app.
4
Generate the managed certificate using `az webapp config ssl create`.
An App Service Managed Certificate is created, and its thumbprint is returned.
The certificate must exist in the App Service environment before it can be bound.
5
Configure the TLS/SSL binding using `az webapp config ssl bind` with the certificate thumbprint.
The custom domain is secured with HTTPS.
This binds the certificate to the custom hostname using SNI SSL.

Key Concept

Azure App Service custom domain and SSL binding configuration requires verifying ownership via DNS records before adding hostnames, and binding the hostname before generating or assigning an App Service Managed Certificate.
Rate this question