Session state windows azure websites

I want to know how windows azure websites manage session states in multiple instances. There is a lot of content on the Internet about how to share session states on multiple instances using cloud services, but for sites I could not find the final answer.

Question How do azure windows for websites handle a session? does not have an objective answer. There is a good suggestion in the accepted best answer, but you need to watch a video with more than 1 hour.

Do you know how to do this? Can I just use the InProc session state and the azure windows will manage it in all instances automatically?

Thanks.

+6
source share
3 answers

It looks like the options are:

  • Windows Azure Caching Service [1]. This is a new caching service offered by Microsoft. Price starts at $ 12.50 per month for 128 MB of cache (this is a preliminary estimate with a 50% discount). According to [2], the time to wait for access to the cache is about 1 ms.

  • SQL Azure Validation with Angshuman Nayak [3] is relatively cheap, especially if you are already using SQL Azure for something else. He mentions potential performance issues as a flaw, as you usually use a shared database. You also need to take care to clear experienced sessions.

  • Table storage . Angshuman [3] also provides some instructions on how to use table storage to store sessions. He also mentions that performance is not as good as with other solutions, but does not give any numbers. The good thing about table storage is the price. Since you pay like you, a monthly fee is not fixed there.

Based on this, it seems that the Azure Cache Service is the way to go, unless the price is a problem.

[1] http://www.windowsazure.com/en-us/pricing/details/cache/

[2] http://weblogs.asp.net/scottgu/archive/2013/09/03/windows-azure-new-distributed-dedicated-high-performance-cache-service-more-cool-improvements.aspx

[3] http://blogs.msdn.com/b/cie/archive/2013/05/17/session-state-management-in-windows-azure-web-roles.aspx

+4
source

InProc SessionState is not supported on Azure sites . You will have to use an external session state provider. This article shows external options, and this article shows how to use SQL Azure as a session state provider.

+3
source

In azure mode, you can use the Redis cache to handle the session.

-> install the nuget package RedisSessionStateProvider -> set the SessionState mode to Custom in web.config and customProvider for RedisSessionProvider.

You can find more information from here.

0
source

All Articles