Built-in Direct methods of Azure IoT Edge Agent
1 min readApr 22, 2021
Azure IoT Edge agent comes with below direct methods which we can use to control our modules inside the edge device
Restart Module
This will restart other modules running on the edge device
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>" }'
also you can use the direct method option of the module and call the direct method with below parameters
DirectMethod Name : RestartModule
Parameter :
{
"schemaVersion": "1.0",
"id": "<module name>"
}
Ping
Ping command will check the module availability
az iot hub invoke-module-method — method-name ‘ping’ -n <hub name> -d <device name> -m ‘$edgeAgent’
also you can use the direct method option of the module and call the direct method with below parameters
DirectMethod Name : ping
Parameter : {}