Skip to content

Commit e82a01e

Browse files
committed
minor update.
1 parent d52bdd8 commit e82a01e

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

samples/BlazorChat/README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ From Visual Studio 2019 version 16.2.0, Azure SignalR Service is build-in web ap
3232
dotnet new blazorserver -o BlazorChat
3333
```
3434

35-
2. Add a `ChutHub.cs` file to implement `Hub` for chat.
35+
2. Add a `BlazorChatSampleHub.cs` file to implement `Hub` for chat.
3636

3737
```cs
3838
using System;
@@ -65,7 +65,7 @@ From Visual Studio 2019 version 16.2.0, Azure SignalR Service is build-in web ap
6565
}
6666
```
6767

68-
3. Update `Configure()` function in `Startup.cs` to map the chat hub.
68+
3. Add an endpoint for the hub in `Startup.Configure()`.
6969

7070
```cs
7171
app.UseEndpoints(endpoints =>
@@ -78,7 +78,7 @@ From Visual Studio 2019 version 16.2.0, Azure SignalR Service is build-in web ap
7878

7979
4. Install `Microsoft.AspNetCore.SignalR.Client` package to use SignalR client.
8080

81-
```dotnetcli
81+
```cmd
8282
dotnet add package Microsoft.AspNetCore.SignalR.Client --version 3.1.7
8383
```
8484

@@ -205,8 +205,8 @@ From Visual Studio 2019 version 16.2.0, Azure SignalR Service is build-in web ap
205205
}
206206
```
207207
208-
3. Add render part before `@code` for UI to interact with SignalR client.
209-
208+
3. Add rendering part before `@code` for UI to interact with SignalR client.
209+
210210
```razor
211211
<h1>Blazor SignalR Chat Sample</h1>
212212
<hr />
@@ -336,15 +336,15 @@ From Visual Studio 2019 version 16.2.0, Azure SignalR Service is build-in web ap
336336
}
337337
```
338338

339-
8. Click `F5` to run the app. You'll be able to chat like below.
339+
8. Click <kbd>F5</kbd> to run the app. You'll be able to chat like below.
340340

341341
![blazorchat](../../docs/images/blazorchat.gif)
342342

343343
## Publish to Azure App Service and migrate to Azure SignalR Service
344344

345345
So far, the Blazor App is working on local SignalR and when deploy to Azure App Service, it's suggested to use [Azure SignalR Service](https://docs.microsoft.com/en-us/aspnet/core/signalr/scale?view=aspnetcore-3.1#azure-signalr-service) which allows for scaling up a Blazor Server app to a large number of concurrent SignalR connections. In addition, the SignalR service's global reach and high-performance data centers significantly aid in reducing latency due to geography.
346346

347-
> Note
347+
> IMPORTANT
348348
>
349349
> In Blazor Server app, UI states are maintained at server side which means server sticky is required in this case. If there's single app server, server sticky is ensured by design. However, if there're multiple app servers, there's a chance that client negotiation and connection may go to different servers and leads to UI errors in Blazor app. So you need to enable server sticky like below in `appsettings.json`:
350350
> ```json
@@ -379,19 +379,19 @@ From Visual Studio 2019 version 16.2.0, Azure SignalR Service is build-in web ap
379379
380380
Now it's ready to publish. And it'll auto browser the page after publishing completes.
381381
> It may not immediately work in the first time visiting page due to Azure Web App deployment start up latency and try refresh the page to give some delay.
382-
> Besides, you can use browser debugger mode with `F12` to validate the traffic has already redirect to Azure SignalR Service.
382+
> Besides, you can use browser debugger mode with <kbd>F12</kbd> to validate the traffic has already redirect to Azure SignalR Service.
383383
384384
![blazorchat-azure](../../docs/images/blazorchat-azure.png)
385385
386386
## Further topic: Enable Azure SignalR Service in local development
387387
388388
1. Add reference to Azure SignalR SDK
389389
390-
```dotnetcli
390+
```cmd
391391
dotnet add package Microsoft.Azure.SignalR --version 1.5.1
392392
```
393393
394-
2. Add a call to Azure SignalR Service in [Startup.cs](Startup.cs)
394+
2. Add a call to Azure SignalR Service in in `Startup.ConfigureServices()`.
395395

396396
```cs
397397
public void ConfigureServices(IServiceCollection services)
@@ -402,11 +402,11 @@ From Visual Studio 2019 version 16.2.0, Azure SignalR Service is build-in web ap
402402
}
403403
```
404404

405-
3. Configure Azure SignalR Service `ConnectionString` either in [appsetting.json](appsettings.json) or with [Secret Manager](https://docs.microsoft.com/en-us/aspnet/core/security/app-secrets?view=aspnetcore-2.1&tabs=visual-studio#secret-manager) tool
405+
3. Configure Azure SignalR Service `ConnectionString` either in [appsetting.json](appsettings.json) or with [Secret Manager](https://docs.microsoft.com/aspnet/core/security/app-secrets?view=aspnetcore-3.1&tabs=visual-studio#secret-manager) tool.
406406

407-
> Note
407+
> NOTE
408408
>
409-
> Step 3 can be replaced by using hosting startup assemblies to SignalR SDK.
409+
> Step 2 can be replaced by using [`HostingStartupAssembly`](https://docs.microsoft.com/aspnet/core/fundamentals/host/platform-specific-configuration?view=aspnetcore-3.1) to SignalR SDK.
410410
>
411411
> 1. Add configuration to turn on Azure SignalR Service in [appsetting.json](appsettings.json)
412412
> ```js

0 commit comments

Comments
 (0)