Sticky session router implementation on Windows Azure

Category: azure development


Simon de Kraa on Wed, 08 Jan 2014 15:45:47

The following roles are deployed to Windows Azure Cloud Services.

The application needs session stickiness, so we have deployed Web Farm Framework and ARR.

Also the application needs .NET 4.5 to run. Because of this I have to deploy to Windows 2012.

But...Web Farm Framework is not available for Windows 2012 / IIS 8.


Are there any other ways to implement a "sticky session router" on Windows Azure?

Or any workaround or other ideas?


Best Regards, Simon de Kraa.


beeery_sh on Thu, 09 Jan 2014 06:58:08


Please see this blog 

Shahar Damary on Thu, 09 Jan 2014 07:18:53


I think the best solution is to use Azure cache.

Create a cache service (or in-role) and assign your site configuration session to store information over the cache.

more information can be found here :



Simon de Kraa on Thu, 09 Jan 2014 07:32:08

In our case the session state is not serializable so we cannot use a caching mechanism.

Moving to a stateless application is also not an option because we use 3rd party components that are state aware and cannot be changed.

The solution that we are using is this one:

But unfortunately this does not work on Windows 2012 / IIS8 so we are looking for another similar solution.

Shahar Damary on Thu, 09 Jan 2014 07:52:19

I think the cache is in-memory (need to check) if your session state is not serializable, how do you store it if you have only one server ? are you using ASP.NET Session ? - Shahar

Simon de Kraa on Thu, 09 Jan 2014 08:09:13

Unfortunately we cannot use caching.

For more information see

MingXu-MSFT on Mon, 13 Jan 2014 01:52:22

Unfortunately we cannot use caching.

For more information see

Best Regards, Simon de Kraa.


The thread in your link was from 2 years ago. You may want to test if XAF supports Windows Azure caching at the current moment: 2014. You can post the question in their forum as well.
If XAF still only supports in-proc session, then you have below options: 1. Modify the source code and see if you can fix the issue. 2. Find an alternative that supports out-of-proc session. 3. Use a single web role instance with better hardware. 4. Use Windows Server 2008 R2, which also supports .NET 4.5 (may require a startup task to install it). 5. Use virtual machine instead of web role, and configure web farm as described in, no WFF is required.

Best Regards,

Ming Xu

Simon de Kraa on Mon, 13 Jan 2014 08:49:33

Thank you for your suggestions..

XAF still does not support this and will not support this in the future. We had a look at the source code but it was too complex (for us) to make any changes that would make this possible.

When we try to deploy to Windows 2008 we get the following error message:

The feature named NetFx45 that is required by the uploaded package is not
available in the OS * chosen for the deployment.

I assumed this was checked before the OS was prepared but maybe I am mistaken. I will try to install .NET 4.5 using a startup task.

I will have a look at the link that you provided. Thank you for your input.