What is the best way to handle session affinity (sticky session) with Azure IaaS VMs? We have 2 load balanced web servers. Right now they are setup and use the Azure Round Robin approach. The issue is we need to setup session affinity. It seems we can do so with ARR, but will that require another server to support it? We actually host several sites across several ports on these servers, so we need to support multiple ports as well. Can we do this with Network Load Balancing? What is the best way to handle this?

We use a 3rd party control now that is not serializable so we have to use session affinity.


Looks like this is now supported, but by IP only: http://azure.microsoft.com/blog/2014/10/30/azure-load-balancer-new-distribution-mode/


If you're going through the Azure load balancer (e.g. through the public IP address), you will have no control over the load-balancing algorithm, and there is no support for server affinity.

You would need to have another VM set up to handle load-balancing, whether it's IIS with ARR or something else such as nginx, haproxy, etc. You can then direct all traffic to your load-balancer VM (instead of your IIS VMs). Your load-balancer would then direct traffic to your IIS VM's via their internal IP address.

  • David, That's what I figured. We have now setup an Azure VM with IIS and ARR and have it pointing to our 2 web servers. When I try and hit the public endpoint of the ARR server, it is not displaying the web servers, and just gives me a 404. How can I test that we set this up properly? – Noah Sep 9 '13 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.