Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Direct method invocation fails with device Not found but works from Azure portal

Abierto
#1 7 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
25/100
Tipo de issue
Error
Claridad
Necesita aclaración
Estado de actividad
Estancado
Stack tecnológico
python
Área
api, backend, cloud

Línea de trabajo

Comienza con azure-iot-hub/samples/iothub_registry_manager_method_sample.py y compara su configuración de backend con el entorno azure-iot-hub 2.6.0 indicado. Después inspecciona azure-iot-device/samples/async-hub-scenarios/receive_direct_method.py y reproduce la llamada al método directo contra la configuración del dispositivo indicada. Se considera terminado cuando las llamadas del sample y del módulo IoTHubRegistryManager ya no devuelvan HTTP 404 y el dispositivo reciba el método.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
18
Forks
24
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Azure/azure-iot-hub-python

Todos los issues de Azure/azure-iot-hub-python

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.