Azure SignalR Service not working in a ASP.NET App Service
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:
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.