In Azure IoT Edge modules, I can program direct methods to be invoked from the Azure Portal or from other resources within the Azure cloud. However, I am trying to call this direct methods directly from the edge device without the need to authenticate to Azure in any way (Because I am already in the device). Can this be done somehow?
Asked
Active
Viewed 347 times
0
-
Could you share more details with error screenshots – Aswin Jan 24 '23 at 06:57
-
@Aswin There is no error. I am asking how to invoke the direct method, from within the device, but not necessarily from another IoT module. – sebsmgzz Jan 24 '23 at 20:38
1 Answers
1
Initially, Direct Methods are one of the ways you have to communicate from the cloud (back-end services) to your devices (C2D communication): https://learn.microsoft.com/azure/iot-hub/iot-hub-devguide-c2d-guidance
You can invoke direct methods by leveraging the message broker. If both modules are connected to the edgeHub and there is a route to connect both, you can send a message from Module A to invoke a direct method in Module B. See: How to call direct method on iot edge agent from another module?, there is a clear reference in the comments of the last answer.

Raúl Alarcón
- 11
- 1
-
Does this exposes an HTTP endpoint in the device to which I can directly send a request? – sebsmgzz Jan 24 '23 at 17:44
-
-
Correct @sebsmgzz, I you want, you can expose an HTTP(S) endpoint in in your module (container) as a facade of your Direct Method, then you can invoke directly. – Raúl Alarcón Jan 31 '23 at 08:45