Configure Device Scope for Azure IoT Sensors: Valid Target Conditions | Exam AZ-220

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.

1

tags.deviceType='tempSensors' 2

properties.reported.sensorProperties.model='MX-100C' 3

properties.desired.sensorProperties.HighAverageTemp='35' 4

tags.location.city='Bowmore'

Which of the above expressions are valid target conditions that can be used to define the scope?

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.

  1. tags.deviceType='tempSensors': This expression sets the deviceType tag for the device twin to tempSensors. This expression targets all devices that have a deviceType tag set to tempSensors. This is a valid target condition as it filters devices based on a specific tag value.

  2. properties.reported.sensorProperties.model='MX-100C': This expression sets the model reported property for the device twin to MX-100C. This expression targets all devices that have a model reported property set to MX-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.

  3. properties.desired.sensorProperties.HighAverageTemp='35': This expression sets the HighAverageTemp desired property for the device twin to 35. This expression targets all devices that have a HighAverageTemp desired property set to 35. This is a valid target condition as it filters devices based on a specific desired property value.

  4. tags.location.city='Bowmore': This expression sets the city tag for the device twin to Bowmore. This expression targets all devices that have a city tag set to Bowmore. 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.