MOVED error trying to connect to redis from function app with node.js

Ryan Goree 1 Reputation point
2021-04-02T07:29:26.353+00:00

I'm trying to connect to redis from a function app using node.js with the example snippet in the quickstart:

var client = redis.createClient(6380, process.env.REDISCACHEHOSTNAME,
    {auth_pass: process.env.REDISCACHEKEY, tls: {servername: process.env.REDISCACHEHOSTNAME}});

But am getting an error with the message: MOVED 15850 10.151.1.36:15002.

What does this error mean and how I can I resolve it?

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,263 questions
Azure Cache for Redis
Azure Cache for Redis
An Azure service that provides access to a secure, dedicated Redis cache, managed by Microsoft.
215 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 68,476 Reputation points
    2021-04-05T05:04:15.883+00:00

    Hi @Ryan Goree

    Welcome to Microsoft Q&A! Thanks for posting the question.

    Can you confirm if you are observing this error intermittently? Are you connecting to azure Redis cache or Redis cache on VM? What happens when you connect your Redis server using any of the Redis clients. Have you observed the same issue?

    I have tested the scenario at my end and couldn't observe the same issue. Please confirm if you have specified the REDISCACHEKEY and REDISCACHEHOSTNAME as environment variables i.e. in your application setting on portal or local.setting.json if you are executing it on your local machine.

    0 comments No comments