Azure IoT Edge for Linux on Windows allows you to run containerized Linux workloads alongside Windows applications in Windows IoT deployments. Businesses that rely on Windows IoT to power their edge devices can now take advantage of the cloud-native analytics solutions being built in Linux.
This tutorial demonstrates EFLOW device provisioned and managed from IoT Central.
Docs for Azure IoT Edge for Linux on Windows.
In this tutorial, you learn how to:
- Create a device template for an IoT Edge device
- Create an IoT Edge device in IoT Central
- Connect & Provision the device
Complete the Create an Azure IoT Central application quickstart to create an IoT Central application using the Custom app > Custom application template.
To complete the steps in this tutorial, you need an active Azure subscription.
If you don't have an Azure subscription, create a free account before you begin.
Download the IoT Edge manifest file from GitHub. Right-click on the following link and then select Save link as: EnvironmentalSensorManifest.json
In this section, you create an IoT Central device template for an IoT Edge device. You import an IoT Edge manifest to get started, and then modify the template to add telemetry definitions and views:
To create a device template from an IoT Edge manifest:
-
In your IoT Central application, navigate to Device templates and select + New.
-
On the Select template type page, select the Azure IoT Edge tile. Then select Next: Customize.
-
On the Upload an Azure IoT Edge deployment manifest page, enter Environmental Sensor Edge Device as the device template name. Then select Browse to upload the EnvironmentalSensorManifest.json you downloaded previously. Then select Next: Review.
-
On the Review page, select Create.
-
Select the Manage interface in the SimulatedTemperatureSensor module to view the two properties defined in the manifest:
An IoT Edge manifest doesn't define the telemetry a module sends. You add the telemetry definitions to the device template in IoT Central. The SimulatedTemperatureSensor module sends telemetry messages that look like the following JSON:
{
"machine": {
"temperature": 75.0,
"pressure": 40.2
},
"ambient": {
"temperature": 23.0,
"humidity": 30.0
},
"timeCreated": ""
}
To add the telemetry definitions to the device template:
-
Select the Manage interface in the Environmental Sensor Edge Device template.
-
Select + Add capability. Enter machine as the Display name and make sure that the Capability type is Telemetry.
-
Select Object as the schema type, and then select Define. On the object definition page, add temperature and pressure as attributes of type Double and then select Apply.
-
Select + Add capability. Enter ambient as the Display name and make sure that the Capability type is Telemetry.
-
Select Object as the schema type, and then select Define. On the object definition page, add temperature and humidity as attributes of type Double and then select Apply.
-
Select + Add capability. Enter timeCreated as the Display name and make sure that the Capability type is Telemetry.
-
Select DateTime as the schema type.
-
Select Save to update the template.
The Manage interface now includes the machine, ambient, and timeCreated telemetry types:
The device template doesn't yet have a view that lets an operator see the telemetry from the IoT Edge device. To add a view to the device template:
-
Select Views in the Environmental Sensor Edge Device template.
-
On the Select to add a new view page, select the Visualizing the device tile.
-
Change the view name to View IoT Edge device telemetry.
-
Select the ambient and machine telemetry types. Then select Add tile.
-
Select Save to save the View IoT Edge device telemetry view.
Before you can add a device that uses the Environmental Sensor Edge Device template, you must publish the template.
Navigate to the Environmental Sensor Edge Device template and select Publish. On the Publish this device template to the application panel, select Publish to publish the template:
Now you've published the Environmental Sensor Edge Device template, you can add a device to your IoT Central application:
-
In your IoT Central application, navigate to the Devices page and select Environmental Sensor Edge Device in the list of available templates.
-
Select + New to add a new device from the template. On the Create new device page, select Create.
You now have a new device with the status Registered:
When you deploy the IoT Edge device later in this tutorial, you need the credentials that allow the device to connect to your IoT Central application. The get the device credentials:
-
On the Device page, select the device you created.
-
Select Connect.
-
On the Device connection page, make a note of the ID Scope, the Device ID, and the Primary Key. You use these values later.
-
Select Close.
You've now finished configuring your IoT Central application to enable an IoT Edge device to connect.
Follow this document to install and provision Edge for Linux on a windows device.
You are not required to create an IoTHub with this tutorial. When you go thru the steps from the doc below skip the step of creating IoT Hub since you will connecting to IoT Central.
Install and provision Azure IoT Edge for Linux on a Windows device
For this tutorial pick option 2 to provision your device, Provisioning via DPS using symmetric keys. Provide the scope ID, registration ID and the primary key you captured in previous steps.
Provision-EflowVm -provisioningType symmetric -scopeId <ID_SCOPE_HERE> -registrationId <REGISTRATION_ID_HERE> -symmKey <PRIMARY_KEY_HERE>
Go To Device Details page on IoT Central and you will see telemetry flowing from your device