Hi @Martin Body
The current approach with query parameters (?stationId=Station01) works but requires reconnecting if the stationId
changes. It's simple but limited in flexibility. Web PubSub does not natively support extracting stationId from path parameters (/Station01).
When utilizing path parameters, one must have an additional layer such as Azure Functions or Azure API Management to:
Extract the stationId
from the URL path.
Pass it on as a query parameter or metadata to Web PubSub.
Azure Functions:
A physical charging station connects to the Azure Function Websocket endpoint against the format, for instance, wss://.azurewebsites.net/Station01.
The Azure Function removes Station01 from the path and sends this connection to Web Pub Sub composed of the stationId
in the query string or the metadata.
If you want a serverless, easy-to-maintain approach, Azure API Management is likely the best choice since it requires minimal logic changes and no custom gateway code. If you need more control or advanced logic, go with Azure Functions.
I hope this information is helpful.