azureazure-web-app-serviceazure-deployment-slots

Azure WebApp - Slot Traffic % Not Working


I have an Azure webapp (ASP Core MVC) and normally use 2 slots:

I deploy to Staging, test to make sure things are running properly, and swap with Production. No problems except for the 1-2 min downtime during swap.

However, I have a new piece of functionality that I want to test out with a certain % of traffic. So I added a slot called "TestProduction". I deployed the new functionality to that slot and allocated 50% of my traffic to that slot (in Deployment Slots screen).

However, I can't seem to get any traffic to go there. At least traffic from my computer/tablet all seems to go to the regular Production slot. I bumped TestProduction all the way up to 95% and still I'm seeing the Production slot code. Is there something else I'm missing here to test out some traffic to the TestProduction slot?

Thx!


Solution

  • I have tried to repro the same in my lab environment and got positive results after following the below steps.

    Step 1: Create an azure webapp service with two deployment slots.

    enter image description here

    Step 2: Deploy two different codes into the slots.

    Now whenever I tried to access the webpage through the browser, I used to see the code only in the specific slot. The reason is when we accessed the web page for the first time it will store cookies on the browser. Refer to this link for more information.

    enter image description here

    So, to test the slots, open the browser in private mode or incognito mode and enter the URL. You must do this for every new hit.

    enter image description here