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>
source share