加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

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

发布时间:2020-12-16 03:27:12 所属栏目:asp.Net 来源:网络整理
导读:在Azure中,会话不是粘性的,因此当您有多个Web角色实例时,使用InProc会话是不够的(您应该这样做,否则 Windows Azure Compute SLA不会保证99.95%的正常运行时间.). 因此,我想将Azure表存储用于ASP.NET会话.我熟悉SQL Azure,但还没有使用Azure表存储. 我被告知
在Azure中,会话不是粘性的,因此当您有多个Web角色实例时,使用InProc会话是不够的(您应该这样做,否则 Windows Azure Compute 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表存储,这应该是什么样的?

解决方法

我不认为通用提供商对表存储有任何支持.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读