This article explains how to deploy the Industrial IoT Edge modules to Azure IoT Edge using the Azure Portal and Marketplace.
Before you begin, make sure you followed the instructions to set up a IoT Edge device and have a running IoT Edge Gateway.
To deploy all required modules to the Gateway using the Azure Portal...
-
Sign in to the Azure portal and navigate to the IoT Hub deployed earlier.
An simple way to locate your IoT Hub is to find the resource group variable in your
.env
file. This resource group contains the IoT Hub. -
Select IoT Edge from the left-hand menu.
-
Click on the ID of the target device from the list of devices.
-
Select Set Modules.
-
In the Deployment modules section of the page, select Add and IoT Edge Module.
-
In the IoT Edge Custom Module dialog use
discovery
as name for the module, then specify the container image URI asmcr.microsoft.com/iotedge/discovery:latest
As create options use the following JSON:
{"NetworkingConfig":{"EndpointsConfig":{"host":{}}},"HostConfig":{"NetworkMode":"host","CapAdd":["NET_ADMIN"]}}
Fill out the optional fields if necessary. For more information about container create options, restart policy, and desired status see EdgeAgent desired properties. For more information about the module twin see Define or update desired properties.
-
Select Save and repeat step 5.
-
In the IoT Edge Custom Module dialog use
twin
as name for the module, then specify the container image URI asmcr.microsoft.com/iotedge/opc-twin:latest
Leave the create options empty.
-
Select Save and repeat step 5.
-
In the IoT Edge Custom Module dialog, use
publisher
as name for the module and the container image URI asmcr.microsoft.com/iotedge/opc-publisher:latest
Leave the create options empty.
-
Select Save and then Next to continue to the routes section.
-
In the routes tab, paste the following
{ "routes": { "twinToUpstream": "FROM /messages/modules/twin/* INTO $upstream", "discoveryToUpstream": "FROM /messages/modules/discovery/* INTO $upstream", "publisherToUpstream": "FROM /messages/modules/publisher/* INTO $upstream", "leafToUpstream": "FROM /messages/* WHERE NOT IS_DEFINED($connectionModuleId) INTO $upstream" } }
and select Next
-
Review your deployment information and manifest. It should look like this deployment manifest. Select Submit.
-
Once you've deployed modules to your device, you can view all of them in the Device details page of the portal. This page displays the name of each deployed module, as well as useful information like the deployment status and exit code.
-
Add your own or other modules from the Azure Marketplace using the steps above.
For more in depth information check out the Azure IoT Edge Portal documentation.