azureazure-container-appsazure-custom-domain

How to add custom domain to multiple internal container apps


The scenario is that I want to set up multiple internal container apps under the same container apps environment. All these apps are in the same VNET.

I understand that to access them, I need to create a private DNS zone to map domains like:

https://test1.apple-1234.northeurope.azurecontainerapps.io/
https://test2.bigapple-5678.northeurope.azurecontainerapps.io/

...to their internal IP addresses.

My question is: how can I set up internal domains for the above apps? For example, I would like to access these two apps using:

http://test1.xyz.abc
http://test2.xyz.abc

P.S. These domains are only used internally and will only be accessed within the VNET.


Solution

  • How to add custom domain to multiple internal container apps

    There is no validation required for your custom domain when adding or attaching a domain in Container Apps. Follow the MS Doc for more details

    enter image description here

    1. Add the custom domain to your container app using the full domain instead of xyz.abc, as shown below
        EX: my app name is  theja-container-app
        Custom domain is : theja-container-app.xyz.abc
    

    Custom domain configuration

    enter image description here

    Note: Make sure to restart the container app after adding the custom domain.

    1. Check the settings below in your application. If they are not as shown, update the settings.

    enter image description here

    1. Create a private DNZ zone with virtual link.

    enter image description here

    1. Create an A record for your application with the static IP of the container app environment in the private DNS zone.

    enter image description here

    Container apps environment static IP

    enter image description here

    1. Add the local host entry on your VM
     10.0.0.159     demo-container-app.mangosea-d4264213.eastus.azurecontainerapps.io
     10.0.0.159     theja-container-app.mangosea-d4264213.eastus.azurecontainerapps.io
    

    Local host entry

    enter image description here

    Result from my VM which has same Vnet as container app

    enter image description here

    enter image description here