Skip to content

Commit 3a988d8

Browse files
Add C# input attribute
1 parent d52cc81 commit 3a988d8

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

articles/azure-functions/functions-bindings-signalr-service.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ Before a client can connect to Azure SignalR Service, it must retrieve the servi
2828

2929
For more information on how this binding is used to create a "negotiate" function that can be consumed by a SignalR client SDK, see the [Azure Functions development and configuration article](../azure-signalr/signalr-concept-serverless-development-config.md) in the SignalR Service concepts documentation.
3030

31-
### Examples
32-
3331
# [C#](#tab/csharp)
3432

3533
The following example shows a [C# function](functions-dotnet-class-library.md) that acquires SignalR connection information using the input binding and returns it over HTTP.
@@ -102,7 +100,19 @@ public SignalRConnectionInfo negotiate(
102100

103101
# [C#](#tab/csharp)
104102

105-
**TODO**
103+
The [SignalRConnectionInfo](https://github.com/Azure/azure-functions-signalrservice-extension/blob/dev/src/SignalRServiceExtension/SignalRConnectionInfoAttribute.cs) attribute allows you to specify a `HubName`, `UserId` and `IdToken`.
104+
105+
The following example demonstrates how to assign a hub name in the function.
106+
107+
```cs
108+
[FunctionName("negotiate")]
109+
public static SignalRConnectionInfo Negotiate(
110+
[HttpTrigger(AuthorizationLevel.Anonymous)]HttpRequest req,
111+
[SignalRConnectionInfo(HubName = "chat")]SignalRConnectionInfo connectionInfo)
112+
{
113+
return connectionInfo;
114+
}
115+
```
106116

107117
# [C# Script](#tab/csharp-script)
108118

0 commit comments

Comments
 (0)