在Azure中,会话不是粘性的,因此当您拥有多个Web角色实例时,会话不足以使用InProc
会话(您应该这样做,否则您不会被Windows Azure计算SLA保证99.95%的正常运行时间)。在ASP.NET会话中使用Azure表存储
因此,我想为ASP.NET会话使用Azure表存储。我熟悉SQL Azure,但尚未使用Azure表存储。
我被告知,适当的方法是使用ASP.NET Universal Providers以及少量的web.config
诡计。
到目前为止,我还没有能够得到这个工作。有关此主题的帖子有variety,但其中很多人指出使用Microsoft.Samples.ServiceHosting.AspProviders.TableStorageSessionStateProvider
,这看起来像是正在发布的Universal Providers的前身。
此刻,我web.config
sessionState
部分看起来是这样的:
<sessionState mode="Custom"
customProvider="TableStorageSessionStateProvider">
<providers>
<clear/>
<add name="TableStorageSessionStateProvider"
type="System.Web.Providers.DefaultSessionStateProvider"/>
</providers>
</sessionState>
但是,使用此作为提供者需要有一个connectionStringName
属性给我一个错误。
对于Azure表存储,这应该是什么样子?
我觉得@smarx是正确的。是否有任何理由不使用SQL DB或AppFabric? – 2012-04-09 04:48:47