2

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.

Janusz Nowak
  • 2,595
  • 1
  • 17
  • 36
Dakota Kincer
  • 448
  • 3
  • 16
  • What have you tried so far? Could you add more detail as to what's not working? – Chris Pietschmann Mar 16 '17 at 13:32
  • Maybe Azure Function Proxies can solve your issue: https://learn.microsoft.com/en-us/azure/azure-functions/functions-proxies#a-namemodify-requestsamodifying-backend-requests – sebastian87 Mar 16 '17 at 14:03
  • @ChrisPietschmann Ive attempted to use Azure Traffic manager to manage 2 App servers. One being a EastUS Azure Functions server and one being a west US function server. When I go to the DNS site on the traffic manager it cant find the azure function end points. – Dakota Kincer Mar 16 '17 at 15:41
  • @sebastian87 Ive been looking at proxies but im not quite sure how to arrange them as East and West so they can manage themselves when I take one down for publishing. – Dakota Kincer Mar 16 '17 at 15:42
  • @sebastian87 but ill take a look at this link. Thank you! – Dakota Kincer Mar 16 '17 at 15:42
  • What App Service Plan is the Azure Function running on (Free, Shared, Basic, Standard or Premium). Or is it on Consumption plan? – Andy T Mar 16 '17 at 15:55
  • @AndrésNava-.NET Consumption – Dakota Kincer Mar 16 '17 at 16:28
  • Just a quick note... if you can get Traffic Manager set up with Functions, it still would not provide "0 downtime while updating [your] Azure Functions" because it takes a little while for Traffic Manager to detect that an endpoint is down and by that time, you would have already published your Function. – Andy T Mar 16 '17 at 19:22

2 Answers2

2

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!

Dakota Kincer
  • 448
  • 3
  • 16
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/

Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90