Step by step guide to add a custom domain to Azure Container Apps with managed SSL certificate

Azure Container Apps · Custom domain · Managed SSL

Every Azure Container App comes with an auto-generated address that looks like your-app.random-id.region.azurecontainerapps.io. It works, but it is not something you want in an OAuth redirect list, a client demo or an email signature. In this guide we map a friendly subdomain, nw360.whyazure.in, to a Container App and secure it with a free, auto-renewing managed SSL certificate, with no certificate to buy, no PFX file to export and no renewal reminders to set.

CertificateFree, managed by Azure, renews automatically
DNS recordsTwo: one CNAME and one TXT
Waiting timeUp to about 10 minutes for issuance

A note on the screenshots: values that are unique to my environment, such as IP addresses, verification IDs and the app’s generated domain, have been replaced with labels like <YOUR-APP-IP>. Yours will show real values. Click any screenshot to enlarge it, and click again to close it.

What you need before you start

  • A running Container App with HTTP ingress enabled. In the portal, open Networking → Ingress, set the ingress type to HTTP and make sure the app is reachable from the public internet. Azure’s certificate authority has to be able to reach it to issue the certificate.
  • A domain you control, and access to its DNS settings. You will add two records there. Any DNS provider works, although the screens differ slightly from one to the next.
  • Permission to edit the Container App in the Azure portal.

How the pieces fit together

Azure does not simply trust that you own whyazure.in. It hands you two DNS records, you create them at your DNS provider, and Azure checks that they exist before it issues a certificate.

Record 1 · CNAMESends traffic to your appAn alias that points nw360.whyazure.in at the app’s generated domain.
Record 2 · TXTProves you own the domainA record named asuid.nw360 that holds your Custom Domain Verification ID.
Then · AzureIssues and binds the certificateAfter validation, Azure creates the managed certificate and binds it to the domain using SNI SSL.

Here is what the two records look like for this walkthrough. The panel in the portal shows the generic host names www or {subdomain} and asuid.www or asuid.{subdomain}. Substitute your own subdomain, which in my case is nw360.

Type Name / host Value Purpose
CNAME nw360 <your-app>.<unique-id>.<region>.azurecontainerapps.io Routes the subdomain to your Container App
TXT asuid.nw360 Your Custom Domain Verification ID Proves domain ownership

Step-by-step walkthrough

1

Open your Container App in the Azure portal

Search for Container Apps in the portal’s search bar and open the app you want to publish on your own domain. Here we are working with networth360.

Figure 1. The Container Apps list in the Azure portal. Tenant, subscription, resource group and unrelated apps are hidden.
2

Go to Networking → Custom domains

In the left menu, expand Networking and select Custom domains. The blade shows the app’s IP address and its Custom Domain Verification ID, and the list of custom domains is empty (0 items). The IP address is only needed if you map a root domain with an A record. The verification ID goes into the TXT record. Select Add custom domain.

Figure 2. The Custom domains blade, before any domain has been added.
3

Choose a managed certificate and enter your domain

In the Add custom domain and certificate panel, set:

  • TLS/SSL certificate: Managed certificate. The other options are Bring your own certificate and Add certificate later.
  • Domain: your full custom domain, here nw360.whyazure.in.
  • Hostname record type: CNAME for a subdomain. For a root (apex) domain such as example.com, choose the A record option instead.

The Domain validation section then lists the two DNS records Azure expects: a CNAME and a TXT. Keep this panel open, because we will come back to it. Validate will not pass until the records exist.

Figure 3. Managed certificate selected, domain entered, and the CNAME and TXT records Azure wants to see.
4

Create the CNAME record at your DNS provider

Open the DNS management page for whyazure.in and add a new record with these values:

  • Type: CNAME
  • Name: nw360
  • Value: the generated domain copied from the Azure panel
  • TTL: the default is fine, and a shorter TTL simply helps changes show up sooner
Figure 4. Adding the CNAME record. Use the copy icon in Azure to avoid typos in the value.

Save it, and the record appears in the DNS table:

Figure 5. The CNAME record after saving.
Tip: enter only the subdomain partMost DNS providers add your root domain automatically. Type nw360, not nw360.whyazure.in, or you may end up with a record for nw360.whyazure.in.whyazure.in.
5

Create the TXT verification record

