3
votes

I'm trying to use Azure Redis cache in my MVC 4.6 app but getting connection errors. This is the error:

No connection is available to service this operation: GET c7fc43f3-47c4-43cb-94ff-50527b1cda0c_TokenCache; It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail. ConnectTimeout; IOCP: (Busy=3,Free=997,Min=2,Max=1000), WORKER: (Busy=2,Free=4093,Min=2,Max=4095), Local-CPU: 100%

My web.config has:

<add key="ida:CacheConnection" value="myCache.redis.cache.windows.net:6380,password=bpPQX6jeocNjyX1FqrvVztGMQqjekXbUXFjGkiZOyCE=,ssl=True,abortConnect=False,connectTimeout=30,syncTimeout=3000,ConnectRetry=3" />

My packages.config has:

<package id="StackExchange.Redis" version="1.2.0" targetFramework="net45" />

I followed this MSDN article to configure Aazure Redis server and client.

I tried to use client side cmd line tool to verify the connection even that is not working. Not giving me any sign of success or failure. This is my command:

C:\Program Files\Redis>redis-cli -h "myCache.redis.cache.windows.net" -a bpPQX= -p 6379

I tried -p 6380 as well but nothing changed.

2
Are you able to connect to your Redis cache via Redis CLI after disable the Only SSL Access? - juvchan
Nope. Non-SSL access is enabled from portal. Sill the cli gives me no response. - Sam
Does your network have any outbound connection restrictions? I tried using the info you gave above and here is the output I got... redis-cli.exe -h "myCache.redis.cache.windows.net" -p 6379 myCache.redis.cache.windows.net:6379> auth wrongpassword (error) ERR invalid password - JonCole
Yes I am behind corporate firewall. But don't know about restrictions. Can you please provide me with terse information about waiving off/relaxing bits which I need to tell to my security team? Thanks! - Sam

2 Answers

0
votes

Set in Azure Portal: Non-SSL port (6379) enabled.

Try to connect to port 6379, using CLI. I don't think that Redis-CLI can connect to SSL port (6380)

0
votes

You should go to your Redis Cache resource blade's Advanced Settings in the Azure portal, set Allow access only via SSL to No and Save the setting.

You should be able to connect to your Redis cache via Redis CLI:

redis-cli -h "myCache.redis.cache.windows.net" -a bpPQX=

-p 6379 can be optional because the default Non-SSL port for Azure Redis Cache is 6379.

enter image description here

Reference: StackExchange.Redis Configuration Doc