1

I have a redis cache with Microsoft Azure and have a Virtual network with IP 172.160.0.99, when I try to connect using these IP this gave me error.

I need other additional configuration for meet it?

PMCastle
  • 11
  • 3
  • `120.25.34.7` is not a private IP address, it is a public IP address. Private IP addresses are defined by _[RFC 1918, Address Allocation for Private Internets](https://tools.ietf.org/html/rfc1918)_. – Ron Maupin Feb 06 '17 at 19:04

2 Answers2

0

Would like to note that the current documentation suggests the opposite of the other answer. The documentation below recommends connecting via hostname instead of IP.

We recommend using the hostname. In other words, use the following:

[mycachename].redis.windows.net:6380,password=xxxxxxxxxxxxxxxxxxxx,ssl=True,abortConnect=False

Avoid using the IP address similar to the following connection string:

10.128.2.84:6380,password=xxxxxxxxxxxxxxxxxxxx,ssl=True,abortConnect=False

https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-how-to-premium-vnet#when-trying-to-connect-to-my-azure-cache-for-redis-in-a-vnet-why-am-i-getting-an-error-stating-the-remote-certificate-is-invalid

Dillon Brown
  • 278
  • 2
  • 7
0

from

https://github.com/a-magdy/azure-content/blob/master/articles/redis-cache/cache-how-to-premium-vnet.md

[AZURE.IMPORTANT] To access your Azure Redis cache instance when using a VNET, pass the static IP address of the cache in the VNET as the first parameter, and pass in an sslhost parameter with the endpoint of your cache. In the following example the static IP address is 172.160.0.99 and the cache endpoint is contoso5.redis.cache.windows.net.

{
 return ConnectionMultiplexer.Connect("172.160.0.99,sslhost=contoso5.redis.cache.windows.net,abortConnect=false,ssl=true,password=password");
      });

public static ConnectionMultiplexer Connection
{
   get
     {
        return lazyConnection.Value;
   }
}
PMCastle
  • 11
  • 3