Professional Documents
Culture Documents
Andam A3OC
Andam A3OC
COE 191
Azure IoT Edge brings compute capability closer to the source of the data, that is, to edge devices. IoT Edge provides the
ability to move workloads from the cloud to the edge. In doing so, IoT Edge overcomes the problems of latency and
response times.
The ability to move computing workloads to edge devices provides other advantages such as deploying artificial
intelligence applications on edge devices. Machine learning models can be trained in the cloud and then deployed on
edge devices. IoT Edge also provides the ability to run in offline mode and provides the underlying security for reliable
operations in such cases.
Azure IoT Edge is a combination of a cloud service running in the cloud and a runtime that runs on the device. The
runtime starts and manages workflows on the device. The workflow comprises a set of containers that you link together
in a specific order to create an end-to-end scenario. IoT Edge is managed by the IoT Hub. The Azure IoT Edge enables
you to run workloads on the edge device, which are developed using cloud services. The workload is a module deployed
using docker compatible containers. The modules could be artificial intelligence applications, Azure and third-party
services, or your business logic.
IoT Edge modules are units of execution implemented as Docker compatible containers. IoT Edge modules can
run business logic at the edge. IoT Edge modules can run Azure services, third-party services, or your code. if
needed.
IoT Edge runtime runs on each IoT Edge device and manages the runtime and communication for the modules
deployed to each device. IoT Edge runtime ensures that the modules are always running and report module
health to the cloud.
IoT Edge cloud interface enables you to monitor and manage IoT Edge devices remotely
IoT Edge modules are executable packages implemented as containers.
Through IoT Edge modules, you can deploy cloud workloads to run directly on IoT devices. IoT Edge modules are the
smallest computation units managed by IoT Edge. Using IoT Edge modules, you can analyze data on devices instead of
the cloud. By moving parts of your workload to the edge, your devices can spend less time sending messages to the
cloud and react more quickly to events.
Pre-built IoT Edge Modules are accessed through the Azure Marketplace, where third-party publishers can make their
modules available. The module you deploy simulates a sensor. It sends generated data back to the IoT Hub. You can use
the simulated data for development and testing your IoT solution.
A resource group is a container to logically group Azure resources. These resources can be, for example, storage
accounts, virtual networks, and virtual machines (VMs) you want to treat as a single entity. The resource group stores
metadata about the resources. Therefore, when you specify a location for the resource group, you're selecting where
that metadata is stored.
IoT Edge devices have the IoT Edge runtime installed on them. The Azure "IoT Edge on Ubuntu" virtual machine is an IoT
device ready for use.
IoT Edge security daemon: starts each time an IoT Edge device boots and bootstraps the device by running the IoT Edge
agent.
IoT Edge agent: facilitates deployment and monitoring of modules on the IoT Edge device, including the IoT Edge hub.
IoT Edge hub: manages communications between modules on the IoT Edge device and between the device and IoT Hub.
Azure IoT Hub enables the communication between the virtual device and the cloud. To create a new Azure IoT Hub
with the Azure CLI, you'll use the az IoT hub create command set.
Use the az IoT hub device-identity create command to create a device identity for your Edge device on Azure. The device
identity enables you to communicate with your IoT Hub.
Retrieve the connection string with the az iot hub device-identity show-connection-string command. Every device
identity uses a unique device connection string to associate it with a physical device.
Set up the connection string on the IoT Edge device so it can connect to the IoT Hub. You can do this remotely without
connection to the virtual machine by running a script on the device. Use the az vm run-command to invoke a script on
the edge device and pass the connection string as a parameter.
Ensure the IoT Edge device is ready to run pre-built modules
Once the edge device is configured, check if it is ready to run a pre-built module.
Log on to the edge device using the public IP address for the device and run the ssh command.
With iotedge commands, you can check if the IoT Edge security daemon is running as a system service.
This exercise uses Azure CLI in Azure Cloud Shell to issue the required commands. To get started,
open https://shell.azure.com.
You need to add Edge Azure IoT extension to the Cloud Shell instance Azure CLI. First, check which extensions you
already have installed by running the following command:
Azure CLICopy
az extension list
If the older version of the Azure IoT extension named azure-cli-iot-ext is installed, remove it. This version is incompatible
with the current version. To remove the extension, run this command:
Azure CLICopy
Azure CLICopy
Azure CLICopy
Accept the terms of use and create the Microsoft-provided Azure IoT Edge on Ubuntu virtual machine. This virtual
machine preinstalls everything you need to run IoT Edge on a device.
Azure CLICopy
Specify routes: Routing specifies how messages are passed between modules and IoT Hub. In this case, we select all
messages from all modules to go to IoT Hub.
Review Deployment: This allows you to preview the deployment manifest JSON file that defines all the modules
deployed to your IoT Edge device.
A deployment manifest is a JSON document that describes which modules to deploy, how data flows between the
modules and the module twins' desired properties. The deployment manifest tells your device which modules to install
and how to configure them to work together. All IoT Edge devices must be configured with a deployment manifest
The "Simulated Temperature Sensor" module creates sample data you can use for testing. The module also generates
environment data, i.e., data for the machine and the environment around the machine.
Clean up resources
To avoid changes, delete Azure resources as needed, including the device that you created, the resource group. Ensure