© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•12mo ago•
46 replies
Joey

✅ SignalR trigger for Azure Function (isolated) does not trigger.

Trying to set up a SignalR trigger that recieves a message from the client. The negotiate work fine, and the connection gets established. I see the message being sent from the client as well, but my function never triggers.

The message that gets sent:
{"arguments":["Hello from client"],"invocationId":"0","streamIds":[],"target":"sendMessage","type":1}
{"arguments":["Hello from client"],"invocationId":"0","streamIds":[],"target":"sendMessage","type":1}


Azure function:
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.Extensions.Logging;

namespace HueCue.API;

public class Api(ILogger<Api> logger)
{
    private const string HubName = "ChatRoom";

    [Function("negotiate")]
    public string Negotiate(
        [HttpTrigger(AuthorizationLevel.Anonymous, "post")]
        HttpRequestData req,
        [SignalRConnectionInfoInput(HubName = HubName, ConnectionStringSetting = "AzureSignalR")]
        string connectionInfo)
    {
        logger.LogInformation($"SignalR Connection data requested: {connectionInfo}");
        
        return connectionInfo;
    }
    
    [Function(nameof(SendMessage))]
    public void SendMessage(
        [SignalRTrigger(HubName,"messages", nameof(SendMessage), ConnectionStringSetting = "AzureSignalR")]
        SignalRInvocationContext invocationContext)
    {
        // Extract the message from the arguments
        var content = invocationContext.Arguments?.Length > 0 
            ? invocationContext.Arguments[0]?.ToString() 
            : "(no content)";
        
        logger.LogInformation($"SignalR Message received: {content}");
    }
}
using Microsoft.Azure.Functions.Worker;
using Microsoft.Azure.Functions.Worker.Http;
using Microsoft.Extensions.Logging;

namespace HueCue.API;

public class Api(ILogger<Api> logger)
{
    private const string HubName = "ChatRoom";

    [Function("negotiate")]
    public string Negotiate(
        [HttpTrigger(AuthorizationLevel.Anonymous, "post")]
        HttpRequestData req,
        [SignalRConnectionInfoInput(HubName = HubName, ConnectionStringSetting = "AzureSignalR")]
        string connectionInfo)
    {
        logger.LogInformation($"SignalR Connection data requested: {connectionInfo}");
        
        return connectionInfo;
    }
    
    [Function(nameof(SendMessage))]
    public void SendMessage(
        [SignalRTrigger(HubName,"messages", nameof(SendMessage), ConnectionStringSetting = "AzureSignalR")]
        SignalRInvocationContext invocationContext)
    {
        // Extract the message from the arguments
        var content = invocationContext.Arguments?.Length > 0 
            ? invocationContext.Arguments[0]?.ToString() 
            : "(no content)";
        
        logger.LogInformation($"SignalR Message received: {content}");
    }
}
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Blob Trigger Azure Function is not triggering
C#CC# / help
2y ago
❔ Azure Function dynamic queue output binding for Isolated Process?
C#CC# / help
3y ago
azure functions isolated process
C#CC# / help
4y ago