Right now I have an Azure Cloud Service hosting an MVC app that - currently - when updated using the VIP swap method from Staging <> Production, kills all sessions. I haven't done any configuration around Session management, so this is to be expected.
I'm now trying to address this by following this link:
http://www.windowsazure.com/en-us/manage/services/cache/net/how-to-in-role-cache/
I've enabled in-role caching. My dataCacheCLients
looks like this:
<dataCacheClients>
<dataCacheClient name="default">
<!--To use the in-role flavor of Windows Azure Cache, set identifier to be the cache cluster role name -->
<!--To use the Windows Azure Cache Service, set identifier to be the endpoint of the cache cluster -->
<autoDiscover isEnabled="true" identifier="MyRoleName" />
</dataCacheClient>
</dataCacheClients>
The above link points here to actually set the web.config for session caching:
http://www.windowsazure.com/en-us/manage/services/cache/net/how-to-in-role-cache/#store-session
I've uncommented that section (just session caching) in my web.config, which now looks like this:
<!-- Windows Azure Cache session state provider -->
<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>
<!-- Windows Azure Cache output cache provider -->
<!--Uncomment this section to use Windows Azure Cache for output cache-->
<!--<caching>
<outputCache defaultProvider="AFCacheOutputCacheProvider">
<providers>
<add name="AFCacheOutputCacheProvider" type="Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider, Microsoft.Web.DistributedCache" cacheName="default" dataCacheClientName="default" applicationName="AFCacheOutputCache" />
</providers>
</outputCache>
</caching>-->
Now, when I run this locally (no emulators used, just the MVC app in IIS), I get the following error:
None of the discovered or specified addresses match the socket address
family. Parameter name: context
I don't get much in the way of details here, it just gets thrown in a Source Not Available
window.
So, thinking that this might just be a local issue that I can worry about later, I published to Azure. The app runs fine. But deploying and VIP swapping breaks sessions, so it appears to not be working.
What could be causing this? I've attempted to follow all instructions precisely.
One thing I noticed is that the last article linked to is from the Azure Cache tutorial - I never set up Azure Cache, as I'm using a storage account with my co-located role (per the previous tutorial). What could be causing these issues?
See Question&Answers more detail:
os