Azure Functions are great for tying different systems together. With MSFT’s out of the box triggers and the ability to create your own, their possibilities are almost limitless. However, creating resiliency for them can be a bit difficult as it’s not awesomely documents, nor is there a Geo-Redundancy settings area like in a lot of other Azure offerings.
Functions exist in a region, they don’t exist globally like a Traffic Manager. If a region goes hard down and you don’t have a back up, that function is out of commission and your apps are dead in the water until they come back. As such, it’s a good idea to set up at least one back up in another region. The questions becomes how do you load balance that with automatic failover?
(Note: Running multiple functions can result in race conditions, repeated processing, etc. Make sure you take idempotent operations to heart and really think about what you’re doing.)
A good way to do this is to use a Traffic Manager that will handle automatic failover for you. This post on MSFT’s documentation site does a great job explaining what you should do (I set up mine using a single, geo-redundant storage (GRS) account shared between the functions).
With that done, you can create a Traffic Manager and add your endpoints like you would a regular web app. I suggest turning on HTTP only on your functions (Application features -> SSL) and updating your Traffic Manager to hit the function via HTTPS and port 443 (Configuration).
The last step is to create a custom domain, CNAME it to the Traffic Manager like normal, and install a cert for the domain on the functions (Application features -> Custom domains).