1
votes

I have NodeJS Web App which trying to connect to the Azure Cache for Redis which is part of the same subscription.

const redis = require('redis')

const redisConnectionConfig = {
  host: REDIS_HOST,
  port: REDIS_PORT,
  auth_pass: REDIS_PASSWORD
  tls: { servername: REDIS_HOST }
}
...

 redis.createClient(redisConnectionConfig)

I'm able to connect to Redis from my local machine after adding my IP to the Redis Firewall rules.

Also, I've added all 'Outbound IPs and Additional Outbound IP Addresses' from the Service App Properties.

I've tried even to allow access from all IPsfirewall rules still not pass

But it is not connected and if I try to use Redis I receive the following connection error: MaxRetriesPerRequestError: Reached the max retries per request limit (which is 20). Refer to "maxRetriesPerRequest" option for details.

Something similar solved for the VM here. But in the case of the App Service Azure managed that layer.

1
I ssh to the container and verified Redis connection from the container itself and guess what? - it is successfully communicating with the Redis. Actually, in my project I use direct Redis connection and Queue built upon the Redis - so I initialize queue with incorrect connection config and it fall back to the default values and connected to my local Redis - that's why it was working from the local machine. - Vasyl

1 Answers

0
votes

Looks like it's not connectivity issue. Network part you always can check via WebApp->Console and use command

tccping redisservername:redisserverport

tcpping_example

Probably something with your redis cache size. What size are you using now? You can find azure redis limits here