Real-time IoT updates

Azure Functions
Azure IoT Edge
Azure IoT Hub
Azure Maps
Azure SignalR Service

This guide outlines a way for clients like web pages or mobile apps to receive updates from devices in real time. Cloud apps no longer submit HTTP requests for up-to-date information. Instead, Azure SignalR Service pushes content to clients as soon as it's available. As a managed service, Azure SignalR Service simplifies the process of adding real-time communication to apps.

Architecture

Architecture diagram showing how Azure SignalR Service keeps clients like web pages and mobile apps updated with real-time IoT data.

Download a Visio file of this architecture.

Workflow

  1. Web pages, mobile apps, and other clients request an Azure SignalR Service endpoint and token from Azure Functions, a serverless compute platform. Besides integrating data from various sources, Functions also manages Azure SignalR Service endpoints and information on client groups.

  2. Clients use the endpoint and token to connect to Azure SignalR Service.

  3. IoT devices send telemetry to Azure IoT Edge and Azure IoT Hub. IoT Edge sends processed IoT device telemetry to IoT Hub.

  4. The telemetry triggers a function in Azure Functions. The function completes these tasks:

    • Runs any calculations that you program on the telemetry.
    • Transforms the data any way that you program.
    • Uses the managed service Azure SignalR Service to broadcast the data.
  5. Azure SignalR Service supports several techniques that real-time applications use, such as WebSocket, a preferred transport protocol. But Azure SignalR Service uses techniques like server-sent events (SSE) and long polling when WebSocket isn't available. Azure SignalR Service automatically detects and initializes the appropriate transport protocol based on the features that the server and client support.

  6. The Azure SignalR Service message goes out to a specific client or group of clients. The clients use the data to update apps.

Scenario details

Internet of Things (IoT) applications often need real-time data from IoT devices. For instance, some apps display telemetry or alert data that they obtain from devices. With traditional polling methods, these client apps ask the devices for state changes.

This guide outlines a way for clients like web pages or mobile apps to receive updates from devices in real time. Cloud apps no longer submit HTTP requests for up-to-date information. Instead, Azure SignalR Service pushes content to clients as soon as it's available. As a managed service, Azure SignalR Service simplifies the process of adding real-time communication to apps.

For example, a retailer might have a dashboard app that displays the current number of customers in a store. With this guide's solution, the app doesn't request the latest customer count. Instead, Azure SignalR Service feeds that information to the app when the total changes.

Potential use cases

Besides the retail industry, other areas can also benefit from this solution:

  • Any scenario in which servers push real-time data to clients for use in visualizations and applications.
  • Rich and highly interactive apps like customized user interfaces and maps.

Specific examples that provide real-time data updates include:

  • Fleet monitoring that maps vehicle location (automotive).
  • Remote monitoring of temperature, pressure, and status for a manufacturing process (also applicable to the energy industry).
  • Drilling control systems that use telemetry, like revolutions per minute, torque, and hook load to optimize processes.
  • Alerting mechanisms.

Considerations

Consider these points when you use this pattern:

  • If your system has strict latency requirements, be aware of factors that can increase latency significantly:

    • In real-time scenarios, cloud application signaling may increase latency by up to 10 seconds.
    • Any data transformation steps that you add to the solution may increase latency.
  • Azure SignalR Service defines seven tiers that accommodate a range of performance capacities. Determine your scenario's inbound and outbound capacity by understanding the factors that affect these values. Then select the tier that best meets your requirements. For more information, see Performance guide for Azure SignalR Service.

  • Azure SignalR builds upon the SignalR protocol and follows the publish-subscribe pattern, when broadcasting messages to the clients. Consider having your own message acknowledgement (ACK) mechanism, when you need to guarantee message delivery when publishing messages to multiple clients.

  • When you're displaying real-time data in Power BI visuals, consider Real-time streaming in Power BI as an alternative to this solution.

Next steps

To learn about related solutions, see this information:

IoT architecture guides

IoT patterns

IoT architectures