1

I'm trying to set a new environnement for a website in a Linux Azure Web App with B1 plan.

My production website is working perfectly with a B2 plant ( also in Linux ). But with this new environnement, I get this error :

[2021-08-19T09:01:46.572Z] Error: Failed to start the transport 'WebSockets': Error: There was an error with the transport.

Of course, all settings for web sockets are set :

Azure Web App Settings

I have a custom subdomain for this webapp with a valid SSL

DNS

As I say all is working in production with the same code base version. I have the exactly same issue with the admin panel... I don't know why this come with this new website that share the same pipeline, release etc...

OrcusZ
  • 3,555
  • 2
  • 31
  • 48
  • Have you checked this question? https://stackoverflow.com/questions/66805734/signalr-in-azure-app-service-not-working-for-websockets Some infos in the comments. – Nicola Biada Aug 19 '21 at 10:05
  • @NicolaBiada yep, I already checked a lot of SO questions ^^' – OrcusZ Aug 19 '21 at 11:48
  • 1
    Have you tried to export your B1 & B2 configuration from Azure and do a compare? – Nicola Biada Aug 19 '21 at 11:51
  • Have you an authorized Signalr endpoint? Try to convert to anonymous just for test. – Nicola Biada Aug 19 '21 at 11:53
  • @NicolaBiada I have workerSize & CurrentWorkerSize set to 0 in the B1 plan ( B2 plan have 1 ). And SignalR is fully manage by blazor, so not directly, but I get the error in anonymous pages – OrcusZ Aug 19 '21 at 12:41
  • Moving to the B2 plan makes app working.... – OrcusZ Aug 19 '21 at 12:48
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/236193/discussion-between-orcusz-and-nicola-biada). – OrcusZ Aug 19 '21 at 12:53

1 Answers1

0

Try to look at this issue on Github: https://github.com/dotnet/aspnetcore/issues/20636

The problem could be in the skipNegotiation parameter, you have to set it to false instead of true:

    var object = new signalR.HubConnectionBuilder()
      .withUrl(GAME_HUB_URL, {
        skipNegotiation: false,
        transport: signalR.HttpTransportType.WebSockets,
        accessTokenFactory: () => state.userReducer.user.token,
      })
      .configureLogging(signalR.LogLevel.Debug)
      .build();
Nicola Biada
  • 2,325
  • 1
  • 8
  • 22