az iot central diagnostics

Perform application and device level diagnostics.

Commands

az iot central diagnostics monitor-events

Monitor device telemetry & messages sent to the IoT Hub for an IoT Central app.

az iot central diagnostics monitor-properties

Monitor desired and reported properties sent to/from the IoT Hub for an IoT Central app.

az iot central diagnostics registration-summary

Provides a registration summary of all the devices in an app.

az iot central diagnostics validate-messages

Validate messages sent to the IoT Hub for an IoT Central app.

az iot central diagnostics validate-properties

Validate reported properties sent to IoT Central app.

az iot central diagnostics monitor-events

Monitor device telemetry & messages sent to the IoT Hub for an IoT Central app.

EXPERIMENTAL requires Python 3.5+ This command relies on and may install dependent Cython package (uamqp) upon first execution. https://github.com/Azure/azure-uamqp-python.

az iot central diagnostics monitor-events --app-id
                                          [--central-api-uri]
                                          [--cg]
                                          [--device-id]
                                          [--enqueued-time]
                                          [--module-id]
                                          [--properties {all, anno, app, sys}]
                                          [--repair {false, true}]
                                          [--timeout]
                                          [--token]
                                          [--yes {false, true}]

Examples

Basic usage

az iot central diagnostics monitor-events --app-id {app_id}

Basic usage when filtering on target device

az iot central diagnostics monitor-events --app-id {app_id} -d {device_id}

Basic usage when filtering targeted devices with a wildcard in the ID

az iot central diagnostics monitor-events --app-id {app_id} -d Device*d

Basic usage when filtering on module.

az iot central diagnostics monitor-events --app-id {app_id} -m {module_id}

Basic usage when filtering targeted modules with a wildcard in the ID

az iot central diagnostics monitor-events --app-id {app_id} -m Module*

Filter device and specify an Event Hub consumer group to bind to.

az iot central diagnostics monitor-events --app-id {app_id} -d {device_id} --cg {consumer_group_name}

Receive message annotations (message headers)

az iot central diagnostics monitor-events --app-id {app_id} -d {device_id} --properties anno

Receive message annotations + system properties. Never time out.

az iot central diagnostics monitor-events --app-id {app_id} -d {device_id} --properties anno sys --timeout 0

Receive all message attributes from all device messages

az iot central diagnostics monitor-events --app-id {app_id} --props all

Receive all messages and parse message payload as JSON

az iot central diagnostics monitor-events --app-id {app_id} --output json

Required Parameters

--app-id -n

Target App.

Optional Parameters

--central-api-uri --central-dns-suffix

Central dns suffix. This enables running cli commands against non public/prod environments.

default value: azureiotcentral.com
--cg --consumer-group -c

Specify the consumer group to use when connecting to event hub endpoint.

default value: $Default
--device-id -d

Target Device.

--enqueued-time --et -e

Indicates the time that should be used as a starting point to read messages from the partitions. Units are milliseconds since unix epoch. If no time is indicated "now" is used.

--module-id -m

Iot Edge Module ID.

--properties --props -p

Indicate key message properties to output. sys = system properties, app = application properties, anno = annotations.

accepted values: all, anno, app, sys
--repair -r

Reinstall uamqp dependency compatible with extension version. Default: false.

accepted values: false, true
--timeout --to -t

Maximum seconds to maintain connection without receiving message. Use 0 for infinity.

default value: 300
--token

Authorization token for request. More info available here: https://docs.microsoft.com/en-us/learn/modules/manage-iot-central-apps-with-rest-api/ MUST INCLUDE type (e.g. 'SharedAccessToken ...', 'Bearer ...'). Example: 'Bearer someBearerTokenHere'.

--yes -y

Skip user prompts. Indicates acceptance of dependency installation (if required). Used primarily for automation scenarios. Default: false.

accepted values: false, true

az iot central diagnostics monitor-properties

Monitor desired and reported properties sent to/from the IoT Hub for an IoT Central app.

Polls device-twin from central and compares it to the last device-twin Parses out properties from device-twin, and detects if changes were made Prints subset of properties that were changed within the polling interval.

az iot central diagnostics monitor-properties --app-id
                                              --device-id
                                              [--central-api-uri]
                                              [--token]

Examples

Basic usage

az iot central diagnostics monitor-properties --app-id {app_id} -d {device_id}

Required Parameters

--app-id -n

Target App.

--device-id -d

Target Device.

Optional Parameters

--central-api-uri --central-dns-suffix

Central dns suffix. This enables running cli commands against non public/prod environments.

default value: azureiotcentral.com
--token

Authorization token for request. More info available here: https://docs.microsoft.com/en-us/learn/modules/manage-iot-central-apps-with-rest-api/ MUST INCLUDE type (e.g. 'SharedAccessToken ...', 'Bearer ...'). Example: 'Bearer someBearerTokenHere'.

az iot central diagnostics registration-summary

Provides a registration summary of all the devices in an app.

Note: This command can take a significant amount of time to return if your app contains a lot of devices.

az iot central diagnostics registration-summary --app-id
                                                [--central-api-uri]
                                                [--token]

Examples

Registration summary

az iot central diagnostics registration-summary --app-id {appid}

