Valid Target Conditions for Defining Device Scope: Azure IoT Developer Exam
Question
You are operating a fleet of IoT devices which consists of several different types of environmental sensors.
Because of some changes in the EHS standards, the maximum temperature limits for the sensors must be updated using the automatic device configuration feature of IoT hub.
As the first step of the update process, you need to define the device scope of the operation.
1Which of the above expressions are valid target conditions that can be used to define the scope?tags.deviceType='tempSensors' 2
properties.reported.sensorProperties.model='MX-100C' 3
properties.desired.sensorProperties.HighAverageTemp='35' 4
tags.location.city='Bowmore'
Answers
Explanations
Click on the arrows to vote for the correct answer
A. B. C. D.Correct Answer: B.
Option A is incorrect because the “properties.desired” path in the device twin is used to define the target content (i.e.
the values to be set), not for defining a set of devices.
Option B is CORRECT because the target condition is specified as a query on twin tags and/or reported properties.
The target condition defines the scope of device twins or module twins to be updated.
Option C is incorrect because the “properties.desired” path in the device twin is used to define the target content (i.e.
the values to be set), not for defining a set of devices.
Option D is incorrect because the “properties.desired” path in the device twin is used to define the target content.
Target conditions can be specified using “tags” and/or “properties/reported” paths of the device twin.
Reference:
To define the scope of the operation for updating the maximum temperature limits for the environmental sensors using the automatic device configuration feature of IoT hub, we need to define the target conditions. The target conditions are defined using a query language based on key-value pairs for the device twin properties.
Let's analyze each of the expressions provided in the code snippet to determine which ones are valid target conditions.
tags.deviceType='tempSensors'
: This expression sets thedeviceType
tag for the device twin totempSensors
. This expression targets all devices that have adeviceType
tag set totempSensors
. This is a valid target condition as it filters devices based on a specific tag value.properties.reported.sensorProperties.model='MX-100C'
: This expression sets themodel
reported property for the device twin toMX-100C
. This expression targets all devices that have amodel
reported property set toMX-100C
. However, this expression does not modify any desired properties, which is what we need to update for our scenario. Therefore, this is not a valid target condition for our scenario.properties.desired.sensorProperties.HighAverageTemp='35'
: This expression sets theHighAverageTemp
desired property for the device twin to35
. This expression targets all devices that have aHighAverageTemp
desired property set to35
. This is a valid target condition as it filters devices based on a specific desired property value.tags.location.city='Bowmore'
: This expression sets thecity
tag for the device twin toBowmore
. This expression targets all devices that have acity
tag set toBowmore
. This is a valid target condition as it filters devices based on a specific tag value.
Therefore, the valid target conditions for defining the scope of the operation for updating the maximum temperature limits for the environmental sensors using the automatic device configuration feature of IoT hub are 1 and 3, i.e., option A.