Azure Functions Traffic Manager

2019-02-11 03:51发布

问题:

I'm trying to set up some sort of traffic managing so I can have zero downtime while updating my Azure functions. I'd like to have a West US and a East US that I can divert traffic while I publish. I can't seem to get it to work with Azure functions.

回答1:

So the answer I arrived to after Traffic manager didntsupport Azure functions was to overall build 3 Azure functions. I built an East and a West that has my azure function code on it. Then I built a main Azure Function that has 0 code. It only has Azure proxies on it that route to my 2 other Azure Functions. The route is controlled by a variable in the proxy string that is help in the main API app settings. Using %myvariable% you can set part of the url. When I need to publish I switch the variable to the secondary URL location. Update the Primary and then switch the URL to its original primary location. This will have to work for now till traffic manager is integrated into functions or a better solution arises. Hopes this helps anyone else that was stuck!



回答2:

Although it's not with Azure Traffic Manager, you can solve you problem using Azure Functions Proxy. All you need to do is implement a kind of flag to check if the function is available or not, before route the traffic to that.

http://www.c-sharpcorner.com/article/reverse-proxy-using-azure-functions-proxies/