How to configure APIM to expose SignalR hub deployed to AppService

Krzysztof Madej 26 Reputation points
2023-11-23T16:05:17.4466667+00:00

I configured Azure API Management as it is written here: Configure APIs when client connects with ServerSentEvents or LongPolling transport.

The API is linked to Azure App Service which host application with SignalR Core.

When I hit directly App Service it works.

When I hit via APIM it works.

When I scale Azure App Service to two instances it still works in case of direct hit to App Service. But when I hit via APIM I got an error:

Error occurred: One or more errors occurred. (Unable to connect to the server with any of the available transports. (ServerSentEvents failed: Response status code does not indicate success: 404 (Not Found).) (LongPolling failed: Response status code does not indicate success: 404 (Not Found).))
I have session affinity enabled and I also tried switch load balancer mode to RequestHash. But it is still the same.

It behaves the same when I attach Redis as backplane.

I was looking for an answer here [Inside the Azure App Service Architecture], to understand what changes when scaling to multiple instances. But I didn't find anything.

How can I address this?

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,939 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,359 questions
{count} votes