Unable to Connect to Azure Managed Redis – Frequent Disconnections from VM
Redis connection from our Azure Virtual Machine to Azure Managed Redis is frequently failing. The VM is unable to maintain a stable connection—either timing out or getting disconnected shortly after connecting. All credentials and configurations appear to be correct.
Steps to Reproduce:
Connect to Azure VM (Linux/Windows).
Use redis-cli
or application to connect to Azure Managed Redis:
Host: <your-redis-name>.redis.cache.windows.net
Port: 6380 (TLS)
Password: (Access key from Azure portal)
Run any Redis command or keep the connection idle.
Expected Result: A stable and persistent connection to the Redis instance, allowing commands to be executed normally.
Actual Result: Connection either:
Fails immediately with error:
(error) WRONGPASS invalid username-password pair
`Could not connect to Redis at <host>:6379: Connection refused`
Or disconnects after a short time
Environment Details:
Azure VM OS: [e.g., Ubuntu 20.04 / Windows Server 2022]
Redis Client: redis-cli
/ StackExchange.Redis / custom app
Redis Hostname: <your-redis-host>.redis.cache.windows.net
Port: 6380
TLS: Enabled
Network Security Group: Port 6380 outbound allowed
DNS Resolution: Working from VM
Troubleshooting Done:
Verified Redis credentials from Azure portal
Ensured VM outbound rules allow port 6380
Tested with and without TLS
Attempted from different VMs
Possible Suspicions:
Network-level restrictions (e.g., DNS, NSG, firewall)
Redis Private Endpoint misconfiguration
- Incorrect TLS setupRedis connection from our Azure Virtual Machine to Azure Managed Redis is frequently failing. The VM is unable to maintain a stable connection—either timing out or getting disconnected shortly after connecting. All credentials and configurations appear to be correct. Steps to Reproduce:
- Connect to Azure VM (Linux/Windows).
- Use
redis-cli
or application to connect to Azure Managed Redis:- Host:
<your-redis-name>.redis.cache.windows.net
- Port: 6380 (TLS)
- Password: (Access key from Azure portal)
- Host:
- Run any Redis command or keep the connection idle.
A stable and persistent connection to the Redis instance, allowing commands to be executed normally. Actual Result:
Connection either:- Fails immediately with error:
-
(error) WRONGPASS invalid username-password pair
-
Could not connect to Redis at <host>:6379: Connection refused
-
- Or disconnects after a short time
- Azure VM OS: [e.g., Ubuntu 20.04 / Windows Server 2022]
- Redis Client:
redis-cli
/ StackExchange.Redis / custom app - Redis Hostname:
<your-redis-host>.redis.cache.windows.net
- Port: 6380
- TLS: Enabled
- Network Security Group: Port 6380 outbound allowed
- DNS Resolution: Working from VM
- Verified Redis credentials from Azure portal
- Ensured VM outbound rules allow port 6380
- Tested with and without TLS
- Attempted from different VMs
- Network-level restrictions (e.g., DNS, NSG, firewall)
- Redis Private Endpoint misconfiguration
- Incorrect TLS setup