Websocket connection from Azure to an external server

Augusto Piva 15 Reputation points
2024-04-04T11:28:47.6033333+00:00

Hi,

I'm digging into a suitable way for making a long-lived connection to an external websocket, in Azure.

I'd like to hear the community if someone has find some straightforward approach by using some of the Azure services for handling websocket connections.

After making some research, seems that a possible way of doing this is by setting it through an app service. But maybe someone has tried this through a websocket dedicated service, which I'm missing.

This websocket would push IoT telemetry and events from that server to Azure.

Thanks!

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,758 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 21,506 Reputation points
    2024-04-08T08:25:07.4933333+00:00

    @Augusto Piva Thanks for reaching here.

    Azure provides several services that can be used to handle long-lived WebSocket connections, depending on your specific requirements and use case.

    Here are some options to consider:

    1. Azure Web Pub sub- Develop web applications with real-time messaging using Azure Web PubSub, a fully managed service that supports native and serverless WebSockets. Create loosely coupled, scalable applications—including chats, live broadcasting, and IoT dashboards—with the publish-subscribe messaging pattern. Keep your focus on functionality while Web PubSub manages the flow of data and content to your webpages and mobile applications.- https://learn.microsoft.com/en-us/azure/azure-web-pubsub/
    2. Azure SignalR Service: Azure SignalR Service is a fully-managed service that allows you to add real-time functionality to your applications using WebSockets, Server-Sent Events (SSE), or other real-time protocols. With SignalR, you can easily establish and manage long-lived WebSocket connections between your client applications and your backend services. SignalR also provides features such as automatic scaling, connection management, and message broadcasting. Refer- https://learn.microsoft.com/en-us/azure/azure-signalr/
    3. Azure App Service: Azure App Service is a platform-as-a-service (PaaS) offering that allows you to host and scale web applications in the cloud. App Service supports WebSockets and provides built-in load balancing and auto-scaling capabilities, making it a good option for handling long-lived WebSocket connections. You can use App Service to host your WebSocket server and connect to external WebSocket endpoints.
      1. Azure Functions: Azure Functions is a serverless compute service that allows you to run event-driven code in the cloud. Functions supports WebSockets and provides a scalable and cost-effective way to handle long-lived WebSocket connections. You can use Functions to host your WebSocket server and connect to external WebSocket endpoints.
    4. Azure IoT Hub: Azure IoT Hub is a fully-managed service that allows you to connect, monitor, and manage IoT devices at scale. IoT Hub supports bidirectional communication using WebSockets, making it a good option for handling long-lived WebSocket connections between your IoT devices and your backend services. IoT Hub also provides features such as device management, message routing, and device-to-cloud telemetry.- https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-direct-methods

    Depending on your specific requirements and use case, one or more of these services may be suitable for handling long-lived WebSocket connections in Azure.

    Let us know

    0 comments No comments

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.