Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: IoT Edge 1.5
Important
IoT Edge 1.5 LTS is the supported release. IoT Edge 1.4 LTS is end of life as of November 12, 2024. If you are on an earlier release, see Update IoT Edge.
Monitor and manage IoT Edge deployments using the direct methods in the IoT Edge agent module. Direct methods are implemented on the device and can be invoked from the cloud. The IoT Edge agent includes direct methods to monitor and manage IoT Edge devices remotely.
For more information about direct methods, how to use them, and how to implement them in your own modules, see Understand and invoke direct methods from IoT Hub.
The names of these direct methods are case insensitive.
Ping
The ping method checks if IoT Edge is running on a device or if the device has an open connection to IoT Hub. Use this method to ping the IoT Edge agent and check its status. A successful ping returns an empty payload and a "status": 200.
For example:
az iot hub invoke-module-method --method-name 'ping' -n <hub name> -d <device name> -m '$edgeAgent'
In the Azure portal, invoke the method using the method name ping
and an empty JSON payload {}
.
Restart module
The RestartModule method lets you remotely manage modules running on an IoT Edge device. If a module reports a failed state or unhealthy behavior, trigger the IoT Edge agent to restart it. A successful restart command returns an empty payload with "status": 200.
The RestartModule method is available starting with IoT Edge version 1.0.9.
Tip
The IoT Edge troubleshooting page in the Azure portal simplifies restarting modules. For more information, see Monitor and troubleshoot IoT Edge devices from the Azure portal.
Use the RestartModule direct method on any module running on an IoT Edge device, including the edgeAgent module. If you use this direct method to shut down the edgeAgent, you don't receive a success result because the connection is disrupted during the module restart.
For example:
az iot hub invoke-module-method --method-name 'RestartModule' -n <hub name> -d <device name> -m '$edgeAgent' --method-payload \
'
{
"schemaVersion": "1.0",
"id": "<module name>"
}
'
In the Azure portal, use the method name RestartModule
with the following JSON payload:
{
"schemaVersion": "1.0",
"id": "<module name>"
}
Diagnostic direct methods
- GetModuleLogs: Retrieve module logs in the response of the direct method.
- UploadModuleLogs: Retrieve module logs and upload to Azure Blob Storage.
- UploadSupportBundle: Retrieve module logs with a support bundle and upload a zip file to Azure Blob Storage.
- GetTaskStatus: Check the status of an upload logs or support bundle request.
These diagnostic direct methods are available as of the 1.0.10 release.
Next steps
Properties of the IoT Edge agent and IoT Edge hub module twins