This article applies to: ✅ Standard consumption and dedicated (Preview) ❎ Basic/Standard ❎ Enterprise
This article shows you how to map a custom web site domain, such as https://www.contoso.com, to your app in Azure Spring Apps. This mapping is accomplished by using a CNAME record that the Domain Name Service (DNS) uses to store node names throughout the network.
The mapping secures the custom domain with a certificate and enforces Transport Layer Security (TLS), also known as the Secure Sockets Layer (SSL).
Prerequisites
An Azure subscription. If you don't have a subscription, create a free account before you begin.
An Azure Spring Apps Standard consumption and dedicated plan service instance.
A Spring app deployed to Azure Spring Apps.
A domain name registered in the DNS registry as provided by a web hosting or domain provider.
A certificate resource created under an Azure Container Apps environment. For more information, see Add certificate in Container App.
Map a custom domain
To map the custom domain, you create the CNAME record and then use the Azure CLI to bind the domain to an app in Azure Spring Apps.
First, use the following steps to create the CNAME record:
Contact your DNS provider to request a CNAME record to map your domain to the Full Qualified Domain Name (FQDN) of your Spring app.
Add a TXT record with the name asuid.{subdomain} with the value being the verification ID of your Azure Container Apps environment. You can obtain this value by using the following command.
az containerapp env show \
--resource-group <resource-group-name> \
--name <Azure-Container-Apps-environment-name> \
--query 'properties.customDomainConfiguration.customDomainVerificationId'
After you add the CNAME and TXT record, the DNS records page will resemble the following table.
Next, bind the custom domain to your app by using the following command.
az spring app custom-domain bind \
--resource-group <resource-group-name> \
--service <Azure-Spring-Apps-service-instance-name> \
--app <app-name> \
--domain-name <your-custom-domain-name> \
--certificate <name-of-your-certificate-under-Azure-Container-Apps-environment>
Clean up resources
Be sure to delete the resources you created in this article when you no longer need them. To delete the resources, just delete the resource group that contains them. You can delete the resource group using the Azure portal. Alternatively, to delete the resource group by using Azure CLI, use the following commands:
echo "Enter the Resource Group name:" &&
read resourceGroupName &&
az group delete --name $resourceGroupName &&
echo "Press [ENTER] to continue ..."
This module provides instruction on how to add a custom domain to your Microsoft 365 deployment. It also examines the DNS requirements that are necessary to support a new domain.
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.