Iothub query on job schedule for device twin not working

Pravin Kandala 106 Reputation points
2020-10-21T14:57:41.867+00:00

I have followed this documentation: https://learn.microsoft.com/en-us/azure/iot-hub/iot-hub-node-node-schedule-jobs#schedule-jobs-for-calling-a-direct-method-and-updating-a-device-twins-properties

var queryCondition = "deviceId IN ['myDeviceId']"; // i have made sure myDeviceId matches my Iothub device id.

And I get this error: ArgumentError: Null or empty query condidtion is invalid or not supported anymore. Use query condition '*' if need to run job on all devices.

I am using node.js SDK i.e., 'azure-iothub' JobClient

Azure Internet of Things
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,272 questions
{count} vote

Accepted answer
  1. Pravin Kandala 106 Reputation points
    2020-10-23T15:52:27.337+00:00

    Hi @QuantumCache

    After lot of debugging, I found out that the error was in my patch Json instead of query.

    If the patch is wrong, I am seeing this error. Which is very miss leading.

    TAG field is required. Thats how i got to fix this issue.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.