Azure APIM WebSocket API Connection Issue

Lakshmi Siva Kumar Viswanadula 65 Reputation points
2025-01-14T16:40:41.59+00:00

I have created a backend using app service (websocket connections is alwayson), I would like to add APIM as a pass thru websocket API. However, I received InvalidWebSocketUpgrade.

Sample backend url from the Dev Tools: wss://sandbox.azurewebsites.net/

APIM WebsocketAPI: apim-sandbox1.azure-api.net_event/?EIO=4&transport=websocket

Below are the request headers:

accept-encoding: gzip, deflate, br, zstd

accept-language: en-US,en;q=0.9

cache-control: no-cache

connection: Upgrade

host: apim-sandbox1.azure-api.net

origin: https://sandbox.azurestaticapps.net

pragma: no-cache

sec-websocket-extensions: permessage-deflate; client_max_window_bits

sec-websocket-key: 16KVjz7mVdkVefVd6KD9yg==

sec-websocket-version: 13

upgrade: websocket

user-agent:

Mozilla/5.0 (iPhone; CPU iPhone OS 16_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6 Mobile/15E148 Safari/604.1 Edg/130.0.0.0

What am I doing wrong and what should be my base url and inbound policies for the above scenario

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
2,255 questions
{count} votes

Your answer

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