Microsoft AZ-220 Certification: Microsoft Azure IoT Developer Certification Exam Practice Questions and Answers
Question -19
You have an Azure IoT solution that includes an Azure IoT Hub named Hub1 and an Azure IoT Edge device named Edge1. Edge1 connects to Hub1.
You need to deploy a temperature module to Edge1.
What should you do?
- From the Azure portal, navigate to Hub1 and select IoT Edge. Select Edge1, and then select Manage Child Devices. From a Bash prompt, run the following command: az iot edge set-modules -device-id Edge1 -hub-name Hub1 -content C:\deploymentMan1.json
- Create an IoT Edge deployment manifest that specifies the temperature module and the route to $upstream. From a Bush prompt, run the following command: az iot hub monitor-events-device-id Edge1 -hub-name Hub1
- From the Azure portal, navigate to Hub1 and select IoT Edge. Select Edge1, select Device Twin, and then set the deployment manifest as a desired property. From a Bash prompt, run the following command az iot hub monitor-events-device-id Edge1 -hub-name Hub1
- Create an IoT Edge deployment manifest that specifies the temperature module and the route to $upstream. From a Bush prompt, run the following command: az iot edge set-modules -device-id Edge1 -hub-name Hub1 -content C:\deploymentMan1.json
Correct Answer: D
You deploy modules to your device by applying the deployment manifest that you configured with the module information.
Change directories into the folder where your deployment manifest is saved. If you used one of the VS Code IoT Edge templates, use the deployment.json file in the config folder of your solution directory and not the deployment.template.json file.
Use the following command to apply the configuration to an IoT Edge device: az iot edge set-modules –device-id [device id] –hub-name [hub name] –content [file path]
Reference:
https://docs.microsoft.com/en-us/azure/iot-edge/how-to-deploy-modules-cli
Question -20
You have 1,000 devices that connect to a standard tier Azure IoT hub.
All the devices are commissioned and send telemetry events to the built-in IoT Hub endpoint.
You configure message enrichment on the events endpoint and set the enrichment value to $twin.tags.ipV4.
When you inspect messages on the events endpoint, you discover that all the messages are stamped with a string of “$twin.tags.ipV4”.
What are two possible causes of the issue? Each correct answer presents a complete solution.
NOTE: Each correct selection is worth one point.
- The ipV4 tag is a restricted twin property that is unavailable for message enrichment.
- A standard tier IoT hub does not support device twin properties in message enrichments.
- The device sending the message has no device twin.
- Message enrichment cannot be added to messages going to a built-in endpoint.
- The device twin path used for the value of the enrichment does not exist.
- The device twin property value used for message enrichment is set to “$twin.tags.ipV4”.
Correct Answer: CE
In some cases, if you are applying an enrichment with a value set to a tag or property in the device twin, the value will be stamped as a string value. For example, if an enrichment value is set to $twin.tags.field, the messages will be stamped with the string “$twin.tags.field” rather than the value of that field from the twin. This happens in the following cases:
✑ (C) Your IoT Hub is in the standard tier, but the device sending the message has no device twin.
✑ (E) Your IoT Hub is in the standard tier, but the device twin path used for the value of the enrichment does not exist. For example, if the enrichment value is set to $twin.tags.location, and the device twin does not have a location property under tags, the message is stamped with the string “$twin.tags.location”.
✑ Your IoT Hub is in the basic tier. Basic tier IoT hubs do not support device twins.
Reference:
https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-message-enrichments-overview
Question -21
You have 10 IoT devices that connect to an Azure IoT hub named Hub1.
From Azure Cloud Shell, you run az iot hub monitor-events –hub-name Hub1 and receive the following error message: “az iot hub: ‘monitor-events’ is not in the ‘az iot hub’ command group. See ‘az iot hub –help’.”
You need to ensure that you can run the command successfully.
What should you run first?
- az iot hub monitor-feedback –hub-name Hub1
- az iot hub generate-sas-token –hub-name Hub1
- az iot hub configuration list –hub-name Hub1
- az extension add -name azure-cli-iot-ext
Correct Answer: D
Execute az extension add –name azure-cli-iot-ext once and try again.
In order to read the telemetry from your hub by CLI, you have to enable IoT Extension with the following commands:
Add: az extension add –name azure-cli-iot-ext
Reference:
https://github.com/MicrosoftDocs/azure-docs/issues/20843
Question -22
You are troubleshooting an Azure IoT hub.
You discover that some telemetry messages are dropped before they reach downstream processing.
You suspect that IoT Hub throttling is the root cause.
Which log in the Diagnostics settings of the IoT hub should you use to capture the throttling error events?
- Routes
- DeviceTelemetry
- Connections
- C2DCommands
Correct Answer: B
The device telemetry category tracks errors that occur at the IoT hub and are related to the telemetry pipeline. This category includes errors that occur when sending telemetry events (such as throttling) and receiving telemetry events (such as unauthorized reader). This category cannot catch errors caused by code running on the device itself.
Note: The metric d2c.telemetry.ingress.sendThrottle is the number of throttling errors due to device throughput throttles.
Reference:
https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-monitor-resource-health
Question -23
You have 1,000 devices that connect to an Azure IoT hub.
You are performing a scheduled check of deployed IoT devices.
You plan to run the following command from the Azure CLI prompt. az iot hub query –hub-name hub1 –query-command “SELECT * FROM devices WHERE connectionState = ‘Disconnected'”
What does the command return?
- the Device Disconnected events
- the device twins
- the Connections logs
- the device credentials
Correct Answer: A
The IoT Hub publishes the Microsoft.Devices.DeviceDisconnected event type, which is published when a device is disconnected from an IoT hub.
Reference:
https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-event-grid#event-types
Question -24
You have an Azure IoT solution that includes several Azure IoT hubs.
A new alerting feature was recently added to the IoT devices. The feature uses a new device twin reported property named alertCondition.
You need to send alerts to an Azure Service Bus queue named MessageAlerts. The alerts must include alertCondition and the name of the IoT hub.
Which two actions should you perform? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
- Configure File upload for each IoT hub. Configure the device to send a file to an Azure Storage container that contains the device name and status message.
- Add the following message enrichments: Name = iotHubName Value = $twin.tag.location Endpoint = MessageAlert
- Create an IoT Hub routing rule that has a data source of Device Twin Change Events and select the endpoint for MessageAlerts.
- Add the following message enrichments: Name = iotHubName Value = $iothubname Endpoint = MessageAlert
- Create an IoT Hub routing rule that has a data source of Device Telemetry Messages and select the endpoint for MessageAlerts.
Correct Answer: CD
B: Message enrichments is the ability of the IoT Hub to stamp messages with additional information before the messages are sent to the designated endpoint.
One reason to use message enrichments is to include data that can be used to simplify downstream processing. For example, enriching device telemetry messages with a device twin tag can reduce load on customers to make device twin API calls for this information.
D: Applying enrichments –
The messages can come from any data source supported by IoT Hub message routing, including the following examples:
✑ –>device twin change notifications — changes in the device twin
✑ device telemetry, such as temperature or pressure
✑ device life-cycle events, such as when the device is created or deleted
Reference:
https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-message-enrichments-overview
Question -25
You have an Azure IoT Edge device.
You need to modify the credentials used to access the container registry.
What should you modify?
- A. the @edgeHub module twin
- B. the IoT Edge module
- C. the $edgeAgent module twin
- D. the Azure IoT Hub device twin
Correct Answer: C
The module twin for the IoT Edge agent is called $edgeAgent and coordinates the communications between the IoT Edge agent running on a device and IoT Hub.
The desired properties are set when applying a deployment manifest on a specific device as part of a single-device or at-scale deployment.
These properties include:
✑ runtime.settings.registryCredentials.{registryId}.username
✑ runtime.settings.registryCredentials.registryId}.password
Reference:
https://docs.microsoft.com/en-us/azure/iot-edge/module-edgeagent-edgehub
Question -26
You enable Azure Security Center for IoT.
You need to onboard a device to Azure Security Center.
What should you do?
- A. Add the azureiotsecurity module identity to the Azure IoT Hub device identity.
- B. Open incoming TCP port 8883 on the device.
- C. Modify the connection string of the device.
- D. Install an X.509 certificate on the hardware security module (HSM) of the device.
Correct Answer: A
Use the following workflow to deploy and test your Azure Security Center for IoT security agents:
1. Enable Azure Security Center for IoT service to your IoT Hub
2. If your IoT Hub has no registered devices, Register a new device.
3. Create an azureiotsecurity security module for your devices.
Azure Security Center for IoT makes use of the module twin mechanism and maintains a security module twin named azureiotsecurity for each of your devices.
Note: To manually create a new azureiotsecurity module twin for a device use the following instructions:
1. In your IoT Hub, locate and select the device you wish to create a security module twin for.
2. Click on your device, and then on Add module identity.
3. In the Module Identity Name field, enter azureiotsecurity.
4. Click Save.
Reference:
https://docs.microsoft.com/en-us/azure/asc-for-iot/quickstart-create-security-twin
Question -27
You have an Azure IoT solution that includes an Azure IoT hub, 100 Azure IoT Edge devices, and 500 leaf devices.
You need to perform a key rotation across the devices.
Which three types of entities should you update? Each correct answer presents part of the solution.
NOTE: Each correct selection is worth one point.
- A. the $edgeHub module identity
- B. the $edgeAgent module identity
- C. the leaf module identities
- D. the IoT Edge device identities
- E. the iothubowner policy credentials
- F. the leaf device identities
Correct Answer: ADF
To get authorization to connect to IoT Hub, devices and services must send security tokens signed with either a shared access or symmetric key. These keys are stored with a device identity in the identity registry.
An IoT Hub identity registry can be accessed like a dictionary, by using the deviceId or moduleId as the key.
Reference:
https://docs.microsoft.com/bs-latn-ba/azure/iot-dps/how-to-control-access https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-identity-registry
Previous->Microsoft AZ-220 Certification Exam Practice Questions – Part 3
Next->Microsoft AZ-220 Certification Exam Practice Questions – Part 5
More Exam Questions:
Sample Exam Questions 6: AZ-300: Microsoft Azure Architect Technologies
Sample Exam Questions 5: AZ-300: Microsoft Azure Architect Technologies