I am trying to connect to the Preview Azure Redis Cache with the following code.
var options = new ConfigurationOptions();
options.EndPoints.Add("myname.redis.cache.windows.net", 6379);
options.Ssl = true;
options.Password = "VeryLongKeyCopiedFromPortal";
var connection = ConnectionMultiplexer.Connect(options);
When I do this I get the exception
"It was not possible to connect to the redis server(s); to create a disconnected multiplexer, disable AbortOnConnectFail"
What can be causing this?
The port for SSL is 6380. Port 6379 is used for non-SSL. StackExchange.Redis defaults to these ports if not set, so you should be able to just remove the port from your code, like so:
var options = new ConfigurationOptions();
options.EndPoints.Add("myname.redis.cache.windows.net");
options.Ssl = true;
options.Password = "VeryLongKeyCopiedFromPortal";
var connection = ConnectionMultiplexer.Connect(options);
Alternatively, you can use a connection string instead of the ConfigurationOptions object:
var connection = ConnectionMultiplexer.Connect(
"myname.redis.cache.windows.net,ssl=true,password=VeryLongKeyCopiedFromPortal");
I had this same issue. Make sure you copied the key correctly :)
My issue was I didn't copy the base 64 encoded key properly from the UI. Consider the two keys below. The way I usually copy/paste a non broken string is by double clicking. When I double clicked on the key I got the first set of data and not the entire string.
8Rs0Uvx7aaaaaaaaTjaoTu11bz0qOm/o5E8dtWPXtrc=
8Rs0Uvx7aaaaaaaaTjaoTu11bz0qOm
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With