title | description | ms.topic | ms.date | zone_pivot_groups |
---|---|---|---|---|
Azure Functions SignalR Service bindings |
Understand how to use SignalR Service bindings with Azure Functions. |
reference |
03/04/2022 |
programming-languages-set-functions-lang-workers |
This set of articles explains how to authenticate and send real-time messages to clients connected to Azure SignalR Service by using SignalR Service bindings in Azure Functions. Azure Functions runtime version 2.x and higher supports input and output bindings for SignalR Service.
Action | Type |
---|---|
Handle messages from SignalR Service | Trigger binding |
Return the service endpoint URL and access token | Input binding |
Send SignalR Service messages | Output binding |
::: zone pivot="programming-language-csharp"
The extension NuGet package you install depends on the C# mode you're using in your function app:
Functions execute in the same process as the Functions host. To learn more, see Develop C# class library functions using Azure Functions.
Add the extension to your project by installing this NuGet package.
Functions execute in an isolated C# worker process. To learn more, see Guide for running C# Azure Functions in an isolated process.
Add the extension to your project by installing this NuGet package.
Functions run as C# script, which is supported primarily for C# portal editing. To update existing binding extensions for C# script apps running in the portal without having to republish your function app, see Update your extensions.
You can install this version of the extension in your function app by registering the extension bundle, version 2.x, or a later version.
::: zone-end
::: zone pivot="programming-language-javascript,programming-language-python,programming-language-powershell"
The SignalR Service extension is part of an extension bundle, which is specified in your host.json project file. When you create a project that targets version 3.x or later, you should already have this bundle installed. To learn more, see extension bundle.
::: zone-end
::: zone pivot="programming-language-java"
To use the SignalR Service annotations in Java functions, you need to add a dependency to the azure-functions-java-library-signalr artifact (version 1.0 or higher) to your pom.xml file.
<dependency>
<groupId>com.microsoft.azure.functions</groupId>
<artifactId>azure-functions-java-library-signalr</artifactId>
<version>1.0.0</version>
</dependency>
::: zone-end
Add the AzureSignalRConnectionString
key to the host.json file that points to the application setting with your connection string. For local development, this value may exist in the local.settings.json file.
For details on how to configure and use SignalR Service and Azure Functions together, refer to Azure Functions development and configuration with Azure SignalR Service.