Skip to content

Commit 28353cf

Browse files
authored
Merge pull request #49967 from wesmc7777/master
Update SignalR secret to use (:) with the config API
2 parents 5917d50 + 13b3683 commit 28353cf

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

articles/azure-signalr/signalr-quickstart-dotnet-core.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,21 @@ In this section, you will add the [Secret Manager tool](https://docs.microsoft.c
8989

9090
dotnet restore
9191

92-
3. Add a secret named *Azure__SignalR__ConnectionString* to Secret Manager. This secret is a hierarchical config value, and a colon (:) may not work on all platforms. Double underscore (__), as used by this secret, is supported by all platforms. 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 in order to establish a connection. Replace the value in the command below with the connection string for your SignalR Service resource.
92+
3. Add a secret named *Azure:SignalR:ConnectionString* to Secret Manager.
93+
94+
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 in order to establish a connection. Replace the value in the command below with the connection string for your SignalR Service resource.
9395

9496
This command must be executed in the same directory as the *.csproj* file.
9597

9698
```
97-
dotnet user-secrets set Azure__SignalR__ConnectionString "Endpoint=<Your endpoint>;AccessKey=<Your access key>;"
99+
dotnet user-secrets set Azure:SignalR:ConnectionString "Endpoint=<Your endpoint>;AccessKey=<Your access key>;"
98100
```
99101

100102
Secret Manager will only be used for testing the web app while it is hosted locally. In a later tutorial, you will deploy the chat web app to Azure. Once the web app is deployed to Azure, you will use an application setting instead of storing the connection string with Secret Manager.
101103

104+
This secret is a accessed with the configuration API. A colon (:) works in the configuration name with the configuration API on all supported platforms, see [Configuration by environment](https://docs.microsoft.com/aspnet/core/fundamentals/configuration/index?tabs=basicconfiguration&view=aspnetcore-2.0#configuration-by-environment).
105+
106+
102107
4. Open *Startup.cs* and update the `ConfigureServices` method to use Azure SignalR Service by calling the `services.AddSignalR().AddAzureSignalR()` method:
103108

104109
```csharp
@@ -109,7 +114,7 @@ In this section, you will add the [Secret Manager tool](https://docs.microsoft.c
109114
}
110115
```
111116

112-
By not passing a parameter to `AddAzureSignalR()`, this code uses the default configuration key, *Azure__SignalR__ConnectionString*, for the SignalR Service resource connection string.
117+
By not passing a parameter to `AddAzureSignalR()`, this code uses the default configuration key, *Azure:SignalR:ConnectionString*, for the SignalR Service resource connection string.
113118

114119
5. Also in *Startup.cs*, update the `Configure` method by replacing the call to `app.UseStaticFiles()` with the following code and save the file.
115120

0 commit comments

Comments
 (0)