0

I am developing a chat app with dotnet core and singalR. 2 days ago I learned that I need to use Azure SigalR service to scale my chat servers. So I started to create an Azure signalR service and implement it in my project. My chat is working as excepted on single server. But when add AddSignalR part to code, my app is giving connection error :

Error while establishing connection Error

My startup.cs code

services.AddSignalR()
        .AddAzureSignalR("Endpoint=https://*******.service.signalr.net;AccessKey=************;Version=1.0;");

if I remove .AddAzureSignalR() part from code. It s working as expected again.

app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
                endpoints.MapHub<ChatHub>("/chat");
                endpoints.MapHub<OnlineHub>("/online");
            });

I ve both tried Microsoft.Azure.SignalR.Management and Microsoft.Azure.SignalR nuget packages. I got same error on both. Also I m using free option of Azure SignalR service

Is there anyone who can have an idea about why do I lose the connection ?

Sercan
  • 121
  • 3
  • 13
  • Have you followed troubleshooting steps in docs, e.g: https://learn.microsoft.com/en-us/azure/azure-signalr/signalr-howto-troubleshoot-method – Noah Stahl Jul 28 '21 at 13:37
  • Hi Noah, Thank you for your answer. I just noticed that I m getting 429 error code which is about request count. And seems like I cant come over it without passing to paid tier. – Sercan Jul 28 '21 at 14:05
  • Why use Azure's resource? Just host the beacon inside an API and deploy to Azure. – GH DevOps Jul 28 '21 at 15:27
  • Hi @GHDevOps. Sorry, I couldn't get you well. What did you mean when you say "Beacon"? – Sercan Jul 28 '21 at 16:03
  • The signal. You're adding it inside OWIN with .AddSignalR(), why use the Azure service? Just deploy your API to Azure and your endpoint should connect you: https://localhost:58548/chat – GH DevOps Jul 28 '21 at 16:38

0 Answers0