Overide Connection for RedisSessionStateProvider on Azure

I am using RedisSessionStateProvider with asp.net mvc 4.5 for session management. I am using azure web application for my hosting. how to override this connection information on the azure portal during prod deployment. is there any other way than using the web.release.config conversion file?

<sessionState mode="Custom" timeout="2000" customProvider="MySessionStateStore"> <providers> <add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="server.cloudapp.net" port="6379" accessKey="password" ssl="false" databaseId="1" applicationName="pWeb" /> </providers> </sessionState> 
+4
source share
1 answer

The provider accepts a ConnectionString parameter, which can point to appsetting. You can install this application based on the environment in which you work. The following code shows web.config

 <appSettings> <add key="RedisConnection" value="cachename.redis.cache.windows.net,ssl=true,password=password"/> </appSettings> <sessionState mode="Custom" customProvider="MySessionStateStore"> <providers> <add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" connectionString="RedisConnection"/> </providers> </sessionState> 
+7
source

All Articles