SignalRTrigger issue in isolate azure function

Anand Mishra 20 Reputation points
2025-07-28T09:47:29.3566667+00:00

I'm building a chatbot application using Azure SignalR Service and Azure Functions with the .NET 8 isolated worker model. I'm trying to use the SignalRTrigger binding to receive messages from clients in Serverless mode. Here's what I have so far: My Setup: Azure SignalR Service is set to Serverless mode.

Function App is running on .NET 8 Isolated Worker model.

I have configured the negotiate and sendMessage functions:


[Function("sendMessage")]
    [SignalROutput(HubName = "orchestratorhub", ConnectionStringSetting = "SignalR:ConnectionString")]
    public async Task SendMessage(
        [SignalRTrigger("orchestratorhub", "messages", "sendMessage", ConnectionStringSetting = "SignalR:ConnectionString")] string message,
        SignalRInvocationContext context)
    {
        // message handling logic
    }
    
[Function("negotiate")]
public HttpResponseData Negotiate(
    [HttpTrigger(AuthorizationLevel.Anonymous, "post", "get")] HttpRequestData req,
    [SignalRConnectionInfoInput(HubName = "orchestratorhub", ConnectionStringSetting = "SignalR:ConnectionString")] SignalRConnectionInfo connectionInfo)
{
    var response = req.CreateResponse(HttpStatusCode.OK);
    response.WriteAsJsonAsync(connectionInfo);
    return response;
}

Summary: I’m using SignalRTrigger in a .NET 8 Isolated Azure Function App. The client successfully connects and receives the negotiate token. However, when invoking connection.send("sendMessage", payload), the Azure Function is never triggered. Application Insights shows no execution of the function, and the client times out.

What I See in Logs:

bash
Copy
Stopped the listener 'Microsoft.Azure.WebJobs.Extensions.SignalRService.NullListener' for function 'sendMessage'

This suggests the binding is not active.

Environment:

Azure SignalR is running in Serverless mode

Using latest Microsoft.Azure.Functions.Worker.Extensions.SignalRService NuGet package (v1.2.0)

.NET 8 Isolated Process Function App

Question:

Does this happen because SignalRTrigger Is not supported for .NET 8 Isolated Azure Functions in combination with Azure SignalR Serverless mode?

If so, is the recommended solution to use HttpTrigger with Upstream configuration instead?

I would appreciate official guidance or confirmation on this matter.

  • hat I Have Implemented So Far:

SignalR Setup (Serverless Mode):

  Configured Azure SignalR in *Serverless* mode.
  
        Added correct `ConnectionString` in Azure Function settings and `host.json`.
        
        **Azure Functions (Isolated .NET 8):**
        
              Created `sendMessage` function using `SignalRTrigger`.
              
                    Added `SendMessageHandler` with `SignalROutput` for pushing responses.
                    
                          Created `negotiate` function to issue SignalR connection info.
                          
                                Verified `negotiate` works and client receives URL & token.
                                
                                **Client-Side Integration (JavaScript):**
                                
                                      Connected to SignalR hub using `@microsoft/signalr`.
                                      
                                            Used `connection.send("sendMessage", payload)` to invoke the function.
                                            
                                                  Handled `ReceiveMessage` and `ReceiveConnectionId` events.
                                                  
                                                  **Shared SignalR Message Sender Class:**
                                                  
                                                        Centralized message sending logic using `IServiceHubContext`.
                                                        
                                                              Handles `BroadcastMessageAsync`, `SendMessageToUserAsync`, `SendToGroupAsync`, etc.
                                                              
  1. Current Status:

Negotiate works.

  - **SignalRTrigger after `connection.send(...)`**. NullTrigger attached screenshot
  
    **No logs or function invocations observed**, though listener startup logs are present.  
      
    **P.S: My azure function code is deployed and UI I am running locally.**
    
  

  
     Added `SendMessageHandler` with `SignalROutput` for pushing responses.

     
        Created `negotiate` function to issue SignalR connection info.

        
           Verified `negotiate` works and client receives URL & token.
1. **Client-Side Integration (JavaScript):**

   - Connected to SignalR hub using `@microsoft/signalr`.![image](/api/attachments/107e156e-95bc-4db9-835a-423c77fb7602?platform=QnA)
      
   Used `connection.send("sendMessage", payload)` to invoke the function.
   
   Handled `ReceiveMessage` and `ReceiveConnectionId` events.
   
   **Shared SignalR Message Sender Class:**
   
      Centralized message sending logic using `IServiceHubContext`.
   
   sql
     Handles `BroadcastMessageAsync`, `SendMessageToUserAsync`, `SendToGroupAsync`, etc.
   1. **Current Status:**

- **Negotiate works.**

   - **SignalRTrigger function returning NullListner.(attached Image)**
   
Azure SignalR Service
Azure SignalR Service
An Azure service that is used for adding real-time communications to web applications.
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Alex Burlachenko 18,575 Reputation points Volunteer Moderator
    2025-07-28T10:37:45.9266667+00:00

    hi anand! thanks for posting this detailed question ))

    yes, there's a known limitation here. the signalrtrigger binding currently doesn't work with azure signalr in serverless mode when using .net 8 isolated functions. that null listener message u're seeing? it's basically telling u the trigger can't activate properly )

    https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-signalr-service-trigger?tabs=in-process&pivots=programming-language-csharp. the isolated worker model support is still catching up with some bindings.

    solution time! u have two good options

    1. switch to http triggers with upstream settings (this is what microsoft recommends for serverless mode anyway)https://docs.microsoft.com/en-us/azure/azure-signalr/concept-upstream. u'll need to configure the azure signalr service to call your function when messages arrive.

    if u really want to keep using signalrtrigger, u'll need to switch from serverless to default mode. but this means managing signalr units yourself, which might not be what u want.

    for your current setup, option 1 is probably the way to go. here's a quick example of how the http trigger version would look

    [Function("sendMessage")] public async Task<HttpResponseData> SendMessage( [HttpTrigger(AuthorizationLevel.Anonymous, "post")] HttpRequestData req) { // parse message from request // your handling logic here return req.CreateResponse(HttpStatusCode.OK); }

    then configure upstream in your signalr service to point to this endpoint. worth noting this approach works consistently across all function versions ))

    make sure your connection string is properly set in both local.settings.json and azure portal. sometimes that sneaky little semicolon gets missed and causes silent failures ))

    when working with serverless architectures, http triggers often give u more flexibility than specialized bindings. less magic, more control!

    if u decide to stick with serverless mode, double check that your function app has 'azure signalr service send to upstream' permission. its easy to miss but crucial for the whole thing to work.

    here's the permissions doc just in case https://docs.microsoft.com/en-us/azure/azure-signalr/signalr-concept-azure-functions

    hope this helps get your chatbot back on track

    Best regards,

    Alex

    and "yes" if you would follow me at Q&A - personaly thx.
    P.S. If my answer help to you, please Accept my answer
    

    https://ctrlaltdel.blog/

    0 comments No comments

  2. Anand Mishra 20 Reputation points
    2025-07-28T15:44:08.1133333+00:00

    Thanks, Alex, for the detailed and helpful response.

    I have one more follow-up question. I noticed there are two different approaches when working with upstream in Azure SignalR:

    Using an HTTP call directly from the client

    Using connection.send(...) from the client, which is typically used with SignalRTrigger

    Just to clarify, in my implementation, I'm currently using the HTTP call pattern from the client. Could you please highlight which of these approaches is recommended in the context of serverless Azure Functions, and under what scenarios one might be preferred over the other?

    Appreciate your guidance!


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.