title: UnableToConnect Azure Cache for Redis
body: <p>I am trying to store ASP.NET session state in the cache (Azure cache for redis) as mentioned here <a href="https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-aspnet-session-state-provider" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-aspnet-session-state-provider</a></p>
  <p>but, i am receiving below error.</p>
  <blockquote>
  <p>UnableToConnect on mydomain.redis.cache.windows.net:6379/Interactive,
  origin: ResetNonConnected, input-buffer: 0, outstanding: 0, last-read:
  5s ago, last-write: 5s ago, unanswered-write: 1106595s ago,
  keep-alive: 60s, pending: 0, state: Connecting, last-heartbeat: never,
  last-mbeat: -1s ago, global: 5s ago, mgr: Inactive, err: never
  StackExchange.Redis.RedisConnectionException: UnableToConnect on
  mydomain.redis.cache.windows.net:6379/Interactive, origin:
  ResetNonConnected, input-buffer: 0, outstanding: 0, last-read: 5s ago,
  last-write: 5s ago, unanswered-write: 1106595s ago, keep-alive: 60s,
  pending: 0, state: Connecting, last-heartbeat: never, last-mbeat: -1s
  ago, global: 5s ago, mgr: Inactive, err: never</p>
  </blockquote>
  <pre><code>    &lt;add name=&quot;AzureRedisCacheConnection&quot; connectionString=&quot;mydomain.redis.cache.windows.net:6379,password=password=,ssl=False,abortConnect=False&quot;/&gt;
    &lt;/connectionStrings&gt;
    
    
    &lt;sessionState mode=&quot;Custom&quot; customProvider=&quot;AzureCacheForRedisProvider&quot;&gt;
        &lt;providers&gt;
          &lt;!-- For more details check https://github.com/Azure/aspnet-redis-providers/wiki --&gt;
          &lt;!-- Either use 'connectionString' OR 'settingsClassName' and 'settingsMethodName' OR use 'host','port','accessKey','ssl','connectionTimeoutInMilliseconds' and 'operationTimeoutInMilliseconds'. --&gt;
          &lt;!-- 'throwOnError','retryTimeoutInMilliseconds','databaseId' and 'applicationName' can be used with both options. --&gt;
          &lt;!--
            &lt;add name=&quot;AzureCacheForRedisProvider&quot; 
              host = &quot;127.0.0.1&quot; [String]
              port = &quot;&quot; [number]
              accessKey = &quot;&quot; [String]
              ssl = &quot;false&quot; [true|false]
              throwOnError = &quot;true&quot; [true|false]
              retryTimeoutInMilliseconds = &quot;5000&quot; [number]
              databaseId = &quot;0&quot; [number]
              applicationName = &quot;&quot; [String]
              connectionTimeoutInMilliseconds = &quot;5000&quot; [number]
              operationTimeoutInMilliseconds = &quot;1000&quot; [number]
              connectionString = &quot;&lt;Valid StackExchange.Redis connection string&gt;&quot; [String]
              settingsClassName = &quot;&lt;Assembly qualified class name that contains settings method specified below. Which basically return 'connectionString' value&gt;&quot; [String]
              settingsMethodName = &quot;&lt;Settings method should be defined in settingsClass. It should be public, static, does not take any parameters and should have a return type of 'String', which is basically 'connectionString' value.&gt;&quot; [String]
              loggingClassName = &quot;&lt;Assembly qualified class name that contains logging method specified below&gt;&quot; [String]
              loggingMethodName = &quot;&lt;Logging method should be defined in loggingClass. It should be public, static, does not take any parameters and should have a return type of System.IO.TextWriter.&gt;&quot; [String]
              redisSerializerType = &quot;&lt;Assembly qualified class name that implements Microsoft.Web.Redis.ISerializer&gt;&quot; [String]
            /&gt;
          --&gt;
          &lt;add name=&quot;AzureCacheForRedisProvider&quot; type=&quot;Microsoft.Web.Redis.RedisSessionStateProvider&quot;
                       connectionString=&quot;AzureRedisCacheConnection&quot; 
             
               /&gt;
        &lt;/providers&gt;
      &lt;/sessionState&gt; ````
  
  
  
  What am I missing here?
  </code></pre>