The documentation you are viewing is for Dapr v0.11 which is an older version of Dapr. For up-to-date documentation, see the latest version.
Azure SignalR binding spec
Detailed documentation on the Azure SignalR binding component
Setup Dapr component
apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
name: <NAME>
namespace: <NAMESPACE>
spec:
type: bindings.azure.signalr
version: v1
metadata:
- name: connectionString
value: Endpoint=https://<your-azure-signalr>.service.signalr.net;AccessKey=<your-access-key>;Version=1.0;
- name: hub # Optional
value: <hub name>
- The metadata
connectionString
contains the Azure SignalR connection string. - The optional
hub
metadata value defines the hub in which the message will be send. The hub can be dynamically defined as a metadata value when publishing to an output binding (key is “hub”).
Warning
The above example uses secrets as plain strings. It is recommended to use a secret store for the secrets as described here.Additional information
By default the Azure SignalR output binding will broadcast messages to all connected users. To narrow the audience there are two options, both configurable in the Metadata property of the message:
- group: will send the message to a specific Azure SignalR group
- user: will send the message to a specific Azure SignalR user
Applications publishing to an Azure SignalR output binding should send a message with the following contract:
{
"data": {
"Target": "<enter message name>",
"Arguments": [
{
"sender": "dapr",
"text": "Message from dapr output binding"
}
]
},
"metadata": {
"group": "chat123"
},
"operation": "create"
}
For more information on integration Azure SignalR into a solution check the documentation
Output Binding Supported Operations
- create
Related links
- Bindings building block
- How-To: Trigger application with input binding
- How-To: Use bindings to interface with external resources
- Bindings API reference
Last modified July 7, 2022: update nav bar v0.11 (#2633) (b309d3d)