0

We have an Azure App Gateway set up and working with session affinity (this is required for the underlying application)

However, if a node becomes unhealthy, sessions that have affinity with that node continue to be forwarded to the unhealthy node until their cookie expires.

Is it possible to configure Azure App Gateway to automatically move sessions who have affinity with one node to a healthy node?

Jan Martin
  • 155
  • 7

1 Answers1

0

To configure Azure App Gateway to automatically move sessions, the cookie-based session affinity feature is useful to keep a user session on the same server

when application gateway instance is provisioned, it automaticallyconfigures a default health probe to each BackendAddressPool using properties of the BackendHttpSetting.

  • If the user is hitting on application gateway, now the application gateway has redirected to session it got connected to the one node if something disconnected, restart, or unhealthy if user again try to connect, cookie-based affinity is enable user will connect to the same target unhealthy Probe retry count. The back-end server is marked down after the consecutive probe failure count reaches the unhealthy threshold.

  • If cookie-based affinity is not Enable application gateway automatically to redirect into another node or it also redirect to the same node there is no guarantee that it will connect to the same backend target in this case, it can connect to the other node also.

To check whether the "Cookie-based Affinity” setting is enabled

Go to Azure portal -> in left side click All resources -> select App Gateway name in the All-resources blade -> Setting -> HTTP setting -> Add HTTP -> Cookie-based Affinity ->Disable

enter image description here

For more information in detail, please refer below links:

Troubleshoot Azure Application Gateway session affinity issues

Sticky and NON-Sticky sessions

https://docs.microsoft.com/en-us/azure/application-gateway/configuration-overview

https://docs.microsoft.com/en-us/azure/application-gateway/application-gateway-troubleshooting-502#problems-with-default-health-probe

Imrankhan-MT
  • 226
  • 1
  • 3
  • So if we have session affinity enabled, clients who were connected to a node that becomes unhealthy are stuck there? That seems bad. How can I raise an enhancement request to bypass session affinity when the affinity node is unhealthy? – Jan Martin May 26 '22 at 23:28
  • if session affinity enabled user will connect on the same node, it's not move forward automatically to another node – Imrankhan-MT May 27 '22 at 03:37
  • If AppGateway knows that the node is unhealthy, why doesn't it move the client to a healthy node? – Jan Martin May 27 '22 at 05:11