Recently I was attempting to code up some Blue/Green deployments of some Azure Functions, and place them behind a Traffic manager. This all worked well for the hostname provided on the Traffic Manager, but not when setting up a custom domain.
The way a traffic manager works is a DNS forwarder, so when setting up DNS for a custom domain you need set up a CNAME for your custom domain to the hostname of the traffic manager, but there is no custom domain set up on the Traffic Manager itself. As it just works as a DNS, you need to set up the custom domain on the Web App.
When I had built this functionality into the build pipeline, I found it would only work once and then I would get the message “Hostname conflicts with an already existing hostname”
I spent way too long thinking it was a configuration problem that I had, where the issue was that a custom domain is only allowed on one resource per Azure Region.
So, in a single region (say, Australia East), I have a WebApp with the custom domain api.carbonpapersales.com, I cannot create another WebApp with the same domain. I can on another region (say, Australia SouthEast) and have the traffic manager point to both, which is great for geolocated websites.
This cleared a lot up for me, but it completely removed the ability to use a traffic manager for Blue/Green deployments. If I cannot setup the new Function App with the custom hostname and SSL bindings before removing the old one, then there will be downtime. Looks like I’ll be using Azure Front Door.