You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-signalr/signalr-quickstart-dotnet-core.md
+12-9Lines changed: 12 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ Ready to start?
32
32
## Prerequisites
33
33
34
34
* Install the [.NET Core SDK](https://dotnet.microsoft.com/download).
35
-
* Download or clone the [AzureSignalR-sample](https://github.com/aspnet/AzureSignalR-samples) GitHub repository.
35
+
* Download or clone the [AzureSignalR-sample](https://github.com/aspnet/AzureSignalR-samples) GitHub repository.
36
36
37
37
Having issues? Try the [troubleshooting guide](signalr-howto-troubleshoot-guide.md) or [let us know](https://aka.ms/asrs/qsnetcore).
38
38
@@ -42,7 +42,7 @@ Having issues? Try the [troubleshooting guide](signalr-howto-troubleshoot-guide.
42
42
43
43
## Create an ASP.NET Core web app
44
44
45
-
In this section, you use the [.NET Core command-line interface (CLI)](/dotnet/core/tools/) to create an ASP.NET Core MVC web app project. The advantage of using the .NET Core CLI over Visual Studio is that it's available across the Windows, macOS, and Linux platforms.
45
+
In this section, you use the [.NET Core command-line interface (CLI)](/dotnet/core/tools/) to create an ASP.NET Core MVC web app project. The advantage of using the .NET Core CLI over Visual Studio is that it's available across the Windows, macOS, and Linux platforms.
46
46
47
47
1. Create a folder for your project. This quickstart uses the *E:\Testing\chattest* folder.
48
48
@@ -82,13 +82,19 @@ In this section, you'll add the [Secret Manager tool](/aspnet/core/security/app-
82
82
dotnet add package Microsoft.Azure.SignalR
83
83
```
84
84
85
-
2. Run the following command to restore packages for your project:
85
+
1. Run the following command to restore packages for your project:
86
86
87
87
```dotnetcli
88
88
dotnet restore
89
89
```
90
90
91
-
3. Add a secret named *Azure:SignalR:ConnectionString* to Secret Manager.
91
+
1. Prepare the Secret Manager for use with this project.
92
+
93
+
````dotnetcli
94
+
dotnet user-secrets init
95
+
````
96
+
97
+
1. Add a secret named *Azure:SignalR:ConnectionString* to Secret Manager.
92
98
93
99
This secret will contain the connection string to access your SignalR Service resource. *Azure:SignalR:ConnectionString* is the default configuration key that SignalR looks for to establish a connection. Replace the value in the following command with the connection string for your SignalR Service resource.
94
100
@@ -102,8 +108,7 @@ In this section, you'll add the [Secret Manager tool](/aspnet/core/security/app-
102
108
103
109
This secret is accessed with the Configuration API. A colon (:) works in the configuration name with the Configuration API on all supported platforms. See [Configuration by environment](/dotnet/core/extensions/configuration-providers#environment-variable-configuration-provider).
104
110
105
-
106
-
4. Open *Startup.cs* and update the `ConfigureServices` method to use Azure SignalR Service by calling the `AddSignalR()` and `AddAzureSignalR()` methods:
111
+
1. Open *Startup.cs* and update the `ConfigureServices` method to use Azure SignalR Service by calling the `AddSignalR()` and `AddAzureSignalR()` methods:
107
112
108
113
```csharp
109
114
public void ConfigureServices(IServiceCollection services)
@@ -115,7 +120,7 @@ In this section, you'll add the [Secret Manager tool](/aspnet/core/security/app-
115
120
116
121
Not passing a parameter to `AddAzureSignalR()` causes this code to use the default configuration key for the SignalR Service resource connection string. The default configuration key is *Azure:SignalR:ConnectionString*.
117
122
118
-
5. In *Startup.cs*, update the `Configure` method by replacing it with the following code.
123
+
1. In *Startup.cs*, update the `Configure` method by replacing it with the following code.
119
124
120
125
```csharp
121
126
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
@@ -341,7 +346,6 @@ In this section, you'll add a development runtime environment for ASP.NET Core.
341
346
}
342
347
```
343
348
344
-
345
349
## Build and run the app locally
346
350
347
351
1. To build the app by using the .NET Core CLI, run the following command in the command shell:
@@ -375,7 +379,6 @@ In this section, you'll add a development runtime environment for ASP.NET Core.
375
379
376
380

377
381
378
-
379
382
## Clean up resources
380
383
381
384
If you'll continue to the next tutorial, you can keep the resources created in this quickstart and reuse them.
0 commit comments