Azure Redis Issue from .net

sjcloudlooker 5 Reputation points
2023-07-17T17:19:57.15+00:00

I am trying to connect Azure Redis cache from a simple .net 4.6.1 console app and getting the below when I try do StringSet

StackExchange.Redis.RedisConnectionException: 'The message timed out in the backlog attempting to send because no connection became available (5000ms) - Last Connection Exception: It was not possible to connect to the redis server(s). ConnectTimeout, command=SET, timeout: 5000, inst: 0, qu: 1, qs: 0, aw: False, bw: SpinningDown, rs: NotStarted, ws: Initializing, in: 0, last-in: 0, cur-in: 0, sync-ops: 1, async-ops: 1, serverEndpoint: sjrediscache.redis.cache.windows.net:6380, conn-sec: n/a, aoc: 0, mc: 1/1/0, mgr: 10 of 10 available, clientName: 5CG0251G81(SE.Redis-v2.6.116.40240), IOCP: (Busy=0,Free=1000,Min=8,Max=1000), WORKER: (Busy=0,Free=2047,Min=8,Max=2047), v: 2.6.116.40240 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)'

Here is my code, any suggestions of what can be done?

System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
// Connect to Azure Redis Cache
string redisConnectionString = "sjrediscache.redis.cache.windows.net:6380,password=**************=,ssl=True,abortConnect=False,sslProtocols=tls12";
redisConnection = ConnectionMultiplexer.Connect(redisConnectionString);

I then disabled SLL and tried to connect to 6379 port , but still getting the same rror

Error :

Unhandled exception. StackExchange.Redis.RedisConnectionException: The message timed out in the backlog attempting to send because no connection became available (5000ms) - Last Connection Exception: It was not possible to connect to the redis server(s). ConnectTimeout, command=SET, timeout: 5000, inst: 0, qu: 1, qs: 0, aw: False, bw: SpinningDown, rs: NotStarted, ws: Initializing, in: 0, last-in: 0, cur-in: 0, sync-ops: 1, async-ops: 1, serverEndpoint: sjrediscache.redis.cache.windows.net:6379, conn-sec: n/a, aoc: 0, mc: 1/1/0, mgr: 10 of 10 available, clientName: 5CG0251G81(SE.Redis-v2.6.122.38350), IOCP: (Busy=0,Free=1000,Min=8,Max=1000), WORKER: (Busy=0,Free=32767,Min=8,Max=32767), POOL: (Threads=12,QueuedItems=0,CompletedItems=65,Timers=4), v: 2.6.122.38350 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)
---> StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s). ConnectTimeout
--- End of inner exception stack trace ---
at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T] in /_/src/StackExchange.Redis/ConnectionMultiplexer.cs:line 2093 at StackExchange.Redis.RedisBase.ExecuteSync[T] in //src/StackExchange.Redis/RedisBase.cs:line 62
at StackExchange.Redis.RedisDatabase.StringSet(RedisKey key, RedisValue value, Nullable`1 expiry, Boolean keepTtl, When when, CommandFlags flags) in /
/src/StackExchange.Redis/RedisDatabase.cs:line 3164
at AzureRedis.Program.Main(String[] args) in C:\Users\Jonnasn1\source\repos\AzureRedis\AzureRedis\Program.cs:line 19

Azure Cache for Redis
Azure Cache for Redis
An Azure service that provides access to a secure, dedicated Redis cache, managed by Microsoft.
221 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Oury Ba-MSFT 16,891 Reputation points Microsoft Employee
    2023-07-17T20:41:41.09+00:00

    @sjcloudlooker Thank you for reaching out and sorry to hear about the issue you're facing.

    A networking configuration on the machine where the client app is running, or on the cache firewall, or somewhere in between is blocking communication between the client app and the cache.

    Please check the network configuration and try to reconnect again.

     Also, it looks like you are posting the cache password in those screenshots. I a going to delete the screen shot to protect security of the cache.

    You can re-add them by hiding the password.

    Regards,

    Oury

    0 comments No comments

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more