Deploying Interdependent Custom Modules for IoT Solution | Microsoft Azure IoT Developer Exam - AZ-220

Configure and Deploy Custom Modules for Computation-Intensive Tasks in IoT Devices

Question

As part of an IoT solution, you have to deploy image recognition logic to certain field devices, in order to complete computation-intensive tasks locally.

The devices are already registered in the IoT Hub as edge devices.

Your task is to go on with their configuration and deploy the runtime logic.

You have to deploy 2 interdependent custom modules (TempSensor, Filter) to your device.

To define the flow of data between them, you add the following configuration to your deployment manifest:

"$edgeAgent": { "properties.desired": { "schemaVersion": "1.1", "routes": { "sensorToFilter": {  "route":  "FROM /messages/modules/TempSensor/outputs/temperatureOutput   INTO BrokeredEndpoint(\"/modules/Filter/inputs/inp1\")",  "priority": 0,  }, "filterToIoTHub": {  "route":   "FROM /messages/modules/Filter/outputs/output1 INTO $upstream",  "priority": 1,  "timeToLiveSecs": 1800 } }, "storeAndForwardConfiguration": { "timeToLiveSecs": 100  }  } } 
Does the code do its job as expected?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D.

Correct Answer: A.

Option A is CORRECT because actually, configuration of the routes between the edge modules must be described under the $edgeHub tag since it is the edgeHub that is responsible for the orchestration of the message flows between the modules.

Option B is incorrect because the sensorToFilter route connects the TempSensor to the Filter module, therefore its source setting is correct.

$downstream is not a valid source setting.

Option C is incorrect because the timeToLiveSecs parameter of the routes inherits its value from the storeAndForwardConfiguration of the edgeHub if it is not explicitly set, i.e.

it is not required.

Option D is incorrect because the configuration of the routes between the edge modules must be described under the $edgeHub tag, rather than the $edgeAgent.

References:

The provided deployment manifest adds configuration for the edge agent module in an Azure IoT Edge device. The configuration specifies two routes to define the flow of data between two custom modules, TempSensor and Filter, and between the Filter module and the IoT Hub.

The first route, named sensorToFilter, specifies that the input message for the Filter module should come from the temperatureOutput of the TempSensor module. The second route, named filterToIoTHub, specifies that the output message from the Filter module should be sent to the IoT Hub.

The priority of the routes is set to determine the order of processing, with a priority of 0 for sensorToFilter and 1 for filterToIoTHub. The timeToLiveSecs property is set for the filterToIoTHub route to specify the maximum time that the message can be stored and forwarded to the IoT Hub in case of a connectivity issue.

The storeAndForwardConfiguration property is also set for the $edgeAgent module to configure the maximum time that messages can be stored and forwarded within the device in case of a temporary disconnection from the IoT Hub.

Answer D is correct: the provided code does its job as expected, as it defines the routes for the TempSensor and Filter modules and specifies the maximum time that messages can be stored and forwarded in the device and to the IoT Hub.

Answer A is incorrect because the provided configuration is for the $edgeAgent module, not the $edgeHub module, and it does not need to be part of the $edgeHub configuration.

Answer B is incorrect because the TempSensor module is a source module and its source should not be set to $downstream, which is reserved for sink modules.

Answer C is incorrect because the timeToLiveSecs property is specified for the filterToIoTHub route as required.