question

ClaudioVallesi-7574 avatar image
0 Votes"
ClaudioVallesi-7574 asked ClaudioVallesi-7574 commented

Azure App Service - ARR Affinity with Horizontal Autoscaling

Hello, some context here:

We are in the process of deploying an Isolated App Service and over the weekend run a pre-production deployment to see if everything was working as intended.
During this process some of our team tried to go through the web application workflows and found that we had issues with the sessions not sticking to the initial server assigned.

I initially checked online and found this question: https://docs.microsoft.com/en-us/answers/questions/39015/azure-app-service-arr-affinity-auto-scaling-statef.html
The app is unfortunately stateful but during the time we tested, there was no scale up/down for it. The default instances set to 3 were running at all times.
In the settings, we had enabled the ARR of course but apparently it was being ignored.

175009-image.png

The instances were scaled down by manually changing the autoscaler to simply keep it to 1 instance at all times, but it was only done as a temporary resolution, after realizing the issue with the sessions affinity not being followed, to be able to access the web app and conduct some additional tests.

Can someone clarify how this could have happened. Perhaps there is there a non-documented logic that makes the ARR being ignored in some cases?
Was there any outage that might have compromised parts of the service? Even checking the logs for the App Service and Autoscaler, nothing of note can be found, which is why we are a bit confused.


azure-webappsazure-webapps-scaling
image.png (21.3 KiB)
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for asking question! If I have understood right, you have a stateful app and your ARR affinity is enabled and it’s not working and you want to understand on scaling out and ARR affinity relation.

To elaborate on this, when you use single instance/ Single App Service the user will try to access your website and it will directly hit the App Service but once you scale out, a Load Balancer is added in front of your azure web app that will distribute the traffic between the many instances your website has.

And if you have stateful app and ARR affinity is enabled then this assigns a cookie to the user which ensure the same instance will be used until the session has expired.

To troubleshoot this could you please go to your App Service, and under development tools click on Advanced Tools and then select your instance and check for information under system info and look for Machine name and Instance id. And after determining the Machine name of the instance, try to restart a single instance by following the steps below:

On your App Service, click at Diagnose and solve problems , at the Search field type restart , then click Advanced Application Restart.

Check this detailed blog Azure Web App Scale Out and ARR Affinity might be helpful.

Let us know if issue remains.


0 Votes 0 ·

Thank you for this response. I'll deploy a test environment that replicate this configuration and update once I've some results. Cheers

0 Votes 0 ·

@ClaudioVallesi-7574

Just checking up to see if you have you have any update on this. If you have any further query do let us know.

0 Votes 0 ·

Hey, thanks for following up. I was just setting up a project yesterday using the same terraform config files and a test project written in the same language (C#) to test this. Unfortunately it's a low priority (workaround using redis cache) so I can only work on this between higher priority issues, but I'm still on it :)

0 Votes 0 ·

0 Answers