Methods of deploying Module and consulting data in Edge Device
Step 1, deploy the sample Module in Edge Device
IoT Hub- > IoT Edge device-> setup module
Deploy the new Module https://hub.docker.com/_/microsoft-azureiotedge-simulated-temperature-sensor using the following image
After you start the deployment, you can see that only Edge Agent is running as shown in the following figure
Wait a moment in the virtual machine and run iotedge list on powershell. You can see that both Sensor and Edge Hub are already running. Go back to Portal, refresh the page, and you can see that Sensor and Edge Hub are also running.
At this point, the deployment is complete.
Step 2, check the Module log at Edge Device
For the source code of the newly added Module, please see: https://github.com/Azure/iotedge/blob/027a509549a248647ed41ca7fe1dc508771c8123/edge-modules/SimulatedTemperatureSensor/src/Program.cs
Type iotedge logs Sensor-f in power shell, where Sensor is the newly added Module name.
Step 3, use Visual Studio Code to receive the data reported by Module from IoT Hub
To prepare the Visual Studio Code development environment, see "VS Development Environment preparation"
Select "Select IoT Hub" in the button of "Azure IoT Hub" in the lower left corner.
Select the IoT Hub to use and list the IoT Edge Device and its Modules status under IoT Hub
Right-click on Edge Device and select "Start Monitoring Built-in Event Endpoint" to start monitoring the data of IoT Hub built-in endpoints. At this point, this section ends.