Required Parameters

--app-id -n

Target App.

Optional Parameters

--central-api-uri --central-dns-suffix

Central dns suffix. This enables running cli commands against non public/prod environments.

default value: azureiotcentral.com
--token

Authorization token for request. More info available here: https://docs.microsoft.com/en-us/learn/modules/manage-iot-central-apps-with-rest-api/ MUST INCLUDE type (e.g. 'SharedAccessToken ...', 'Bearer ...'). Example: 'Bearer someBearerTokenHere'.

az iot central diagnostics validate-messages

Validate messages sent to the IoT Hub for an IoT Central app.

EXPERIMENTAL requires Python 3.5+ This command relies on and may install dependent Cython package (uamqp) upon first execution. https://github.com/Azure/azure-uamqp-python.

az iot central diagnostics validate-messages --app-id
                                             [--central-api-uri]
                                             [--cg]
                                             [--device-id]
                                             [--dr]
                                             [--enqueued-time]
                                             [--max-messages]
                                             [--minimum-severity {error, info, warning}]
                                             [--module-id]
                                             [--properties {all, anno, app, sys}]
                                             [--repair {false, true}]
                                             [--style {csv, json, scroll}]
                                             [--timeout]
                                             [--token]
                                             [--yes {false, true}]

Examples

Basic usage

az iot central diagnostics validate-messages --app-id {app_id}

Output errors as they are detected

az iot central diagnostics validate-messages --app-id {app_id} --style scroll

Basic usage when filtering on target device

az iot central diagnostics validate-messages --app-id {app_id} -d {device_id}

Basic usage when filtering targeted devices with a wildcard in the ID

az iot central diagnostics validate-messages --app-id {app_id} -d Device*

Basic usage when filtering on module.

az iot central diagnostics validate-messages --app-id {app_id} -m {module_id}

Basic usage when filtering targeted modules with a wildcard in the ID

az iot central diagnostics validate-messages --app-id {app_id} -m Module*

Filter device and specify an Event Hub consumer group to bind to.

az iot central diagnostics validate-messages --app-id {app_id} -d {device_id} --cg {consumer_group_name}

Required Parameters

--app-id -n

Target App.

Optional Parameters

--central-api-uri --central-dns-suffix

Central dns suffix. This enables running cli commands against non public/prod environments.

default value: azureiotcentral.com
--cg --consumer-group -c

Specify the consumer group to use when connecting to event hub endpoint.

default value: $Default
--device-id -d

Target Device.

--dr --duration

Maximum duration to receive messages from target device before terminating connection.Use 0 for infinity.

default value: 300
--enqueued-time --et -e

Indicates the time that should be used as a starting point to read messages from the partitions. Units are milliseconds since unix epoch. If no time is indicated "now" is used.

--max-messages --mm

Maximum number of messages to recieve from target device before terminating connection.Use 0 for infinity.

default value: 10
--minimum-severity

Minimum severity of issue required for reporting.

accepted values: error, info, warning
default value: warning
--module-id -m

Iot Edge Module ID.

--properties --props -p

Indicate key message properties to output. sys = system properties, app = application properties, anno = annotations.

accepted values: all, anno, app, sys
--repair -r

Reinstall uamqp dependency compatible with extension version. Default: false.

accepted values: false, true
--style

Indicate output stylescroll = deliver errors as they arrive, json = summarize results as json, csv = summarize results as csv.

accepted values: csv, json, scroll
default value: scroll
--timeout --to -t

Maximum seconds to maintain connection without receiving message. Use 0 for infinity.

default value: 300
--token

Authorization token for request. More info available here: https://docs.microsoft.com/en-us/learn/modules/manage-iot-central-apps-with-rest-api/ MUST INCLUDE type (e.g. 'SharedAccessToken ...', 'Bearer ...'). Example: 'Bearer someBearerTokenHere'.

--yes -y

Skip user prompts. Indicates acceptance of dependency installation (if required). Used primarily for automation scenarios. Default: false.

accepted values: false, true

az iot central diagnostics validate-properties

Validate reported properties sent to IoT Central app.

Performs validations on reported property updates:

  1. Warning - Properties sent by device that are not modeled in central.
  2. Warning - Properties with same name declared in multiple interfaces should have interface name included as part of the property update.
az iot central diagnostics validate-properties --app-id
                                               --device-id
                                               [--central-api-uri]
                                               [--minimum-severity {error, info, warning}]
                                               [--token]

Examples

Basic usage

az iot central diagnostics validate-properties --app-id {app_id} -d {device_id}

Required Parameters

--app-id -n

Target App.

--device-id -d

Target Device.

Optional Parameters

--central-api-uri --central-dns-suffix

Central dns suffix. This enables running cli commands against non public/prod environments.

default value: azureiotcentral.com
--minimum-severity

Minimum severity of issue required for reporting.

accepted values: error, info, warning
default value: warning
--token

Authorization token for request. More info available here: https://docs.microsoft.com/en-us/learn/modules/manage-iot-central-apps-with-rest-api/ MUST INCLUDE type (e.g. 'SharedAccessToken ...', 'Bearer ...'). Example: 'Bearer someBearerTokenHere'.