In Azure, sessions are not sticky so it's not sufficient to use InProc
session when you have multiple Web role instances (which you should, otherwise you're not covered by the Windows Azure Compute SLA which guarantees 99.95% uptime.).
Therefore I would like to use Azure table storage for ASP.NET session. I am familiar with SQL Azure, but have not yet used Azure table storage.
I am told that the appropriate way to do this is using the ASP.NET Universal Providers, along with a small amount of web.config
trickery.
So far, I have not been able to get this working. There are a variety of postings around this topic, but a lot of them point to using Microsoft.Samples.ServiceHosting.AspProviders.TableStorageSessionStateProvider
, which looks like a precursor to the Universal Providers being released.
At the moment, my web.config
sessionState
section looks like this:
<sessionState mode="Custom"
customProvider="TableStorageSessionStateProvider">
<providers>
<clear/>
<add name="TableStorageSessionStateProvider"
type="System.Web.Providers.DefaultSessionStateProvider"/>
</providers>
</sessionState>
However, using this gives me an error as the provider needs to have a connectionStringName
attribute.
For Azure table storage, what should this look like?
I don't think the universal providers have any support for table storage.
Or you can use AppFabric Caching:
http://msdn.microsoft.com/en-us/library/windowsazure/gg278339.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With