Azure SignalR Service Troubleshooting

Azure SignalR Service Troubleshooting

In this post I am describing the issue I faced on creating the Azure SignalR service and how I figured it out:

Grabbed the connection key and added to my project which uses services.AddSignalR().AddAzureSignalR()

once I run the .netCore app and my client app Locally they are all good and as console shows it is connected to the SignalR service which I already created:

However, once I publish my .netCore app to the Azure app service my application throw error while the publish succeed. Given that, When I publish my app without integrating it to Azure SignalR Service it works fine as per below:

In order to investigate the issue, you need to activate the Log system.

Now you are able to connect to the FTP by using the FTP Url. Once you open the Url, you are required to enter your credentials. Where to get it? Once you click the relevant app service, you will see the menu "Development Center"

Clicking on FTP you can copy the credentials:

You can browse the files in FTP server and view the diagnostic*.txt file to see the detail:

the error is it needs the connection string to be introduced directly in the service instead of using Secret user keys in the project:

Solution to fix the issue

In most of documentations, it is recommended to use the Secret Manager to add the Azure Service connection string. Quick Start
However, once you deploy your Asp.net core code to the Azure it cannot pick the file from your local which means you need to pass the connection string directly to the code as below:

 services.AddSignalR().AddAzureSignalR("Endpoint=https://azuresignalrservicerc.service" +".signalr.net;AccessKey=999n1gcxWMYq52sw=");