Azure SignalR Service not working in a ASP.NET App Service

Sebastian Cruz Chavarria 1 Reputation point
2022-10-19T07:16:08.127+00:00

I have a .NET Framework v4.8 app which is deployed on a Azure App Service instance and currently implements local SignalR service. When I tried to scale out the app without setting the ARRAffinity cookie, SignalR messages get lost and sometimes may work when subsequent requests go to the same server randomly.

To avoid this behavior, I created an Azure SignalR Service and set my application to use it as described in the official Microsoft Learn, but when the JS client makes the negotiate call the server returns an error about an SQL Server Express database creation issue:

251768-signalr-sqlexpress.png

My app is not using any SQL Server Express database by any means, so I don't understand what could cause this issue.

This is what the Configuration method on Startup.cs file looks like:

public void Configuration(IAppBuilder app)  
        {  
            // Any connection or hub wire up and configuration should go here  
            //app.MapSignalR();   
            app.MapAzureSignalR(this.GetType().FullName);  
            GlobalHost.TraceManager.Switch.Level = SourceLevels.Information;  
  
        }  

I also have the proper ASRS connection string in Web.config file. If I switch app.MapAzureSignalR over to app.MapSignalR() the negotiate endpoint works and all SignalR messages work as expected.

ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,222 questions
Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
120 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,691 questions
{count} votes