You need to query the Azure IoT Hub registry to find all devices tagged with department 'assembly' that have reported a status of 'offline' in their device twin. Which query syntax should you use?

Direct Answer (Verified)Reviewed by Sunny (Senior Cloud Engineer)

Correct Answer: SELECT * FROM devices WHERE tags.department = 'assembly' AND properties.reported.status = 'offline'

IoT Hub queries are SQL-like. Properties are accessed via tags or properties.reported / properties.desired. The query format target is FROM devices....

๐Ÿ“‹Part of Microsoft Certified: Azure IoT Developer Specialty (AZ-220) ยท Azure Certification Practice
Real Exam ScenarioAzure IoT Hub

You need to query the Azure IoT Hub registry to find all devices tagged with department 'assembly' that have reported a status of 'offline' in their device twin. Which query syntax should you use?

โœ“ Correct Answer & ExplanationAzure IoT Hub

Correct Answer

SELECT * FROM devices WHERE tags.department = 'assembly' AND properties.reported.status = 'offline'

Why This Answer Is Correct

IoT Hub queries are SQL-like. Properties are accessed via tags or properties.reported / properties.desired. The query format target is FROM devices.

๐Ÿ“š What This Question Tests

This question evaluates your knowledge of Azure IoT Hub โ€” a core concept tested in Microsoft Certified: Azure IoT Developer Specialty (AZ-220). Understanding Azure IoT Hub is essential for designing scalable, secure, and cost-effective cloud architectures. Mastery of this topic will help you answer scenario-based questions confidently on exam day.