Hello @Ls, Vaishnavi ,
Did you try from the Azure IoT Hub portal? Direct Methods
Is you scenario very specific to do the edgeHub restart from a custom module? please add the use case or the scenario for the intermodule-communitcation or running a Host Terminal command on the device itself?
Updated: Few other workarounds and thoughts , recommendations from Product Team
The only other idea I have is to map the docker socket into the module (via container create options) and use the docker APIs to do the restart...
{
"HostConfig": {
"Binds": [
"/var/run/docker.sock:/var/run/docker.sock"
]
}
}
conceptually similar to how this does it, except restarting modules rather than cleaning up images...
Giving modules access to the Docker socket directly essentially gives it root privileges on the device and not security best practice. Officially, we don't recommend this but neither do we do anything to explicitly block it. So the customer should independently evaluate the security risks involved with this approach and make their own call based on their risk appetite.
Not sure about the options with IoT Central, but with IoT Hub you can think about a "device - cloud - device" roundtrip, so the device send D2C message, the IoT Hub route it to a certain Az function, the function invokes a direct method to restart the module...