azure-signalr-dev - Microsoft.Azure.SignalR.Serverless.Protocols 1.4.1

Package Description

PM> Install-Package Microsoft.Azure.SignalR.Serverless.Protocols -Version 1.4.1 -Source https://www.myget.org/F/azure-signalr-dev/api/v3/index.json

Copy to clipboard

> nuget.exe install Microsoft.Azure.SignalR.Serverless.Protocols -Version 1.4.1 -Source https://www.myget.org/F/azure-signalr-dev/api/v3/index.json

Copy to clipboard

> dotnet add package Microsoft.Azure.SignalR.Serverless.Protocols --version 1.4.1 --source https://www.myget.org/F/azure-signalr-dev/api/v3/index.json

Copy to clipboard
<PackageReference Include="Microsoft.Azure.SignalR.Serverless.Protocols" Version="1.4.1" />
Copy to clipboard
source https://www.myget.org/F/azure-signalr-dev/api/v3/index.json

nuget Microsoft.Azure.SignalR.Serverless.Protocols  ~> 1.4.1
Copy to clipboard

> choco install Microsoft.Azure.SignalR.Serverless.Protocols --version 1.4.1 --source https://www.myget.org/F/azure-signalr-dev/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "azure-signalr-dev" -SourceLocation "https://www.myget.org/F/azure-signalr-dev/api/v2"
Install-Module -Name "Microsoft.Azure.SignalR.Serverless.Protocols" -RequiredVersion "1.4.1" -Repository "azure-signalr-dev" 
Copy to clipboard

Azure Functions Bindings for Azure SignalR Service

Build Status

Travis: travis

NuGet Packages

Package Name Target Framework NuGet
Microsoft.Azure.WebJobs.Extensions.SignalRService .NET Core App 2.1
.NET Core App 3.1
NuGet

Intro

These bindings allow Azure Functions to integrate with Azure SignalR Service.

Supported scenarios

  • Allow clients to serverlessly connect to a SignalR Service hub without requiring an ASP.NET Core backend
  • Use Azure Functions (any language supported by V2) to broadcast messages to all clients connected to a SignalR Service hub.
  • Use Azure Functions (any language supported by V2) to send messages to a single user, or all the users in a group.
  • Use Azure Functions (any language supported by V2) to manage group users like add/remove a single user in a group.
  • Example scenarios include: broadcast messages to a SignalR Service hub on HTTP requests and events from Cosmos DB change feed, Event Hub, Event Grid, etc
  • Use multiple Azure SignalR Service instances for resiliency and disaster recovery in Azure Functions. See details in Multiple SignalR service endpoint support.

Bindings

SignalRConnectionInfo input binding makes it easy to generate the token required for clients to initiate a connection to Azure SignalR Service.

SignalR output binding allows messages to be broadcast to an Azure SignalR Service hub.

Prerequisites

Usage

Create Azure SignalR Service instance

  1. Create Azure SignalR Service instances in the Azure Portal. Note the connection strings, you'll need them later.

Create Function App with extension

  1. In a new folder, create a new Azure Functions app.
    • func init
  2. Install this Functions extension.
    • func extensions install -p Microsoft.Azure.WebJobs.Extensions.SignalRService -v 1.0.0

Add application setting for SignalR connection string

  1. Create an app setting called AzureSignalRConnectionString with the SignalR connection string.
    • On localhost, use local.settings.json
    • In Azure, use App Settings

Using the SignalRConnectionInfo input binding

In order for a client to connect to SignalR, it needs to obtain the SignalR Service client hub URL and an access token.

  1. Create a new function named negotiate and use the SignalRConnectionInfo input binding to obtain the connection information and return it. Take a look at this sample.
  2. Client connects to the negotiate function as it's a normal SignalR hub. See this file for a sample usage.

Binding schema:

{
  "type": "signalRConnectionInfo",
  "name": "connectionInfo",
  "hubName": "<hub_name>",
  "connectionStringSetting": "<setting_name>", // Defaults to AzureSignalRConnectionString
  "direction": "in"
}

Using the SignalR output binding

The SignalR output binding can be used to broadcast messages to all clients connected a hub. Take a look at this sample:

Binding schema:

{
  "type": "signalR",
  "name": "signalRMessages", // name of the output binding
  "hubName": "<hub_name>",
  "connectionStringSetting": "<setting_name>", // Defaults to AzureSignalRConnectionString
  "direction": "out"
}

To send one or more messages, set the output binding to an array of objects:

module.exports = function (context, req) {
  context.bindings.signalRMessages = [{
    "target": "newMessage", // name of the client method to invoke
    "arguments": [
      req.body // arguments to pass to client method
    ]
  }];
  context.done();
};

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

  • .NETStandard 2.0
    • MessagePack (>= 1.9.11)
    • Microsoft.AspNetCore.SignalR.Protocols.MessagePack (>= 1.1.5)
    • Newtonsoft.Json (>= 12.0.2)
    • System.Memory (>= 4.5.3)
  • .NETStandard 2.0: 2.0.0.0

Owners

JialinXin Yang Zitong Liangying Chenyang Liu

