exam questions

Exam AZ-220 All Questions

View all questions & answers for the AZ-220 exam

Exam AZ-220 topic 5 question 6 discussion

Actual exam question from Microsoft's AZ-220
Question #: 6
Topic #: 5
[All AZ-220 Questions]

You have 1,000 devices that connect to an Azure IoT hub.
You are performing a scheduled check of deployed IoT devices.
You plan to run the following command from the Azure CLI prompt. az iot hub query --hub-name hub1 --query-command "SELECT * FROM devices WHERE connectionState = 'Disconnected'"
What does the command return?

  • A. the Device Disconnected events
  • B. the device twins
  • C. the Connections logs
  • D. the device credentials
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
Device twin queries: IoT Hub exposes the device twins as a document collection called devices. For example, the following query retrieves the whole set of device twins:

SELECT * FROM devices -
Reference:
https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-query-language#device-and-module-twin-queries

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
blackdog
Highly Voted 4 years, 11 months ago
seems like it should return the device twins of the disconnected devices
upvoted 20 times
tita_tovenaar
3 years, 11 months ago
correct, confirmed here (see connectionState)> https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-identity-registry#device-heartbeat
upvoted 1 times
...
...
Yong2020
Highly Voted 4 years, 11 months ago
should be device twins.
upvoted 14 times
...
SanjuB
Most Recent 4 years, 3 months ago
the Device Disconnected events
upvoted 3 times
...
Bob
4 years, 3 months ago
Question says what does command return ? device twin is not something (telemetry or event or signal) which device return to hub. In my opinion A is correct.
upvoted 2 times
...
cup
4 years, 6 months ago
Indeed B...Tested with production data
upvoted 4 times
...
getazusername
4 years, 6 months ago
Device twin IoT Hub exposes the device twins as a document collection called devices. For example, the following query retrieves the whole set of device twins: SQL SELECT * FROM devices Source: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-query-language
upvoted 1 times
...
Sudipta3009
4 years, 8 months ago
It will be Device Twin only for the disconnected Device
upvoted 3 times
...
ripin_aggarwal
4 years, 9 months ago
Correct option is B. The command returns the Device twin of the disconnected devices.
upvoted 5 times
...
not_a_robot
4 years, 10 months ago
Device twins
upvoted 5 times
...
not_a_robot
4 years, 10 months ago
Tried, returns data tiwns.
upvoted 4 times
...
meriadoc71
4 years, 11 months ago
Not disconnected devices The IoT Hub identity registry contains a field called connectionState. Only use the connectionState field during development and debugging. IoT solutions should not query the field at run time. For example, do not query the connectionState field to check if a device is connected before you send a cloud-to-device message or an SMS.
upvoted 1 times
...
theiotguy
4 years, 11 months ago
Yes. It should be Device twins. https://docs.microsoft.com/en-us/cli/azure/ext/azure-cli-iot-ext/iot/hub?view=azure-cli-latest#ext-azure-cli-iot-ext-az-iot-hub-query-examples
upvoted 5 times
valkyrieShadow
4 years, 7 months ago
Review the section labeled Device and module twin queries, displaying arbitrary JSON objects, which IoT Hub enables you to query device twins and module twins. Such as; "connectionState" here is the article: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-query-language#device-and-module-twin-queries
upvoted 1 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...