© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•2y ago
Alen Alex

Unable to connect to SignalR (Not Azure SignalR) after deployment to Azure App Service

We are trying out SignalR in one of our .net 7 web API deployed in Azure. The issue is it won't allow connecting to the signalR after deployment, It was first CORS error (Even tho, CORS has been enabled in the backend) , when changed to SSE, now I am getting a 404 NOT FOUND (
{ "statusCode": 404, "message": "Resource not found" }
{ "statusCode": 404, "message": "Resource not found" }
) on negotiate

This is how I am connecting

ngOnInit(): void {
    var hubConnection = new HubConnectionBuilder()
      .withUrl("https://domain..../v1/instruments/instrumentHub", {
        headers: {
          "Ocp-Apim-Subscription-Key": "Dummy Data"
        },
        withCredentials: false,
        transport: HttpTransportType.ServerSentEvents,
      .configureLogging(LogLevel.Trace)
      .build();

    hubConnection.start().then(() => {
      console.log(1)
    }).catch((e) => {
      console.log('error', e)
    })
  }
ngOnInit(): void {
    var hubConnection = new HubConnectionBuilder()
      .withUrl("https://domain..../v1/instruments/instrumentHub", {
        headers: {
          "Ocp-Apim-Subscription-Key": "Dummy Data"
        },
        withCredentials: false,
        transport: HttpTransportType.ServerSentEvents,
      .configureLogging(LogLevel.Trace)
      .build();

    hubConnection.start().then(() => {
      console.log(1)
    }).catch((e) => {
      console.log('error', e)
    })
  }


The above code will respond with
{ "statusCode": 404, "message": "Resource not found" }
{ "statusCode": 404, "message": "Resource not found" }


If I tried with
        withCredentials: false,
        skipNegotiation: true,
        transport: HttpTransportType.WebSockets,
        withCredentials: false,
        skipNegotiation: true,
        transport: HttpTransportType.WebSockets,


This is what I get
[2024-04-01T05:07:51.737Z] Debug: HubConnection failed to start successfully because of error 'Error: WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.'.
[2024-04-01T05:07:51.737Z] Debug: HubConnection failed to start successfully because of error 'Error: WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.'.


If I don't
skipNegotiation
skipNegotiation
-> Then its a CORS error

I have tried almost everything that I am aware of.... I have also enabled WebSockets in the App Services Configuration
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Missing dll on Azure App Service deployment
C#CC# / help
15mo ago
❔ Publish the API app to Azure App Service
C#CC# / help
4y ago
✅ Azure app service Web API project not running
C#CC# / help
2y ago