Microsoft Certified: Azure Developer Associate (AZ-204)Develop Azure compute solutionsMedium

A development team is deploying a new web application to Azure App Service. The application utilizes WebSockets for real-time communication and requires session affinity to maintain consistent connections between clients and the correct backend instance. Which Azure App Service configuration should be enabled to meet these requirements?

  1. AClient Certificate Mode
  2. BAlways On
  3. CARR Affinity
  4. DHTTP/2
Show answer & explanation

Correct answer: C. ARR Affinity

ARR Affinity (Application Request Routing Affinity) ensures that subsequent requests from the same client are routed to the same backend instance. This is crucial for applications using WebSockets or other stateful connections where session consistency is required.

Why the other options are wrong

  • A. Client Certificate Mode is used for mutual TLS authentication, not for maintaining session state across instances.
  • B. Always On keeps the app loaded and ready to respond, but doesn't manage session affinity.
  • D. HTTP/2 is a protocol version for web communication, not directly related to session affinity.

ARR Affinity

ARR Affinity, also known as session affinity or sticky sessions, is an Azure App Service feature that ensures all requests from a specific client are routed to the same backend instance of your web application.

  • Crucial for stateful applications (e.g., WebSockets, session data).
  • Maintains consistent connections between client and instance.
  • Can impact load balancing fairness if not managed carefully.

Memory trick: Always Route Requests to the Right Server.

More Develop Azure compute solutions questions