0

We are facing the issue of device connect and disconnect at reguler intervals for devices which are using azure iot sdk for c with version 1.3.10 and connecting using the AMQP protocol, we have enabled the diagnostic setting for all the available log types as given below

Connections
DeviceTelemetry
C2DCommands
DeviceIdentityOperations
FileUploadOperations
Routes
D2CTwinOperations
C2DTwinOperations
TwinQueries
JobsOperations
DirectMethods
DistributedTracing
Configurations
DeviceStreams
AllMetrics

When we are checking in log analytics workspace its not showing any logs at Level Error for query as below for anytime range.
Query in log analytics workspace:
AzureDiagnostics | where ResourceProvider == "MICROSOFT.DEVICES" and ResourceType == "IOTHUBS" | where Category == "Connections" and Level == "Error"

When executing below query
Query in log analytics workspace:
AzureDiagnostics | where ResourceProvider == "MICROSOFT.DEVICES" and ResourceType == "IOTHUBS" | where Category == "Connections"

it has many records for device connect and disconnect with Level Information, however the fields errorMessage and statusCode are null, hence not able to understand the issue of device connect and disconnect. When device is disconnecting and connecting again the diagnostic logging it as an information and not the Error, hence not able to understand which type of device connect / disconnect message logged as error in diagnostic.

  • You need to look for OperationName, ResultType (error code), and ResultDescription (error message) to get more details. Are you seeing null in all these fields? If you don't see any errors, try running the Recently connected devices query. – AshokPeddakotla Aug 11 '21 at 06:43
  • Also, try running this command and see the result: AzureDiagnostics | where ResourceProvider == "MICROSOFT.DEVICES" and ResourceType == "IOTHUBS" | where Level == "Error" | summarize count() by ResultType, ResultDescription, Category, _ResourceId – AshokPeddakotla Aug 11 '21 at 07:16

0 Answers0