Monitor IoT Hub Connections with Azure Monitor Logs | Exam AZ-220 Study Guide

Detect Connection Errors in IoT Hub | Troubleshooting Guide

Question

You are operating an IoT solution of 1000 field devices.

After several weeks of operation, you notice that a certain group of temperature sensors cease to send telemetry in the morning hours.

You suspect that some kind of connection problems block messages and you decide to create a diagnostic setting in your IoT Hub, route the resource logs to Azure Monitor Logs, and analyze the log by running the following query:

AzureDiagnostics | where ( ResourceType == "IOTHUBS" and  Category == "Connections" and Level == "Error") 
Does it help you to localize the error?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B.

Correct Answer: A.

Option A is CORRECT because to find connection related error events in the log, the “Connections” diagnostic setting has to be configured (see below), and Category == “Connections” has to be used to filter the log entries.

Option B is incorrectbecause it is the “Connections” category that is used to track errors related to the connectivity of the devices.

Diagram:

Diagnostics setting & x

save X Discard te © Provide feedback

A diagnostic setting specifies a list of categories of platform logs and/or metrics that you want to collect from a resource, and
‘one or more destinations that you would stream them to. Normal usage charges for the destination will occur. Learn more
about the different log categories and contents of those logs

Diagnostic setting name * ‘Send connection events to logs v
Category details Destination details
log @ Send to Log Analytics
@ connections subscription
[internal use Vv]
( Devicetelemetry
Log Analytics workspace
[1] cz0cemmands [contoso-la-workspace27 124 ( westus ) Vv]
(L] Deviceldentityoperations (Archive to a storage account
LF Fiteuploadoperations 1 Stream to an event hub

1 routes

Reference:

Yes, the query will help to localize the error.

The query filters the Azure Diagnostic logs based on the ResourceType, Category, and Level of the logs.

The ResourceType is set to IOTHUBS, which means that the logs are specific to IoT Hubs. The Category is set to Connections, which means that the logs are related to connection issues. The Level is set to Error, which means that the logs indicate errors.

By applying this filter, the query returns logs related to errors in the IoT Hub connections. This can be useful for identifying any issues related to the connection between the temperature sensors and the IoT Hub.

By analyzing the logs, it is possible to determine the cause of the errors and take appropriate actions to fix the issue. In this case, if the temperature sensors cease to send telemetry in the morning hours, the logs can help to identify any issues related to connectivity during that time period. This can help to localize the error and take steps to fix it, such as upgrading the firmware on the temperature sensors, replacing faulty hardware, or optimizing the network connectivity.