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

Deploying Interdependent Custom Modules for IoT Edge 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 configuration code is defining two routes to enable communication between two custom modules on an IoT Edge device, and between the device and IoT Hub.

The first route, named "sensorToFilter", defines the source as the "temperatureOutput" output of the "TempSensor" module and the destination as the "inp1" input of the "Filter" module. This route has a priority of 0, which means it will be evaluated before the second route, and it does not have a time-to-live configuration.

The second route, named "filterToIoTHub", defines the source as the "output1" output of the "Filter" module and the destination as the upstream endpoint of the IoT Edge device. This route has a higher priority of 1, which means it will be evaluated after the first route, and it has a time-to-live configuration of 1800 seconds.

In addition to the routes, the code also includes a store-and-forward configuration for the IoT Edge device with a time-to-live configuration of 100 seconds.

Based on the provided information, the code appears to be correctly defining the two routes for communication between the "TempSensor" and "Filter" modules, as well as between the IoT Edge device and IoT Hub. The store-and-forward configuration is also included.

Therefore, the answer is D. Yes, it is correct.