Share via


az dt twin telemetry

Note

This reference is part of the azure-iot extension for the Azure CLI (version 2.46.0 or higher). The extension will automatically install the first time you run an az dt twin telemetry command. Learn more about extensions.

Test and validate the event routes and endpoints of a Digital Twins instance.

Commands

Name Description Type Status
az dt twin telemetry send

Sends telemetry on behalf of a digital twin. If component path is provided the emitted telemetry is on behalf of the component.

Extension GA

az dt twin telemetry send

Sends telemetry on behalf of a digital twin. If component path is provided the emitted telemetry is on behalf of the component.

az dt twin telemetry send --dt-name
                          --twin-id
                          [--component]
                          [--dt-id]
                          [--resource-group]
                          [--telemetry]
                          [--telemetry-source-time]

Examples

Send twin telemetry

az dt twin telemetry send -n {instance_or_hostname} --twin-id {twin_id}

Send twin telemetry with a custom telemetry source timestamp and message identifier

az dt twin telemetry send -n {instance_or_hostname} --twin-id {twin_id} --tst {telemetry_source_timestamp} --dt-id {dt_id}

Required Parameters

--dt-name --dtn -n

Digital Twins instance name or hostname. If an instance name is provided, the user subscription is first queried for the target instance to retrieve the hostname. If a hostname is provided, the subscription query is skipped and the provided value is used for subsequent interaction.

--twin-id -t

The digital twin Id.

Optional Parameters

--component

The path to the DTDL component. If set, telemetry will be emitted on behalf of the component.

--dt-id

A unique message identifier (in the scope of the digital twin id) that is commonly used for de-duplicating messages. If no value is provided a GUID is automatically generated.

--resource-group -g

Digital Twins instance resource group. You can configure the default group using az configure --defaults group={name}.

--telemetry

Inline telemetry JSON or file path to telemetry JSON. Default payload is an empty object: {}.

--telemetry-source-time --tst

An RFC 3339 timestamp that identifies the time the telemetry was measured.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.