title: Can't connect to Redis server using ASP.NET Session State Provider
body: <p>I have been attempting to replace ASP.NET Session with Redis for some time now. Multiple hours with the <a href="http://blogs.msdn.com/b/webdev/archive/2014/05/12/announcing-asp-net-session-state-provider-for-redis-preview-release.aspx" rel="nofollow">Microsoft ASP.NET Session State Provider for Redis</a> have been fruitless. </p>
  
  <p>We have an on-premises Sentinel configuration for Redis. Originally I thought this was not working due to the Provider not supporting Sentinels. I switched my connection string to use the master, in hopes that I would at least be able to establish a connection. Still nothing. </p>
  
  <p>I have tried multiple configurations for this provider and continually receive either "No connection available for the request" or "Additional information: It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. UnableToResolvePhysicalConnection on PING."</p>
  
  <p>Here are some of the configurations I've attempted:</p>
  
  <p>Attempt #1:</p>
  
  <pre><code>&lt;connectionStrings&gt;
    &lt;add name="RedisConnection" connectionString="1.2.3.4:5,abortConnect=false,ssl=true,password=XXXXXX,ConnectTimeout=10000"/&gt;
  &lt;/connectionStrings&gt;
  
  &lt;sessionState mode="Custom" customProvider="MySessionStateStore"&gt;
    &lt;providers&gt;
      &lt;add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" connectionString="RedisConnection" /&gt;
    &lt;/providers&gt;
  &lt;/sessionState&gt;
  </code></pre>
  
  <p>Attempt #2:</p>
  
  <pre><code>&lt;sessionState mode="Custom" customProvider="MySessionStateStore"&gt;
    &lt;providers&gt;
      &lt;add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="1.2.3.4" port="5" accessKey="XXXXXXX" /&gt;
    &lt;/providers&gt;
  &lt;/sessionState&gt;
  </code></pre>
  
  <p>Attempt #3:</p>
  
  <pre><code>&lt;sessionState mode="Custom" customProvider="MySessionStateStore"&gt;
    &lt;providers&gt;
      &lt;add name="MySessionStateStore" type="Microsoft.Web.Redis.RedisSessionStateProvider" host="1.2.3.4:5" accessKey="XXXXXXX" /&gt;
    &lt;/providers&gt;
  &lt;/sessionState&gt;
  </code></pre>
  
  <p>I have found very little documentation on this provider, and troubleshooting has been a challenge. I came across a third-party provider and decided to try it, compared to the Microsoft provider.</p>
  
  <p>I was able to successfully connect with <a href="https://github.com/TheCloudlessSky/Harbour.RedisSessionStateStore" rel="nofollow">Harbour.RedisSessionStateStore</a>, using the following configuration:</p>
  
  <pre><code>&lt;sessionState mode="Custom" customProvider="RedisSessionStateProvider"&gt;
    &lt;providers&gt;
      &lt;clear /&gt;
      &lt;add name="RedisSessionStateProvider" type="Harbour.RedisSessionStateStore.RedisSessionStateStoreProvider" host="PASSWORD@1.2.3.4:5" clientType="pooled" /&gt;
    &lt;/providers&gt;
  &lt;/sessionState&gt;
  </code></pre>
  
  <p>With this is mind, what is the correct format for a connection string for the Microsoft provider? It will be easier for me to receive internal support from a first party library, and at this point, it would be a moral victory to get this working.</p>
  
  <p>Also, if anyone knows how I could configure this to hit the Sentinel and determine the master instance to connect to, I would welcome a blog post or any sort of knowledge share on the topic.</p>
  
  <p>Thank you!</p>