An administrator deploys an e-commerce application to an Azure App Service web app named `app-checkout-prod` that runs on a Standard S1 App Service plan. The App Service plan is configured to run on 5 active instances. The application stores shopping cart data in-memory within each instance. During initial user testing, testers notice that their active shopping carts are periodically lost and reset to empty as they navigate between different pages of the website. Which setting under the General settings configuration of the web app must the administrator enable to resolve this issue?
- AAlways On
- Session affinityAnswer
- CWeb sockets
- DA higher pricing tier, by migrating the App Service plan to Premium V3
Answer
Session affinity
The correct option is Session affinity. In a scaled-out Azure App Service hosting an application with local in-memory session state, client requests must consistently route to the same backend instance. Enabling Session affinity (ARR affinity) instructs the Azure front-end load balancer to append an affinity cookie (ARRAffinity) to the response headers, directing subsequent requests from that user to the same instance that established the session.
Step-by-Step Solution
Key Concept
Configuring Session affinity (ARR affinity) for Azure App Services to maintain stateful client sessions across scaled-out instances.
Estimated Time:2m 0s