1

Is there a clean way of diverting a portion of production traffic to a slot in function apps? Something similar to how app services do? I have read some things about using another function app and the proxies but I would like to do something like canary deployments such as:

  1. deploy to stage slot
  2. run whatever tests
  3. divert 1% of traffic to stage slot and monitor for metrics
  4. repeat step 3 but increase traffic in increments 10%, 25%, 50%, 75%, 100%
  5. If at any point a gate is hit (some metric is reached), roll back to 0% sent to the slot

I can think of a way to do this in code with a function app and some randomness but does Azure have anything built in for this and function apps?

MrRobot
  • 72
  • 1
  • 5

1 Answers1

2

I believe the only way is to keep two separate function apps and use Azure Traffic manager with a Weighted traffic-routing method in front of them and as the entry point for your functions:

https://learn.microsoft.com/en-us/azure/traffic-manager/traffic-manager-routing-methods#weighted

Thiago Custodio
  • 17,332
  • 6
  • 45
  • 90
  • hmm, this is interesting and possibly could do it. Do you know the best way to set the weights for those percentages I laid out? Let's say like 1%. Would that be current prod = 1000 and new deploy = 1 and then slowly increase new deploy to 1000 and decrease prod to 1? – MrRobot Apr 10 '20 at 14:25
  • no, unfortunately I don't have internal details about how it works (besides what is on the link I've shared) – Thiago Custodio Apr 10 '20 at 14:35
  • oh well, I think this is actually the most promising solution after having a look so thank you! – MrRobot Apr 10 '20 at 14:50
  • 1
    I also found this article that is pretty useful for this if anyone stumbles across this at some point https://azure.microsoft.com/en-us/blog/blue-green-deployments-using-azure-traffic-manager/ – MrRobot Apr 10 '20 at 14:50