az iot central app

Manage IoT Central applications.

Create, delete, view, and update your IoT Central apps.

Commands

az iot central app device-twin

Manage IoT Central device twins.

az iot central app device-twin show

Get the device twin from IoT Hub.

az iot central app monitor-events

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

az iot central app 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 app 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 app monitor-events --app-id {app_id}

Basic usage when filtering on target device

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

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

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

Basic usage when filtering on module.

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

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

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

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

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

Receive message annotations (message headers)

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

Receive message annotations + system properties. Never time out.

az iot central app 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 app monitor-events --app-id {app_id} --props all

Receive all messages and parse message payload as JSON

az iot central app 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