Azure Container App With External DNS

This is a practical guid to adding extenal DNS, so not hosted with Azure DNS to Azure Container App DNS Records.

The DNS I was working with was hosted in GoDaddy but these steps can be applied to and DNS being added to the Azure Container App.

Disclaimer: The Azure portal will change over time, so these steps will naturally drift, always look at the Azure docs for adding custom domains to Container Apps when making changes.

www Domain

We do this in Azure and Go Daddy

  1. Open Container App -> Networking -> Custom domains -> Add custom domain
  2. For TLS/SSL certificate select Managed certificate
  3. For Domain provide www.resolv.it.com
  4. For Hostname record type select CNAME
  5. Copy the validation records and add to GoDaddy
Type Name Data
CNAME www resolv-prod.purplecliff-931c2413.southafricanorth.azurecontainerapps.io
TXT asuid.www 692A7012249CBF6B1A0412D2D2A1DB24908567120EFB668DD1D720979C6A4C5E
  1. Once added click Validate and when all green, click Add
  2. Click Add binding, if certifcates are avalible, click -> To add a certificate, go to the Container Apps Environment
  3. Now under Azure -> Container Apps Environment -> Settings -> Certificates there should be a pending www.resolv.it.com certificate, chill for a few minutes and refresh the page until it goes green Succeeded.
  4. Head back to Container App -> Networking -> Custom domains, the domain should show as green Secured

Apex Domain

I could not get the redirects in GoDaddy to work so did the redirect in my own application.

We do this in Azure and Go Daddy

  1. Open Container App -> Networking -> Custom domains -> Add custom domain
  2. For TLS/SSL certificate select Managed certificate
  3. For Domain provide resolv.it.com
  4. For Hostname record type select A record
  5. Copy the validation records and add to GoDaddy
Type Name Data
A @ 20.164.86.119
TXT asuid 692A7012249CBF6B1A0412D2D2A1DB24908567120EFB668DD1D720979C6A4C5E
  1. Once added click Validate and when all green, click Add
  2. Click Add binding, if certifcates are avalible, click -> To add a certificate, go to the Container Apps Environment
  3. Now under Azure -> Container Apps Environment -> Settings -> Certificates there should be a pending resolv.it.com certificate, chill for a few minutes and refresh the page until it goes green Succeeded.
  4. Head back to Container App -> Networking -> Custom domains, the domain should show as green Secured

Sometimes the binding doesnt automagically add after the cert is validated. So under the Container App -> Networking -> Custom domains -> Add binding -> select the new cert -> Add. The domain should show as green Secured.

301 redirect

Now in my application I checked for the Apex domain and did a manual 301 redirect to the www domain. So https://resolv.it.com/ -> https://www.resolv.it.com/. If we dont do this search engines will see the websites as a copy and this hurts SEO. Its also a better experience for the user.