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/concept-connection-string.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,32 +37,32 @@ The connection string contains:
37
37
38
38
The following table lists all the valid names for key/value pairs in the connection string.
39
39
40
-
| Key | Description | Required | Default value| Example value
41
-
| --- | --- | --- | --- | --- |
42
-
| Endpoint | The URL of your ASRS instance. | Y | N/A |`https://foo.service.signalr.net`|
43
-
| Port | The port that your ASRS instance is listening on. on. | N| 80/443, depends on the endpoint URI schema | 8080|
44
-
| Version| The version of given connection. string. | N| 1.0 | 1.0 |
45
-
| ClientEndpoint | The URI of your reverse proxy, such as the App Gateway or API. Management | N| null |`https://foo.bar`|
46
-
| AuthType | The auth type. By default the service uses the AccessKey authorize requests. **Case insensitive**| N | null | Azure, azure.msi, azure.app |
40
+
| Key | Description | Required | Default value| Example value |
| Endpoint | The URL of your ASRS instance. | Y | N/A |`https://foo.service.signalr.net`|
43
+
| Port | The port that your ASRS instance is listening on. on. | N| 80/443, depends on the endpoint URI schema | 8080|
44
+
| Version| The version of given connection. string. | N| 1.0 | 1.0|
45
+
| ClientEndpoint | The URI of your reverse proxy, such as the App Gateway or API. Management | N| null |`https://foo.bar`|
46
+
| AuthType | The auth type. By default the service uses the AccessKey authorize requests. **Case insensitive**| N | null | Azure, azure.msi, azure.app|
47
47
48
48
### Use AccessKey
49
49
50
50
The local auth method is used when `AuthType` is set to null.
51
51
52
-
| Key | Description| Required | Default value | Example value|
53
-
| --- | --- | --- | --- | --- |
54
-
| AccessKey | The key string in base64 format for building access token. | Y | null | ABCDEFGHIJKLMNOPQRSTUVWEXYZ0123456789+=/ |
52
+
| Key | Description| Required | Default value | Example value|
- [ManagedIdentityCredential(clientId)](/dotnet/api/azure.identity.managedidentitycredential) is used.
86
86
87
87
1. A system-assigned managed identity is used.
@@ -140,7 +140,7 @@ For more information about how to authenticate using Azure AD application, see [
140
140
141
141
## Authenticate with Managed identity
142
142
143
-
You can also use a system assigned or user assigned [managed identity](../active-directory/managed-identities-azure-resources/overview.md) to authenticate with SignalR service.
143
+
You can also use a system assigned or user assigned [managed identity](../active-directory/managed-identities-azure-resources/overview.md) to authenticate with SignalR service.
144
144
145
145
To use a system assigned identity, add `AuthType=azure.msi` to the connection string:
146
146
@@ -163,7 +163,7 @@ For more information about how to configure managed identity, see [Authorize fro
163
163
164
164
### Use the connection string generator
165
165
166
-
It may be cumbersome and error-prone to build connection strings manually. To avoid making mistakes, SignalR provides a connection string generator to help you generate a connection string that includes Azure AD identities like `clientId`, `tenantId`, etc. To use the tool open your SignalR instance in Azure portal, select **Connection strings** from the left side menu.
166
+
It may be cumbersome and error-prone to build connection strings manually. To avoid making mistakes, SignalR provides a connection string generator to help you generate a connection string that includes Azure AD identities like `clientId`, `tenantId`, etc. To use the tool open your SignalR instance in Azure portal, select **Connection strings** from the left side menu.
167
167
168
168
:::image type="content" source="media/concept-connection-string/generator.png" alt-text="Screenshot showing connection string generator of SignalR service in Azure portal.":::
169
169
@@ -178,7 +178,7 @@ For more information about how access tokens are generated and validated, see [A
178
178
179
179
A connection string contains the HTTP endpoint for app server to connect to SignalR service. The server returns the HTTP endpoint to the clients in a negotiate response, so the client can connect to the service.
180
180
181
-
In some applications, there may be an extra component in front of SignalR service. All client connections need to go through that component first. For example, [Azure Application Gateway](../application-gateway/overview.md) is a common service that provides additional network security.
181
+
In some applications, there may be an extra component in front of SignalR service. All client connections need to go through that component first. For example, [Azure Application Gateway](../application-gateway/overview.md) is a common service that provides additional network security.
182
182
183
183
In such case, the client needs to connect to an endpoint different than SignalR service. Instead of manually replacing the endpoint at the client side, you can add `ClientEndpoint` to connection string:
Or you can call `AddAzureSignalR()` without any arguments. The service SDK returns the connection string from a config named `Azure:SignalR:ConnectionString` in your [configuration provider](/dotnet/core/extensions/configuration-providers).
208
208
209
-
In a local development environment, the configuration is stored in a file (*appsettings.json* or *secrets.json*) or environment variables. You can use one of the following ways to configure connection string:
209
+
In a local development environment, the configuration is stored in a file (_appsettings.json_ or _secrets.json_) or environment variables. You can use one of the following ways to configure connection string:
210
210
211
211
- Use .NET secret manager (`dotnet user-secrets set Azure:SignalR:ConnectionString "<connection_string>"`)
212
-
- Set an environment variable named `Azure__SignalR__ConnectionString` to the connection string. The colons need to be replaced with double underscore in the [environment variable configuration provider](/dotnet/core/extensions/configuration-providers#environment-variable-configuration-provider).
212
+
- Set an environment variable named `Azure__SignalR__ConnectionString` to the connection string. The colons need to be replaced with double underscore in the [environment variable configuration provider](/dotnet/core/extensions/configuration-providers#environment-variable-configuration-provider).
213
213
214
214
In a production environment, you can use other Azure services to manage config/secrets like Azure [Key Vault](../key-vault/general/overview.md) and [App Configuration](../azure-app-configuration/overview.md). See their documentation to learn how to set up configuration provider for those services.
215
215
216
216
> [!NOTE]
217
-
> Even when you're directly setting a connection string using code, it's not recommended to hardcode the connection string in source code You should read the connection string from a secret store like key vault and pass it to `AddAzureSignalR()`.
217
+
> Even when you're directly setting a connection string using code, it's not recommended to hardcode the connection string in source code You should read the connection string from a secret store like key vault and pass it to `AddAzureSignalR()`.
218
218
219
219
### Configure multiple connection strings
220
220
@@ -252,4 +252,4 @@ There are also two ways to configure multiple instances:
0 commit comments