Difference between revisions of "SBCX-TN-003: Deploying modules to Azure IoT Edge-enabled SBCX with Visual Studio Code"

From DAVE Developer's Wiki
Jump to: navigation, search
(Introduction)
Line 39: Line 39:
 
This tab is extremely convenient to establish the connection between VSC and the IoT hub we created previously on Azure platform.
 
This tab is extremely convenient to establish the connection between VSC and the IoT hub we created previously on Azure platform.
  
After installing the ''Azure IoT Tools extension package'', VSC suggests to install the ''iotedgehubdev'' as well. Although it is not necessary, this packake may be useful for debugging tasks. For more details, please tefer to [https://github.com/Azure/iotedgehubdev this page].
+
After installing the ''Azure IoT Tools extension package'', VSC suggests to install the ''iotedgehubdev'' as well. Although it is not necessary, this package may be useful for debugging tasks. For more details, please tefer to [https://github.com/Azure/iotedgehubdev this page].
 +
==Deploying a simple module==
 +
Following the example illustrated [https://docs.microsoft.com/en-us/azure/iot-edge/how-to-deploy-modules-vscode here], the first step is to create a <code>deployment.json</code> file. In this case, the [https://azuremarketplace.microsoft.com/en-us/marketplace/apps/microsoft.edge-simulated-temperature-sensor-ga ''Simulated Temperature Sensor'' module] will be deployed to the edge device.
 +
 
 +
The following picture shows the file and the ''Azure IoT Hub Devices'' section in the bottom left corner. This section in turn lists the connected edge devices—<code>sbcx</code> in the example—and the running modules (TBD).
 +
 
  
 +
[[File:SBCX-VSC-Azure-IoT-Tools2.png|thumb|center|600px|The ''Azure IoT Hub Devices'' section before deploying the ''Simulated Temperature Sensor'' module]]
  
==Deploying a simple module==
+
 
 +
By right-clicking on the <code>sbcx</code> device, the ''Create Deployment for Single Device'' item can be selected. This action starts the deployment process. At the end of this process, the ''Deployment succeeded'' message should appear on the output console:
 +
 
 +
 
 +
[[File:SBCX-VSC-Azure-IoT-Tools3.png|thumb|center|600px|The output console during the deployment process]]

Revision as of 07:45, 20 August 2019

Info Box
SBC-AXEL-02.png Applies to SBC AXEL
Axel-04.png Applies to Axel Ultra
Axel-lite 02.png Applies to Axel Lite
Axel-02.png Applies to AXEL ESATTA
Warning-icon.png This technical note was validated against specific versions of hardware and software. It may not work with other versions. Warning-icon.png

History[edit | edit source]

Version Date Notes
1.0.0 August 2019 First public release

Introduction[edit | edit source]

The goal of this document is to show how to deploy modules to a Azure IoT Edge-enabled SBC Axel board. It is recalled that, according to Microsoft documentation, modules are

the smallest computation units managed by IoT Edge, and can contain Microsoft services (such as Azure Stream Analytics), 3rd-party services or your own solution-specific code.

There are different methods to deploy such modules to the IoT Edge-enabled devices. This Technical Note (TN for short) will describe how to use Visual Studio Code (VSC) to carry out such an operation on SBCX single-board computer.

This article is based on this previous TN: SBCX-TN-002: Running Microsoft Azure IoT Edge runtime. As such, SBCX-TN-002 is a prerequisite to complete this TN.

The procedure illustrated here is based on this document.

Setting up VSC[edit | edit source]

To set up Visual Studio Code, the Azure IoT Tools extension package has to be installed.

After installing this package, the Welcome to Azure IoT Tools tab should open automatically:


Welcome to Azure IoT Tools tab


This tab is extremely convenient to establish the connection between VSC and the IoT hub we created previously on Azure platform.

After installing the Azure IoT Tools extension package, VSC suggests to install the iotedgehubdev as well. Although it is not necessary, this package may be useful for debugging tasks. For more details, please tefer to this page.

Deploying a simple module[edit | edit source]

Following the example illustrated here, the first step is to create a deployment.json file. In this case, the Simulated Temperature Sensor module will be deployed to the edge device.

The following picture shows the file and the Azure IoT Hub Devices section in the bottom left corner. This section in turn lists the connected edge devices—sbcx in the example—and the running modules (TBD).


The Azure IoT Hub Devices section before deploying the Simulated Temperature Sensor module


By right-clicking on the sbcx device, the Create Deployment for Single Device item can be selected. This action starts the deployment process. At the end of this process, the Deployment succeeded message should appear on the output console:


The output console during the deployment process