使用Azure表存储进行ASP.NET会话

时间:2012-04-08 13:26:20

标签: asp.net session azure azure-table-storage

在Azure中,会话不是粘性的,因此当您有多个Web角色实例时,使用InProc会话是不够的(您应该这样做,否则您不会被Windows Azure计算SLA所覆盖,这保证了99.95%正常运行时间)。

因此,我想将Azure表存储用于ASP.NET会话。我熟悉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表存储,它应该是什么样的?

2 个答案:

答案 0 :(得分:2)

我认为通用提供商不支持表存储。

答案 1 :(得分:2)

相关问题