无法在Azure Service App和Redis之间建立连接



我正在尝试在容器的azure web应用程序redis数据库之间建立连接。我使用redislabs(redis Enterprise Cloud托管在Azure中(和免费订阅计划创建了一个redis数据库。

我可以从本地机器连接到redisdb,但不能从Azure中运行的docker容器连接。我没有使用TLS加密,因为数据库配置中的免费订阅不支持它。

Azure服务应用程序的位置在西欧,redis是美国东部

我的应用程序是asp.net 5,这是我的配置。(我使用的是StackExchange.RRedis 5.0.0(

services.AddStackExchangeRedisCache(x =>
{
x.ConfigurationOptions = new ConfigurationOptions
{
Password = config.Password,
EndPoints =
{
config.ConnectionString
},
KeepAlive = 180
};
});

这是我在数据库中设置密钥时遇到的一个错误。

StackExchange.Redis.RedisConnectionException: It was not possible to connect to the redis server(s).  There was an authentication failure; check that passwords (or client certificates) are configured correctly. AuthenticationFailure (None, last-recv: 231) on redis-18894.c251.east-us-mz.azure.cloud.redislabs.com:18894/Interactive, 
Flushed/ComputeResult, last: ECHO, origin: SetResult, outstanding: 0, last-read: 0s ago, last-write: 0s ago, keep-alive: 60s, state: ConnectedEstablishing, mgr: 9 of 10 available, 
last-heartbeat: never, global: 0s ago, v: 2.0.593.37019  
at StackExchange.Redis.ConnectionMultiplexer.ConnectImplAsync(Object configuration, TextWriter log) 
in C:projectsstackexchange-redissrcStackExchange.RedisConnectionMultiplexer.cs:line 823
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.ConnectAsync(CancellationToken token)  
at Microsoft.Extensions.Caching.StackExchangeRedis.RedisCache.SetAsync(String key, Byte[] value, DistributedCacheEntryOptions options, CancellationToken token)

可能我只能使用TSL进行连接,因为在应用程序服务中的TLS/SSL设置中我有最低TLS版本=1.2

谢谢!

应用程序服务配置与如何连接到redis完全无关。请确保使用端口80连接到redis。请在与redis连接时参考此内容。使用StackExchange.RRedis;

只读ConnectionMultiplexer muxer=ConnectionMultiplexer.Connect("主机名:端口,密码=密码"(;IDatabase-conn=复用器。GetDatabase((;

最新更新