Aspnetcore.docs: Provide guidance on SignalR Service modes when using with Blazor Server

Created on 8 Jun 2020  Â·  12Comments  Â·  Source: dotnet/AspNetCore.Docs

At the time of writing, Azure SignalR Service offers the following 3 services modes:

  1. Serverless
  2. Default
  3. Classic

There should be guidance in the following section that explains which mode should be used and why: https://docs.microsoft.com/aspnet/core/host-and-deploy/blazor/server#azure-signalr-service. I've used Classic mode in the past, but is there ever a good reason to select Default?

/cc: @sffamily @bradygaster


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Blazor P2 Source - Docs.ms doc-enhancement

Most helpful comment

Will do ... I'll be able to take care of this tomorrow (Friday, 8/6). Will hit u up for the review.

All 12 comments

"mode" seems to only be mentioned explicitly in one spot in this SignalR doc set ...

If you're using Azure SignalR Service in Serverless mode, you cannot call hub methods from a client.

Reference:

In Azure docs ...

Azure SignalR Service can be configured in different modes. When used with Azure Functions, the service must be configured in Serverless mode.

Reference: https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-concept-serverless-development-config#signalr-service-configuration

After the instance is deployed, open it in the portal and locate its Settings page. Change the Service Mode setting to Serverless.

Reference: https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-tutorial-authenticate-azure-functions#create-an-azure-signalr-service-instance

Serverless mode is not supported for ASP.NET SignalR applications. Always use Default or Classic for the Azure SignalR Service instance.

Reference: https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-quickstart-dotnet#create-an-azure-signalr-service-instance

From https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-concept-event-grid-integration#serverless-state, they link to the following ...

https://github.com/Azure/azure-signalr/blob/dev/docs/faq.md#what-is-the-meaning-of-service-mode-defaultserverlessclassic-how-can-i-choose

... which states ...

Modes:

  • Default mode requires hub server. When there is no server connection available for the hub, the client tries to connect to this hub fails.
  • Serverless mode does NOT allow any server connection, i.e. it will reject all server connections, all clients must in serverless mode.

Classic mode is a mixed status. When a hub has server connection, the new client will be routed to hub server, if not, client will enter serverless mode.

This may cause some problem, for example, all of server connections are lost for a moment, some clients will enter serverless mode, instead of route to hub server.

Choosing:

  • No hub server, choose Serverless.
  • All of hubs have hub servers, choose Default.
  • Some of hubs have hub servers, others not, choose Classic, but this may cause some problem, the better way is create two instances, one is Serverless, another is Default.

I'm not sure that that's the only spot to cover it. This seems like general guidance. I'll wait for feedback on where to cover it before proceeding.

It would be nice to cross-link to what they have ... but it's in a GH readme 🙈.

In addition to where, either ...

  • A SignalR :cat2: should provide the exact text if we aren't going to cross-link ... provide the text in a comment here if you want.
  • Let me know if it's the Default mode or the Classic mode that should be pushed, and I'll try to write it in that way.

@guardrex I was chatting offline with @sffamily about this. Let's see what Zhidi recommends.

This indeed seems to be something to be documented on the SignalR side.

Having said that, I don't think there is much from the Blazor side we want here.

I'll work it as a SignalR issue unless @bradygaster and/or @scottaddie say otherwise. Plz go ahead and reassign it if anyone else should work it.

@bradygaster who is the best person to document this for SignalR ? I'm removing this from the Blazor docs project.

Will do - will reach out to our friends in the service team to get this carved out with them. There's another doc update I'd like to make on using the service so this is good timing.

Thanks for following up, @bradygaster. Just saw their response.
@scottaddie the recommendation here is to use the default mode. As the other modes either nor recommended or won't work - let's not even bother mentioning those.

The only coverage in this doc set is ...

If you're using Azure SignalR Service in Serverless mode, you cannot call hub methods from a client.

I list the topics (looks like that's in three spots) above :point_up:. The remark can be refactored in favor of an explicit remark to use Default.

@scottaddie ... I can remain assigned and work this if u want or ur welcome to it.

I'm fine with either, but I know @scottaddie is super-slammed and has little time for this (I asked yesterday!). @guardrex if you have time put me on as reviewer.

Will do ... I'll be able to take care of this tomorrow (Friday, 8/6). Will hit u up for the review.

Was this page helpful?
0 / 5 - 0 ratings