You can use the IoT Edge Dev Tool container to avoid having to install all the dependencies on your local dev machine. The only thing you need to install is Docker. All of the other dev dependencies are included in the container. Please see the Quickstart to learn more.
To set up development machines manually instead of using the IoT Edge Dev Container, please see the Manual Development Machine Setup Wiki.
If you are using a separate Edge device, like a Raspberry Pi, you do not need to run all of these steps on your IoT Edge device, you can install and setup Edge runtime directly on the device. See the Edge Device Setup wiki page for more information on setting up your Edge device.
Note: See the "Test Coverage" wiki page to see what the IoT Edge Dev Tool has been tested with.
-
Initialize IoT Edge solution and setup Azure resources
iotedgedev init <folder_name>
iotedgedev init
will run bothiotedgedev new <folder_name>
andiotedgedev iothub setup
, which will create a new solution and setup your Azure resources in a single command. If<folder_name>
is not specified, it will default to.
.If you want to use your existing IoT Hub and IoT Edge device, you can run
iotedgedev new .
, and update the.env
file with the IoT Hub connection string and IoT Edge device connection string.iotedgedev init
andiotedgedev new .
will add a default C# module namedfiltermodule
to the solution. To customize this behavior, append the parameters--module <module-name--template <template>
. -
Add modules to IoT Edge solution
iotedgedev add <module-name--template <template>
Currently the available template values are
c
,csharp
,java
,nodejs
,python
,csharpfunction
. We are working on supporting more templates. -
Build IoT Edge module images
sudo iotedgedev build
You can avoid
sudo
if you are running IoT Edge Dev Tool outside Docker container, and:- You are on Windows or macOS.
- You are on Linux, and you have followed the post-installation steps for Linux to allow running Docker commands without
sudo
.
-
Setup the IoT Edge Simulator
sudo iotedgedev setup
IoT Edge Simulator does not support running Python and C modules yet. You'll need IoT Edge Runtime to run your Python and C modules.
You can avoid
sudo
if you are on Windows, and running IoT Edge Dev Tool outside Docker container. -
Start the IoT Edge Simulator to run the solution
sudo iotedgedev start
You can also combine setup and start with
sudo iotedgedev start --setup
You can avoid
sudo
if you are running IoT Edge Dev Tool outside Docker container, and:- You are on Windows or macOS.
- You are on Linux, and you have followed the post-installation steps for Linux to allow running Docker commands without
sudo
.
-
Monitor messages sent from IoT Edge Simulator to IoT Hub
iotedgedev monitor
-
Stop the IoT Edge Simulator
sudo iotedgedev stop
You can avoid
sudo
if you are running IoT Edge Dev Tool outside Docker container, and:- You are on Windows or macOS.
- You are on Linux, and you have followed the post-installation steps for Linux to allow running Docker commands without
sudo
.
-
Setup the IoT Edge Runtime
- Copy the device connection string from the
DEVICE_CONNECTION_STRING
environment variable in the.env
file, Azure Portal, or Azure CLI. - Follow Edge Device Setup to setup and start the IoT Edge Runtime with the copied device connection string
- Copy the device connection string from the
-
Push IoT Edge module images
sudo iotedgedev push
You can avoid
sudo
if you are running IoT Edge Dev Tool outside Docker container, and:- You are on Windows or macOS.
- You are on Linux, and you have followed the post-installation steps for Linux to allow running Docker commands without
sudo
.
-
Deploy modules to IoT Edge device
iotedgedev deploy
You can also combine push and deploy with
iotedgedev push --deploy
-
Deploy modules with automatic deployments to IoT Hub
iotedgedev iothub deploy --name TEXT --priority TEXT --target-condition TEXT
You can also combine tagging the device and deploy with the
--device-tag TEXT
flagMore information on how automatic deployments work can be found here: https://docs.microsoft.com/en-us/azure/iot-edge/module-deployment-monitoring?view=iotedge-2020-11
-
Tag IoT Edge Device
iotedgedev solution tag --tags TEXT
-
Monitor messages sent from IoT Edge Runtime to IoT Hub
iotedgedev monitor