I have a question regarding the session affinity requirements for Pega Platform and the appropriate selection of load balancer services in Azure.
From my understanding, Pega relies on session-based affinity to ensure that user requests are consistently routed to the specific application server maintaining the user’s state.
Azure Load Balancer, which operates at Layer 4 (TCP/UDP), offers session persistence based on source IP address. However, it does not support application-level session affinity using HTTP cookies or session data, which I believe is essential for maintaining user sessions in Pega.
Conversely, Azure Application Gateway provides Layer 7 (HTTP/HTTPS) load balancing and supports cookie-based session affinity. Based on this, I believe Azure Application Gateway can fulfill Pega’s session management requirements.
Could you please confirm if this interpretation aligns with Pega’s official recommendations or best practices? If there are any supporting documents or reference cases, I would appreciate if you could share them. Additionally, are there any specific configurations or considerations required on the Pega Platform side when using Azure Application Gateway for session affinity?
Your understanding is correct. Pega Platform maintains user session state in the JVM (HTTP session). For interactive users, requests belonging to the same session should continue to reach the same application node. For this reason, Pega recommends using session persistence (sticky sessions) on the load balancer, with cookie-based session affinity being the preferred approach.
Azure Load Balancer only supports persistence based on connection/source IP. It has no understanding of HTTP sessions or cookies, so it cannot provide application-level session stickiness across multiple HTTP requests.
Azure Application Gateway, on the other hand, supports Cookie-based Affinity, where it issues an ApplicationGatewayAffinity cookie and routes subsequent requests from the same user to the same backend instance. Microsoft specifically documents this as the mechanism to maintain a user session on the same backend server.
There is generally no special Pega configuration required simply because you’re using Azure Application Gateway.
The important considerations are:
Enable Cookie-based Affinity on the Application Gateway backend HTTP settings.
Ensure the affinity cookie is returned by the client (browser).
Configure health probes correctly so unhealthy Pega nodes are removed from rotation.
Use HTTPS end-to-end where possible.
Microsoft also notes that Application Gateway’s session affinity works only via cookies, so the backend application must support cookie-based affinity—which Pega does.
For a Pega Platform deployment on Azure (including AKS), Azure Application Gateway (or another Layer 7 load balancer/ingress that supports cookie-based session affinity) is the recommended choice for interactive user traffic.
One additional point to verify is your deployment model. If you’re deploying Pega on AKS using the official Pega Helm charts, the architecture may also include an NGINX Ingress Controller or the Azure Application Gateway Ingress Controller (AGIC). In that case, it’s important to configure session affinity consistently at the ingress layer and avoid having multiple layers applying conflicting sticky-session policies.