Introduction to Azure IoT Edge
Microsoft Azure IoT Edge is the technology from Microsoft for building Internet of Things (IoT) solutions that utilize Edge Compute. In the world of the cloud, the Edge Compute (aka the Edge, or IoT Edge) is the compute power that sits on your on-premises network right at the edge of where your network ends and where it connects to the Internet. This could be directly on your main network or a guest network with some kind of isolation like a firewall or subnet configuration. Another term for the Edge is Fog Computing.
At first, having local IoT solution compute power on your network or at the Edge does sound like just having servers on-premises. However, IoT Edge Compute is a bit more complicated than that since it takes Cloud Compute capabilities and integrates them with on-premises location and compute. Microsoft Azure IoT Edge enables one to easily manage and deploy IoT solutions that integrate Microsoft Azure cloud services with on-premises compute hardware and services.
Microsoft Azure IoT Edge consists of the IoT Edge Runtime that gets installed on a computer or device. These devices can run either Windows or Linux operating systems, and they must have Docker installed. The Azure IoT Edge Runtime then utilizes Docker to run IoT Edge Modules on the device with the direction of being told what modules to deploy and run via a connection to Microsoft Azure IoT Hub.
What Is an Azure IoT Edge Module?
With Azure IoT Edge, the way that cloud compute capabilities are pushed down to run on edge devices is through the use of IoT Edge Modules. An Edge Module is the smallest unit of compute managed by the IoT Edge Runtime. These modules can contain Azure services such as Azure Stream Analytics, or they can be your domain-specific module code required by your IoT Edge solution.
- The process of developing, building, and deploying IoT Edge modules consists of several logical steps:
- Write IoT Edge Module – An IoT Edge Module is written using a supported language; like C#, C, or others. (Some modules are prebuilt by Microsoft, such as those for running Azure services on IoT Edge.)
- Build and Deploy Module to Docker Registry – The Module is built and deployed to a Docker Registry, such as Docker Hub. The IoT Edge Runtime can then be configured to pull the Module image down from the Docker Registry for the module to be deployed to one or more IoT Edge devices.
- Manage Device and Module Identities in Azure IoT Hub – The IoT Edge Device has a device identity created and managed within Azure IoT Hub (either using manual deployment or auto-deployment via Azure Device Provisioning Service). This device identity will include IoT Edge Module Identities for each of the Edge Modules deployed to the device; each of which contains module configurations.
- Install and Run IoT Edge Runtime on Device(s) – The IoT Edge Device and the installed IoT Edge Runtime are configured to connect to the cloud either directly to Azure IoT Hub or via Azure Device Provisioning Service. When the device connects to Azure IoT Hub it will automatically pull down the device identity and any configured IoT Edge Module Identities configured, and then automatically start running the modules as configured.
These steps of using the Device Identity and Edge Module Identities to manage configuring the Azure IoT Edge Device(s) within Azure IoT Hub provides a mechanism where Azure IoT Edge Devices can be managed remotely. To make maintenance or configuration changes to the Azure IoT Edge Devices, you simply reconfigure the device identity or Edge Module Identities within Azure IoT Hub, and the updates are pushed automatically down to the Edge Devices. Additionally, Edge Devices are authenticated and authorized remotely too, so revoking a device’s access or retiring older devices is just as easy.
The Disconnected Cloud and Offline Capabilities of Azure IoT Edge
One of the benefits of using Edge Compute in an IoT solution is to keep the solution functioning during times when the device(s) are disconnected or experiencing conditions of high network latency. Azure IoT Edge allows you to run both custom code and Azure services on the local IoT Edge Device(s) integrated into a larger IoT solution.
The locally connected, Edge Compute resources built out with Azure IoT Edge have several benefits for any IoT solution:
- Lower Latency Decisions – With domain logic and even Azure services (like Stream Analytics or Azure Functions) able to run on-premises with an Azure IoT Edge Device, the solution can make decisions and take actions much more quickly with lower latency. The communications are no longer required to go round trip into Azure and back.
- Offline Capability – The IoT Edge Device can operate offline in scenarios where it may be disconnected from Azure IoT Hub during temporary or even longer-term conditions.
- Data Synchronization – With offline capabilities of Azure IoT Edge, the IoT Edge Runtime will automatically save all IoT telemetry events on the local device storage, and then transmit that data to Azure IoT Hub when connectivity is restored. The length of time the data is stored on the device (aka Time-to-Live) can be custom-configured for your IoT solution.
- Lower Bandwidth Usage – Less data and IoT device telemetry need to be sent to the cloud by utilizing Edge Compute to do more processing for an IoT solution. Also, processing the data on-premises utilizing Azure IoT Edge allows for aggregates or summaries of the telemetry data to be communicated to the Azure IoT Edge when all telemetry events do not need to be sent to or stored in the cloud.
There are many IoT solutions that benefit from all the capabilities of Azure IoT Edge. This is true if the IoT Device directly has sensors sending telemetry to Azure IoT Hub, or even if the IoT Edge Device is deployed as an IoT Gateway connected to multiple other IoT Sensor Devices.
Industrial IoT scenarios, for example, can benefit greatly from the low latency, offline, and lower bandwidth capabilities. If industrial machinery could break creating thousands of dollars worth of damage, or even causing great bodily harm (or even death), then being able to make decisions and take action with lower latency is a major benefit.