-
Notifications
You must be signed in to change notification settings - Fork 18
Description
I have been trying to get the code sample for Direct Method invocation from the samples. I am trying to use this sample for my backend code.
My IOT device is an x64 Virtual Machine on Azure connected to IoT hub using the symmetric keys method in the official documentation. The main.py in the IoT edge module is this code sample from the the repository. The IoT device is running azure-iot-device version 2.9.0 and azure-core 1.20.1. The logs from edgeAgent and edgeHub do not report any connection errors on the IoT device.
I have already seen an older version of the sample working but now I have been trying to get the direct method call sample working, but always get an error:
msrest.exceptions.HttpOperationError: Operation returned an invalid status code 'Not Found'
But, when I try to trigger the direct method from the Azure Portal, it works completely fine and I get the response from the registered method shown on the response section on the portal. It also works from VS Code.
I am using the "iothubowner" Connection string for the direct method invocation (backend code) and the calling machine is a local laptop with a conda environment with azure-iot-hub version 2.6.0 installed. Any module related calls with the IoTHubRegistryManager object (created with iothubowner connection string inside the sample) returns the same error.
On the IoT device side, all connections are okay and the device connection is not showing any errors.
I hope I have provided all the required information and it is completely surprising for me that the code sample that was working until recently does not work anymore. I really appreciate the support.