Authors

Microsoft

Project URL

https://github.com/Azure/azure-functions-signalrservice-extension

License

MIT

Info

2951 total downloads
73 downloads for version 1.4.1
Download (19.28 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
1.11.2-preview1-11354 40.84 KB Fri, 07 Nov 2025 02:04:18 GMT 5
1.11.2-preview1-11350 40.83 KB Tue, 28 Oct 2025 08:29:56 GMT 22
1.11.2-preview1-11349 40.84 KB Mon, 29 Sep 2025 03:48:57 GMT 34
1.11.2-preview1-11348 40.84 KB Fri, 26 Sep 2025 04:48:47 GMT 43
1.11.2-preview1-11347 40.84 KB Fri, 12 Sep 2025 08:15:45 GMT 47
1.11.2-preview1-11346 40.83 KB Thu, 11 Sep 2025 06:35:03 GMT 46
1.11.2-preview1-11345 40.84 KB Wed, 10 Sep 2025 02:41:09 GMT 53
1.11.2-preview1-11341 40.83 KB Mon, 11 Aug 2025 09:52:00 GMT 62
1.11.2-preview1-11340 40.83 KB Mon, 11 Aug 2025 06:00:58 GMT 64
1.11.2-preview1-11339 40.84 KB Fri, 08 Aug 2025 08:38:28 GMT 67
1.11.2-preview1-11335 40.83 KB Tue, 05 Aug 2025 01:12:41 GMT 60
1.11.2-preview1-11329 53.45 KB Mon, 30 Jun 2025 06:48:31 GMT 66
1.11.2-preview1-11328 53.45 KB Mon, 23 Jun 2025 06:46:26 GMT 71
1.11.2-preview1-11327 53.5 KB Thu, 19 Jun 2025 03:20:33 GMT 76
1.11.2-preview1-11326 53.45 KB Wed, 28 May 2025 03:42:08 GMT 68
1.11.2-preview1-11325 53.45 KB Tue, 20 May 2025 02:29:37 GMT 55
1.11.2-preview1-11324 53.45 KB Tue, 29 Apr 2025 09:33:51 GMT 65
1.11.2-preview1-11323 53.45 KB Fri, 25 Apr 2025 03:14:47 GMT 62
1.11.1-preview1-11318 53.45 KB Mon, 17 Mar 2025 19:20:58 GMT 59
1.11.1-preview1-11317 53.43 KB Wed, 12 Mar 2025 07:23:29 GMT 63
1.11.1-preview1-11316 53.45 KB Tue, 11 Mar 2025 06:22:31 GMT 73
1.11.0 29.04 KB Wed, 22 Jan 2025 02:33:31 GMT 77
1.10.1-preview1-11278 29.08 KB Tue, 10 Dec 2024 04:36:00 GMT 79
1.10.1-preview1-11277 29.07 KB Mon, 09 Dec 2024 07:29:34 GMT 74
1.10.1-preview1-11273 28.12 KB Thu, 05 Dec 2024 08:40:16 GMT 79
1.10.1-preview1-11207 28.93 KB Thu, 08 Aug 2024 10:12:09 GMT 57
1.10.1-preview1-11206 28.93 KB Tue, 06 Aug 2024 03:13:02 GMT 76
1.10.1-preview1-11205 28.93 KB Fri, 02 Aug 2024 05:21:27 GMT 74
1.10.1-preview1-11204 28.92 KB Fri, 02 Aug 2024 04:14:14 GMT 77
1.10.1-preview1-11203 28.93 KB Thu, 01 Aug 2024 09:29:53 GMT 84
1.10.1-preview1-11156 28.8 KB Fri, 22 Mar 2024 07:58:16 GMT 76
1.10.0 28.75 KB Wed, 31 Jan 2024 09:02:07 GMT 71
1.10.0-preview1-11154 28.79 KB Fri, 01 Mar 2024 04:28:24 GMT 70
1.10.0-preview1-11152 28.8 KB Wed, 21 Feb 2024 09:03:31 GMT 84
1.9.0 49.54 KB Wed, 15 Jun 2022 07:52:21 GMT 78
1.9.0-preview1-10984 49.58 KB Wed, 08 Jun 2022 05:34:00 GMT 75
1.6.0 19.25 KB Mon, 13 Sep 2021 07:29:07 GMT 70
1.5.0 19.25 KB Fri, 16 Jul 2021 05:29:41 GMT 63
1.4.2 19.26 KB Wed, 16 Jun 2021 03:19:44 GMT 67
1.4.1 19.28 KB Tue, 25 May 2021 04:36:44 GMT 73
1.4.0 19.28 KB Wed, 12 May 2021 06:52:47 GMT 75
1.3.0 19.25 KB Fri, 19 Mar 2021 06:01:55 GMT 84
1.2.2 22.83 KB Thu, 10 Dec 2020 04:36:58 GMT 75
1.2.1 19.26 KB Fri, 18 Sep 2020 02:32:56 GMT 76
1.2.0 19.26 KB Mon, 01 Jun 2020 08:28:47 GMT 76