Hello friends,
We are having trouble integrating Azure SignalR. Messages are rarely displayed. I tested both locally and hosting on Azure AppService. In App Service we have three instances, and we have also configured Redis as a cache.
we use aspNetCore MVC
my settings:
we get no connection errors:
We use Azure LiveTrace to retrieve the logs:
running locally no messages are delivered. Publishing to the Azure service we randomly receive some messages.
When we remove the Azure SignalR service the messages arrive normally.
5 Answer(s)
-
0
Hi @ricardo
The default operating mode for Azure SignalR might be "default". However, if you are running in "serverless" mode, SignalR only sends messages via REST APIs or Azure Functions and does not support WebSocket connections.
Please ensure that this setting is defined as "Default" or "Classic". Add the ServerStickyMode setting as well
services.AddSignalR().AddAzureSignalR(options => { options.ServerStickyMode = ServerStickyMode.Required; });
Can you check this situation?
-
0
Hi @oguzhanagir,
thanks for the feedback.
we check the configuration in azure:
We added the configuration:
When we test it by running it locally in debug pointing to the azure signal R service, it works:
both users appear online and messages are displayed instantly.
But when we publish to the Azure Application Service we still don't receive it, or it does so very randomly:
the logs received in the trace indicate that the messages are arriving at the azure service. But for some reason they are not being delivered.
in production we are using the Redis cache:
Should I do any additional configuration in Redis?
-
0
Hi @oguzhanagir,
we did some more tests, and when we disabled the usePerRequestRedisCache option everything works again as expected. But everything is very slow because we don't have cache per request.
We noticed that the implementation of usePerRequestRedisCache does not contain iocManager.RegisterIfNot<IOnlineClientStore, RedisOnlineClientStore>();
PerRequestConfig:
Redis Config:
So when we use usePerRequestRedisCache, the OnlineClientStore is not stored in the Redis cache, which is probably causing issues when sending messages
Can you check why IOnlineClientStore, RedisOnlineClientStore is not implemented when we use usePerRequestRedisCache option?
-
0
Hi,
You are right. I have created an issue and we will release a version in a short time. Please follow https://github.com/aspnetboilerplate/aspnetboilerplate/issues/7119
-
0
Hi,
thanks