I want to be able to use dedicated or co-located caching in my Azure web roles.
The problem is that the application I am migrating uses HttpSessionState
extensively. I don't want to change all of this code because:
This is time consuming (especially with testing)
I can't enforce developers from using HttpSessionState
I want to avoid vendor locking as much as possible
Is there no session provider for dedicated and co-located caching so that I can keep existing code as is?
I fixed the problem. To use the ASP.NET Session State in the dedicated or co-located Azure caching, the following session provider needs to be setup in the web.config:
<sessionState mode="Custom" customProvider="AFCacheSessionStateProvider">
<providers>
<add name="AFCacheSessionStateProvider"
type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache"
cacheName="default" dataCacheClientName="default"
applicationName="AFCacheSessionState"
/>
</providers>
</sessionState>