skip to Main Content

I have an app service in which users will be kicked out when I would swap a staging to production slot. This can’t be easily solved because of the outdated architecture. Thinking of a solution, I thought: what if I set the traffic percentage of the staging slot to 100%? Then all new connections will be routed to the new version. Then I could write a process that waits until all connections on the production slot are gone, and then do the swap. This assumes that existing connections on the staging are not touched by the swap, as they are already routed to the IP address of the new version.

Will this approach work? Or is it a waste of time to investigate this?

2

Answers


  1. Chosen as BEST ANSWER

    I came to the conclusion that the approach I described is not going to work. Was this a waste of time to investigate? No, it just takes time to learn and figure things out.


  2. Yes, Your approach is correct you can route all your traffic to the Staging slot by setting the traffic percentage to 100%. Also, If you select Perform swap with preview option. This option warms up the instance before the swap and your swapping happens seamlessly without any drop in the connection. Additionally, While the 100% traffic is routed to staging slot, You can make the process change in the Production slot and while swapping the slots all the settings from your Staging slot will be reflected in the production slot properly.

    Refer here- Set up staging environments – Azure App Service | Microsoft Learn

    Traffic set to 100 %:-

    enter image description here

    As the 100% traffic is set to Staging slot, All the traffic is routed to staging slot.

    All the settings are added while swapping the slot to avoid any issue in the App:-

    enter image description here

    After swapping your settings, all the traffic will be routed to Production Slot seamlessly:-

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search