Add a second record:

  • Type: TXT
  • Name: asuid.nw360
  • Value: the Custom Domain Verification ID from Azure
Figure 6. The TXT record that proves you own the domain.
6

Validate, then add the domain

Return to the Azure panel and select Validate. When both records are found, each row gets a green tick and the panel says Validation passed. Select Add to finish up. Select Add.

Figure 7. Both records validated.

Azure now works in the background. Two notifications appear in the portal: one while the hostname is added, and one while the managed certificate is created and the SSL binding is configured.

Portal notification: Adding custom domain, adding hostname nw360.whyazure.in
Figure 8. The hostname is being added.
Portal notification: Create managed certificate and configure SSL binding, status Running
Figure 9. The managed certificate and SSL binding are being created.
Validation failed?DNS changes can take a few minutes to spread. Wait briefly and select Validate again. If it keeps failing, jump to the troubleshooting section.
7

Wait for the certificate to be issued

Back on the Custom domains blade, a banner warns that it might take up to 10 minutes for Managed Certificate to be issued. In the meantime the domain is listed with a red No binding status. That is expected while Azure finishes the certificate and binding task from the previous step, so give it a few minutes and use Refresh.

Figure 10. While the certificate is being issued, the domain shows No binding.
8

Confirm the domain is Secured

Once the certificate is ready, the status turns to a green Secured and the binding type shows SNI SSL. That is your managed certificate, bound to the custom domain.

Figure 11. Status Secured with SNI SSL binding.
9

Browse to your app over HTTPS

Open https://nw360.whyazure.in in a browser. The app now loads on your own domain, served over HTTPS with the certificate Azure created for you.

Figure 12. The app is live on nw360.whyazure.in.
That is the whole setupAzure keeps the certificate renewed for you, as long as the app keeps meeting the requirements listed in the next section.

Troubleshooting

Validation will not pass

  • Check that the names are exactly nw360 and asuid.nw360 (your own subdomain, without the root domain), and that the values were pasted without extra spaces or quotes.
  • Give DNS a few minutes, then confirm what the world can see from your own machine:
# CNAME should return the app's generated domain
nslookup -type=CNAME nw360.whyazure.in
# TXT should return your verification ID
nslookup -type=TXT asuid.nw360.whyazure.in

The certificate is not issued, or renewal fails

Microsoft’s documentation lists the requirements that must stay true for as long as the managed certificate is in use:

  • The CNAME must point directly at the app’s generated domain. Mapping through an intermediate CNAME, such as a proxy or a traffic manager in front, blocks issuance and renewal.
  • HTTP ingress must be enabled and the app must be publicly reachable.
  • The app must be running. If it is stopped, the validation request times out.
  • If your root domain has a CAA record, add one that allows the certificate authority: 0 issue digicert.com.

Once the requirement is fixed, you can resubmit the managed certificate configuration to trigger a fresh attempt.

I want to use a root domain, not a subdomain

Choose the A record option as the hostname record type, create an A record at @ pointing to the IP address shown on the Custom domains blade, and add the TXT record with the host name asuid. Everything else in this guide stays the same.

Prefer the command line?

The same result is possible with the Azure CLI. Create the DNS records first, then run:

# 1) Register the hostname on the container app
az containerapp hostname add \
  --resource-group <resource-group> \
  --name <app-name> \
  --hostname nw360.whyazure.in
# 2) Create the managed certificate and bind it
az containerapp hostname bind \
  --resource-group <resource-group> \
  --name <app-name> \
  --hostname nw360.whyazure.in \
  --environment <environment-name> \
  --validation-method CNAME

For a root domain with an A record, use --validation-method HTTP instead.

Wrap-up

Key takeaways

  • A custom domain on Azure Container Apps needs two DNS records: a CNAME that routes traffic, and an asuid TXT record that proves ownership.
  • Choose Managed certificate and Azure issues, binds and renews the SSL certificate for you at no extra cost.
  • Point the CNAME straight at the app’s generated domain, keep ingress public and keep the app running, or issuance and renewal will fail.
  • Expect a few minutes of No binding before the status flips to Secured.

Further reading: Custom domain names and free managed certificates in Azure Container Apps on Microsoft Learn.

0.00 avg. rating (0% score) - 0 votes
Tags:

Add a Comment

Your email address will not be published. Required fields are marked *