I have a generic .NET Blazor web application with Aspire enabled and I'm trying to setup SignalR to use Redis as backplane. The Redis is running in a docker/podman container, and Aspire dashboard indicates that it's running properly. I am also able to hit Redis server by telnetting into it.
Here's the code from AppHost's Program.cs
var builder = DistributedApplication.CreateBuilder(args);var redis = builder.AddRedis("redis-cache");builder.AddProject<Projects.BlazorSingalRApp1>("blazorsingalrapp1") .WithReference(redis);builder.Build().Run();And here's how the API service (BlazorSingalRApp1) project's program.cs is configured
builder.Services.AddSignalR() .AddStackExchangeRedis("redis-cache", options => { options.Configuration.ChannelPrefix = "MyApp"; options.Configuration.AbortOnConnectFail = false; });However, when I run the apphost, the backend API service can't connect and the logs show
fail: Microsoft.AspNetCore.SignalR.StackExchangeRedis.RedisHubLifetimeManager[7] Not connected to Redis.
Is there anything missing?
Checked the logs of Redis container, no issues.However if I try to post messages, the backend throws this error
StackExchange.Redis.RedisConnectionException: UnableToConnect on redis-cache:6379/SubscriptionIt appears that maybe AddStackExchangeRedis call doesn't honor the connection string coming from Aspire.