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
::: zone pivot="programming-language-javascript,programming-language-python,programming-language-powershell"
50
49
51
-
The following example shows a SignalR connection info input binding in a *function.json* file and a function that uses the binding to return the connection information.
50
+
::: zone pivot="programming-language-python,programming-language-powershell"
52
51
53
-
Here's binding data for the example in the *function.json* file:
54
-
55
-
```json
56
-
{
57
-
"type": "signalRConnectionInfo",
58
-
"name": "connectionInfo",
59
-
"hubName": "chat",
60
-
"connectionStringSetting": "<name of setting containing SignalR Service connection string>",
@@ -124,14 +140,16 @@ When an authenticated client triggers the function, you can add a user ID claim
124
140
125
141
App Service authentication sets HTTP headers named `x-ms-client-principal-id` and `x-ms-client-principal-name` that contain the authenticated user's client principal ID and name, respectively.
126
142
143
+
You can set the `UserId` property of the binding to the value from either header using a [binding expression](#binding-expressions-for-http-trigger): `{headers.x-ms-client-principal-id}` or `{headers.x-ms-client-principal-name}`.
// The serialization of the connection info object is done by the framework. It should be camel case. The SignalR client respects the camel case response only.
137
155
returnconnectionInfo;
@@ -140,14 +158,13 @@ public static string Negotiate([HttpTrigger(AuthorizationLevel.Anonymous)] HttpR
140
158
141
159
# [In-process model](#tab/in-process)
142
160
143
-
You can set the `UserId` property of the binding to the value from either header using a [binding expression](#binding-expressions-for-http-trigger): `{headers.x-ms-client-principal-id}` or `{headers.x-ms-client-principal-name}`.
::: zone pivot="programming-language-javascript,programming-language-python,programming-language-powershell"
178
-
179
-
You can set the `userId` property of the binding to the value from either header using a [binding expression](#binding-expressions-for-http-trigger): `{headers.x-ms-client-principal-id}` or `{headers.x-ms-client-principal-name}`.
194
+
::: zone pivot="programming-language-python,programming-language-powershell"
180
195
181
196
Here's binding data in the *function.json* file:
182
197
183
198
```json
184
199
{
185
200
"type": "signalRConnectionInfo",
186
201
"name": "connectionInfo",
187
-
"hubName": "chat",
202
+
"hubName": "hubName1",
188
203
"userId": "{headers.x-ms-client-principal-id}",
189
204
"connectionStringSetting": "<name of setting containing SignalR Service connection string>",
190
205
"direction": "in"
@@ -195,14 +210,50 @@ Here's binding data in the *function.json* file:
You can set the `userId` property of the binding to the value from either header using a [binding expression](#binding-expressions-for-http-trigger): `{headers.x-ms-client-principal-id}` or `{headers.x-ms-client-principal-name}`.
232
-
233
282
```java
234
283
@FunctionName("negotiate")
235
284
publicSignalRConnectionInfo negotiate(
@@ -239,7 +288,7 @@ public SignalRConnectionInfo negotiate(
@@ -281,6 +330,22 @@ The following table explains the properties of the `SignalRConnectionInfo` attri
281
330
::: zone-end
282
331
::: zone pivot="programming-language-java"
283
332
333
+
## Annotations
334
+
335
+
The following table explains the supported settings for the `SignalRConnectionInfoInput` annotation.
336
+
337
+
|Setting | Description|
338
+
|---------|--------|
339
+
|**name**| Variable name used in function code for connection info object. |
340
+
|**hubName**| Required. The hub name. |
341
+
|**connectionStringSetting**| The name of the app setting that contains the SignalR Service connection string, which defaults to `AzureSignalRConnectionString`. |
342
+
|**userId**| Optional. The user identifier of a SignalR connection. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to an HTTP request header or query. |
343
+
|**idToken**| Optional. A JWT token whose claims will be added to the user claims. It should be used together with **claimTypeList**. You can use a [binding expression](#binding-expressions-for-http-trigger) to bind the value to an HTTP request header or query. |
344
+
|**claimTypeList**| Optional. A list of claim types, which filter the claims in **idToken** . |
345
+
346
+
::: zone-end
347
+
348
+
::: zone pivot="programming-language-javascript"
284
349
285
350
## Annotations
286
351
@@ -296,7 +361,8 @@ The following table explains the supported settings for the `SignalRConnectionIn
296
361
|**claimTypeList**| Optional. A list of claim types, which filter the claims in **idToken** . |
297
362
298
363
::: zone-end
299
-
::: zone pivot="programming-language-javascript,programming-language-powershell,programming-language-python"
364
+
365
+
::: zone pivot="programming-language-powershell,programming-language-python"
300
366
## Configuration
301
367
302
368
The following table explains the binding configuration properties that you set in the *function.json* file.
0 commit comments