Azure IoT Edge Runtime

Understanding and Utilizing the Core Components for Edge Intelligence

Introduction to the Azure IoT Edge Runtime

The Azure IoT Edge runtime is a collection of programs that turns a device into an IoT Edge device. It allows you to deploy and manage cloud workloads, such as Azure services and custom business logic, to your edge devices. This runtime is crucial for enabling powerful edge intelligence capabilities, data processing, and machine learning directly on your devices, reducing latency and bandwidth costs.

The runtime comprises of the following key components:

Key Concepts and Functionality

Modules

Modules are the fundamental building blocks of your IoT Edge solution. They are typically Docker containers that encapsulate specific functionalities, such as:

Module Twin

Similar to device twins in IoT Hub, each module has a corresponding module twin. This twin is a JSON document that represents the state of a module. It contains:

Communication Patterns

The IoT Edge runtime facilitates robust communication patterns:

Deployment Manifests

You use deployment manifests (JSON files) to define the modules to run on an IoT Edge device, their configurations, routes for message exchange, and desired module twin properties. This manifest is sent from IoT Hub to the IoT Edge device.

Getting Started with the Runtime

To begin developing with the Azure IoT Edge runtime, you'll typically follow these steps:

  1. Set up your development environment: Install Docker, the Azure IoT Edge SDKs, and Visual Studio Code with the Azure IoT Edge extension.
  2. Create an IoT Hub and register your edge device: This establishes the connection between your cloud and edge.
  3. Develop your module(s): Write your application logic and package it as a container.
  4. Create a deployment manifest: Define your modules, routes, and desired properties.
  5. Deploy to your edge device: Use IoT Hub to push the deployment to your device.

Here's a simplified example of a deployment manifest snippet:

{ "modulesContent": { "$edgeAgent": { "properties.desired": { "schemaVersion": "1.0", "runtime": { "type": "docker", "settings": { "minDockerVersion": "v1.25" } }, "systemModules": { "edgeAgent": { "type": "docker", "env": {}, "image": "mcr.microsoft.com/azureiotedge-agent:1.4", "status": "running", "restartPolicy": "always" }, "edgeHub": { "type": "docker", "env": { "experimentalFeatures": { "routingStatus": "enabled" } }, "image": "mcr.microsoft.com/azureiotedge-hub:1.4", "status": "running", "restartPolicy": "always", "routes": { "upstream": "input4ToOutput1" } } }, "modules": { "myCustomModule": { "version": "1.0.0", "type": "docker", "status": "running", "restartPolicy": "always", "image": "your-docker-registry/mycustommodule:latest", "createOptions": {} } } } }, "$edgeHub": { "properties.desired": { "schemaVersion": "1.0", "routes": { "routeFromEdgeHubToIoTHub": "FROM /messages/* INTO $upstream" }, "storeAndForward": { "timeToLiveSecs": 7200 } } } } }

Resources and Further Learning

For more in-depth information, tutorials, and code samples, please refer to the following official Microsoft resources:

Join the Azure IoT Community to ask questions, share your knowledge, and connect with other developers.