Connect to Azure Redis Cache from non-local network

Tobias Widmer 20 Reputation points
2023-12-30T10:01:34.76+00:00

I have an Azure Redis Cache instance which is up and running. I would like the redis server to receive data from a non-local network, such as my web server. For example, I want to access the redis server via PHP from my web server via $redis->connect. But here I am getting Connection refused. I read on Stackoverflow that I should change

bind 127.0.0.1 

to

bind 0.0.0.0

such that the server will listen to non-local requests. However, I cannot find this property in my Azure portal. How can I achieve this?

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

Accepted answer
  1. TP 99,056 Reputation points
    2024-01-01T09:39:33.0266667+00:00

    UPDATE 2024-01-09: Cause turned out to be hosting provider was not allowing access to port 6379. Below is comment from Tobias:

    So it turns out that my hosting provider is not providing access to port 6379. That is why it kept failing. Thank you all for your comments and help.

    Hi Tobias,

    Please enable public network access if you haven't already. You do this on Private endpoint blade, as shown below:

    qna azure cache for redis enable public access

    Once above is done (give it a minute to take effect), any IP is allowed by default, unless you create a rule on Firewall blade. For testing you might want to delete any firewall rules, click Save, wait 1 minute, and verify it works. Once it is working, create a firewall rule for your web server public IP and test again to make sure it still works.

    Please click Accept Answer and upvote if the above was helpful. If you still need assistance add a comment below with your pricing tier, network option you selected during creation (public, private endpoint, vnet), and other networking details if relevant.

    Thanks.

    -TP

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

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.