SignalR cannot connect to Azure Redis on SSL

假装没事ソ 提交于 2019-12-05 06:29:39

You can try this: GlobalHost.DependencyResolver.UseRedis(new RedisScaleoutConfiguration(connectionString, "YourServer"));

And connection string something like:

connectionString="yourNameHere.cache.windows.net,ssl=true,password=YourPasswordKey"

Make sure you are using SignalR built with StackExchange.Redis (latest is gratest ;)

Sudherson Vetrichelvan

I upgraded the signalr core library to version 2.2.3.0 and used the below syntax, works like a charm.

var redisServer = ConfigurationManager.AppSettings[Constants.RedisServer].ToString();

var redisServerPassword = ConfigurationManager.AppSettings[Constants.RedisServerPassword].ToString();

var connectionString = $"{redisServer},password={redisServerPassword},ssl=True,abortConnect=False";
GlobalHost.DependencyResolver.UseRedis(new RedisScaleoutConfiguration(connectionString, "APIIdentifierString"));

In case anyone else hits the issue, it seems that the default connection string provided by the Azure portal contains abortConnect=False. Once I've removed that part, things started working for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!