Session Persistence for Always On AG Listener on Azure ILB
Short answer
B Session persistence must be None, not Client IP, on the internal load balancer rule acting as the Always On availability group listener.
Question
the solution satisfies the requirements.
Your company has a Microsoft SQL Server Always On availability group configured on their Azure virtual machines (VMs).
You need to configure an Azure internal load balancer as a listener for the availability group.
Solution: You set Session persistence to Client IP.
Does the solution meet the goal?
Key Takeaways
The question tests the exact Azure Load Balancer rule settings for an Always On AG listener; the trap is assuming Client IP affinity helps, when the AG design requires affinity disabled so traffic follows listener ownership.
For a SQL Server Always On availability group listener on an Azure internal load balancer, the load-balancing rule must use Session persistence set to None, alongside a TCP 1433 rule with Floating IP (direct server return) enabled and a health probe on the listener. Setting Session persistence to Client IP does not satisfy the requirement, so the correct verdict is No (B).
Common mistake: Most learners answer A (Yes), reasoning that Client IP affinity keeps SQL clients consistently connected to one replica — but that pins clients to a backend that may no longer own the AG listener after a failover.
Expert Analysis
Why the Answer Is Correct
In the documented Azure internal load balancer setup for a SQL Server Always On availability group listener, the load-balancing rule is created on TCP 1433 with Floating IP (direct server return) Enabled, a health probe against the listener, and Session persistence set to None. Because only one replica owns the availability group listener resource at any moment, routing must be decided per connection by the probe and direct server return rather than by a sticky client-to-backend mapping. Client IP persistence would keep a client bound to a backend that has lost ownership of the listener after failover, so its connections would fail or hang until the affinity entry expired or the probe removed the node. The proposed solution therefore does not satisfy the goal, making B (No) the correct verdict.Why the Other Options Are Wrong
Option A (Yes) applies generic load balancer reasoning — that affinity guarantees consistent routing — to a scenario where AG listener ownership, not client stickiness, must drive traffic. With direct server return enabled, packets are rewritten with the backend address, and it is the health probe plus listener ownership that determine the live target, so Client IP affinity adds no benefit and introduces failover risk. Even the community answer arguing "Client IP and protocol" is required is off-target: the documented requirement for the AG listener ILB rule is persistence of None, not a stronger form of affinity. Selecting A would therefore fail the stated requirement of a properly functioning AG listener.Community Comment Notes
Several learners reached B for the right reason: as pankyhun wrote, "Answer is B. Session persistence should be set to \"None\"", and gills likewise stated "Session persistence should be none." Timock added useful rule detail, noting that Floating IP (direct server return) is enabled because only one of the two SQL Server instances owns the listener at a time, with TCP 1433 as the SQL port. On the opposing side, Charumathi and 7bc6163 answered Yes based on generic session-consistency arguments, though dilipsun questioned those as AI-generated replies. Flo42's ChatGPT-derived answer reached No but for the wrong justification, recommending "Client IP and protocol" instead of None, so the conclusion should not be copied from that comment.Official Reference
- https://learn.microsoft.com/en-us/azure/load-balancer/load-balancer-configure-session-affinity
- https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/availability-group-configure-tutorial
These links open the official vendor documentation in a new tab.
Exam Strategy
When a case-study style Azure Load Balancer question names a specific setting value, verify it against the exact documented configuration for that workload — for Always On AG listeners the rule is TCP 1433, Floating IP enabled, health probe on the listener, and Session persistence None. Generic 'affinity keeps clients consistent' reasoning is a trap here because failover changes which node owns the listener.
Frequently Asked Questions
Why is Session persistence set to Client IP wrong for an AG listener?
What are the correct Azure ILB settings for a SQL Always On listener?
Discussion 35 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 30 of 35
-
J511 👍 49Answer is B. "None" FYI: Session persistence ensures that a client will remain connected to the same server throughout a session or period of time. Because load balancing may, by default, send users to unique servers each time they connect, this can mean that complicated or repeated requests are slowed down.
-
Timock 👍 15The load balancing rules configure how the load balancer routes traffic to the SQL Server instances. For this load balancer, you enable direct server return because only one of the two SQL Server instances owns the availability group listener resource at a time. Therefore Floating IP (direct server return) is Enabled. TCP 1433 is the standard SQL port. The availability group listener health probe port has to be different from the cluster core IP address health probe port. The ports on a health probe are TCP59999 and TCP58888. https://docs.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/availability-group-load-balancer-portal-configure
-
awssecuritynewbie 👍 8that defeats the purpose of a load balancer that is allowing traffic to various different SQL servers.
-
pankyhun 👍 7Answer is B. Session persistence should be set to "None"
-
edengoforit 👍 6Before you create virtual machines, you need to create availability sets. Availability sets reduce the downtime for planned or unplanned maintenance events. An Azure availability set is a logical group of resources that Azure places on physical fault domains and update domains. A fault domain ensures that the members of the availability set have separate power and network resources. An update domain ensures that members of the availability set aren't brought down for maintenance at the same time.
Show 25 more comments
-
7bc6163 👍 4 Answered ATo configure an Azure internal load balancer (ILB) as a listener for a SQL Server Always On availability group, Session persistence must be set to Client IP. This ensures that the traffic from a specific client is directed consistently to the same backend server during the session. It is a critical requirement for SQL Server Always On listener configurations in Azure, as it helps maintain consistent connectivity for applications interacting with the SQL Server.
-
dilipsun 👍 4Again ChatGpt
-
Flo42 👍 3asked to chatGPT, and the answer is: No, the solution does not meet the goal. For an Azure internal load balancer to properly work as a listener for an SQL Server Always On availability group, you need to set Session persistence to Client IP and protocol, not just Client IP. Setting the session persistence to "Client IP and protocol" ensures that the load balancer can route the traffic correctly based on both the client's IP address and the protocol, which is essential for the proper functioning of SQL Server Always On availability groups.
-
Charumathi 👍 3 Answered AYes, session persistence can be configured in an internal load balancer (ILB) used as a listener for an Availability Group in Azure. This is useful in scenarios where you have a high-availability setup for SQL Server Always On Availability Groups and need to ensure that client connections are consistently routed to the same backend node for session consistency. https://learn.microsoft.com/en-us/azure/load-balancer/distribution-mode-concepts#session-persistence
-
NaoVaz 👍 3 Answered BSession Persistence is to assure specific ways on how the same client\sessions connect to specific Nodes in a Backend Pool of a LoadBalancer: This is not what the question is asking for.
-
gills 👍 3 Answered BSession persistence should be none.
-
Madbo 👍 2The solution meets the goal. When you configure an Azure internal load balancer as a listener for a Microsoft SQL Server Always On availability group, you need to ensure that session persistence is configured correctly. Session persistence ensures that a client's connections are maintained with the same server during the session. In this case, setting the session persistence to Client IP is a valid solution as it ensures that a client's connection is maintained with the same server for the duration of the session based on the client's IP address. Therefore, the solution of setting session persistence to Client IP meets the goal. The answer is A (Yes).
-
thalasi 👍 2 Answered BFor configuring a SQL Server Always On Availability Group Listener behind an Azure Internal Load Balancer (ILB), the required load balancer setting is: Session persistence = None if you set yes Only the primary replica should receive traffic When failover occurs, the ILB must route traffic to the new primary Sticky sessions (Client IP persistence) break failover routing This leads to: Clients being stuck to the old server Connection failures after failover Incorrect listener behavior Therefore, setting persistence to Client IP does NOT meet the goal.
-
havoc2k7 👍 2Ans. is NO, the key word is 'availability group' means we need redundancy of servers, servers must talk with each other which uses health probe not session persistence, this is use for communication between client and server. Correct me if im wrong.
-
Just_Nick 👍 2Read it again carefully, to setup on Client IP, this is wrong! To configure Availability Group you should do it all in the server side not on Client Side.
-
minura 👍 2 Answered BAnswer is B. No Session persistence ensures that a client will remain connected to the same server throughout a session or period of time.
-
santhosh007 👍 2answer is B No. session persistence is not required since data will be same on all db vms, and there is no user affinity
-
suresh0512 👍 2Session Persistence is like pinned connection from a client to Specific Server
-
Quantigo 👍 2Correct Answer: B - No Session persistence should be none
-
RDIO 👍 2 Answered BB is the option here
-
EmnCours 👍 2 Answered BCorrect Answer: B
-
System2214 👍 2 Answered BB es correcto.
-
lokii9980 👍 1A. Yes. The solution mentioned in the scenario is correct. Setting session persistence to Client IP will ensure that all connections from a given client IP address are routed to the same SQL Server instance. This is important for ensuring that the client's session state is maintained, as SQL Server Always On availability groups do not provide session state sharing across multiple replicas. By using the Client IP session persistence mode, the Azure internal load balancer will route all client connections from a specific IP address to the same SQL Server instance. This ensures that the client's session state is maintained and provides a seamless failover experience. Therefore, the solution meets the goal of configuring an Azure internal load balancer as a listener for the SQL Server Always On availability group.
-
70ec7c1 👍 1 Answered BI can see why session persistence seems to be a potential answer, but consider this guys: Session persistence can cause issues if the primary replica fails, as traffic might continue to be routed to an unavailable VM until the session timeout, rather than immediately failing over to the new primary. Microsoft recommends not using Client IP persistence for Always On listeners in Azure, as the availability group listener should dynamically route to the primary replica without sticky sessions. Session persistence can be useful but can also be harmful as shown above. Having a health probe, on the other hand, is an absolute requirement. it is used to determine the current primary replica.
-
Miguel Angel 👍 1 Answered BEsto no es un requisito para configurar un listener de SQL Server Always On Availability Groups. Para que un Azure Internal Load Balancer (ILB) funcione correctamente con un listener de Always On, los elementos importantes son: Configurar un frontend IP para el listener. Crear una Health Probe (normalmente TCP). Configurar una Load Balancing Rule. Habilitar Floating IP (Direct Server Return). La configuración de Session Persistence (Client IP) no es necesaria para que el listener funcione y, por sí sola, no cumple el objetivo.
-
longwhiteclouds 👍 1For configuring an Azure internal load balancer (ILB) as a listener for a SQL Server Always On availability group, setting the session persistence to "Client IP" is correct. This setting ensures that client connections from the same IP address are consistently routed to the same backend server. This is important for SQL Server Always On availability groups to ensure that the traffic is directed to the correct primary replica. Answer: A
-
pooh0805 👍 1 Answered ASetting session persistence to "Client IP" on the Azure internal load balancer is a valid solution for configuring an Azure internal load balancer as a listener for a Microsoft SQL Server Always On availability group. This configuration ensures that client connections from the same source IP address are consistently directed to the same SQL Server instance within the availability group.
-
SHAHIN_STA 👍 1Client IP causes traffic to be directed to a specific server based on the client’s IP address, even if that server becomes unavailable. This disrupts SQL Server's automatic Failover process and can cause issues with database accessibility.
-
KangID 👍 1The introduction of this article has a wise explaining https://learn.microsoft.com/en-us/azure/azure-sql/virtual-machines/windows/availability-group-load-balancer-portal-configure?view=azuresql Answer is no
-
Jay_D_Lincoln 👍 1 Answered BIt amazes me 40% vote on session persistence!! Really?
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All AZ-104 Questions
Access 100 questions with complete answers and detailed explanations.
View Full AZ-104 Practice Test →