Can't connect to redis cluster using redis-py, or via SSL.

Maxi Donadio 1 Reputation point
2022-02-02T20:55:34.193+00:00

Greetings,

I'm currently making a script to manage Redis without using the UI. Every time I ran my script it always ended in a server timeout, so I tried using SSL to connect to it from my terminal without any luck.

Here's the script:

import redis
r= redis.Redis(host='myhostname', port=6380, password=unguessablepassword, db=0, ssl=True)
print(str(r.ping()))

Anybody know why this could be happening?

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

1 answer

Sort by: Most helpful
  1. Oury Ba-MSFT 19,101 Reputation points Microsoft Employee
    2022-02-03T21:10:18.127+00:00

    Hi @Maxi Donadio Thank you for posting your question on Microsoft Q&A and for using Azure services.

    Looks like you are facing a timeout issue connecting to redis cluster using redis-py.

    If your application can't connect to your Azure Cache for Redis, it's possible some configuration on the cache isn't set up correctly. The following sections offer suggestions on how to make sure your cache is configured correctly.

    Test connectivity using redis-cli. For more information on CLI, Use the Redis command-line tool with Azure Cache for Redis.

    171183-image.png

    Regards,
    Oury


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.