I can successfully add a custom domain on external container app environments. But when I try the same on an app in an internal container app environment, the validation process just hangs (More than 12 hours now). I have confirmed that the requisite DNS records have been added correctly. This is where it gets stuck:
The docs state that if you are using a free managed cert, then your container app environment has to be publicly accessible. I'm bringing my own cert which does not seem to have any such requirement.
Is it possible to add a custom domain to an internal Azure Container App environment?
It turns out there is additional configuration required for internal environments:
If you are using an internal Container Apps environment, there is no validation for the DNS binding, as the cluster can only be accessed from within the virtual network. Additionally, create a private DNS zone that resolves the apex domain to the static IP address of the Container Apps environment. You can use Azure Private DNS or your own DNS server. If you use Azure Private DNS, create a Private DNS Zone named as the apex domain, with an A record that points to the static IP address of the Container Apps environment.
Note that even after doing this I still could not validate ownership through the portal. So I used the cli to add the domain:
az containerapp hostname add --hostname <custom domain> -n <container app name> -g <resource group>
This adds the domain but you still have to bind a cert to it, which I was able to do through the portal. Just choose "Custom Domains" from your container app and click "bind" on the domain you just added.