Search code examples
azure-functionsazure-signalr

Azure SignalR Service with multiple Azure Function Apps


I am trying to add SignalR to our existing system. We have a Function app that works as an API for our mobile clients, and another Function app that works as a back end receiving and processing data from a Service Bus.

We want to send a message to a user using Signal when a message is received on the Service bus for them.

So, when the mobile app is opened it will call the API function app and get a SignalR connection, and set up a handler for "NewMessage".

When backend Function app receives a message from the service bus on a Service Bus Trigger, it will process the message, and send a "NewMessage" to the user using SignalR.

At least that is the plan.

So far, I have the API connecting to SignalR, and the SignalR connection working, I added a temporary test method on the API to send a sample "NewMessage" through SignalR, and this too is working.

However, when I add the Send into the Backend function app, it seems to send OK, no errors are raised, but the message never arrives.

This is all in DotNet 8.

Have I went down a wrong path? Is it possible for two Function Apps to connect to a single SignalR Service?

I have checked all connections, and everything appears to be Ok, no error are throw, the messages appear to go through the Backend function ok, but never arrive on the app.


Solution

  • I fixed this - the issue was I had different Hub names between the two function apps. When I renamed them to match, it started working.