แชร์ผ่าน


az dt data-history connection create

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 data-history connection create command. Learn more about extensions.

Creates a data history connection between a Digital Twins instance and supported resources.

Commands

Name Description Type Status
az dt data-history connection create adx

Creates a data history connection between a Digital Twins instance and an Azure Data Explorer database. Requires pre-created Azure Data Explorer and Event Hub resources.

Extension GA

az dt data-history connection create adx

Creates a data history connection between a Digital Twins instance and an Azure Data Explorer database. Requires pre-created Azure Data Explorer and Event Hub resources.

Will prompt the user to add the following roles and permissions on the Digital Twins instance or User Assigned Identity needed to successfully create the connection:

  • 'Contributor' role for the Azure Data Explorer Database scope
  • 'Database Admin' permission for the Azure Data Explorer Database scope
  • 'Azure Event Hubs Data Owner' role for the Event Hub scope.
az dt data-history connection create adx --adx-cluster-name
                                         --adx-database-name
                                         --cn
                                         --dt-name
                                         --eh
                                         --ehn
                                         [--adx-property-events-table]
                                         [--adx-record-removals {false, true}]
                                         [--adx-relationship-events-table]
                                         [--adx-resource-group]
                                         [--adx-subscription]
                                         [--adx-table-name]
                                         [--adx-twin-events-table]
                                         [--ehc]
                                         [--ehg]
                                         [--ehs]
                                         [--mi-user-assigned]
                                         [--no-wait]
                                         [--resource-group]
                                         [--yes]

Examples

Adds a data history connection to a target Digital Twins instance with the $Default Event Hub consumer group.

az dt data-history connection create adx -n {instance_name} --cn {time_series_database_connection_name} --adx-cluster-name {adx_cluster_name} --adx-database-name {adx_database_name} --eventhub {event_hub} --eventhub-namespace {event_hub_namespace}

Adds a data history connection to a target Digital Twins instance using a User Assigned Identity associated with the Digital twin with the $Default Event Hub consumer group.

az dt data-history connection create adx -n {instance_name} --cn {time_series_database_connection_name} --adx-cluster-name {adx_cluster_name} --adx-database-name {adx_database_name} --eventhub {event_hub} --eventhub-namespace {event_hub_namespace} --mi-user-assigned {resource_id}

Adds a data history connection to a target Digital Twins instance with a custom Azure Data Explorer table name and Event Hub consumer group.

az dt data-history connection create adx -n {instance_name} --cn {time_series_database_connection_name} --adx-cluster-name {adx_cluster_name} --adx-database-name {adx_database_name} --adx-property-events-table {adx_property_events_table_name} --eventhub {event_hub} --eventhub-namespace {event_hub_namespace} --eventhub-consumer-group {event_hub_consumer_group}

Adds a data history connection to a target Digital Twins instance integrating with an Event Hub and Azure Data Explorer instances in different resource groups and subscriptions from the target instance.

az dt data-history connection create adx -n {instance_name} --cn {time_series_database_connection_name} --adx-cluster-name {adx_cluster_name} --adx-database-name {adx_database_name} --adx-resource-group {adx_resource_group} --adx-subscription {adx_subscription} --eventhub {event_hub} --eventhub-namespace {event_hub_namespace} --eventhub-resource-group {event_hub_resource_group} --eventhub-subscription {event_subscription}

Adds a data history connection to a target Digital Twins instance with the $Default Event Hub consumer group and skip the role assignment prompts.

az dt data-history connection create adx -n {instance_name} -y --cn {time_series_database_connection_name} --adx-cluster-name {adx_cluster_name} --adx-database-name {adx_database_name} --eventhub {event_hub} --eventhub-namespace {event_hub_namespace}

Adds a data history connection to a target Digital Twins instance with the $Default Event Hub consumer group and enables record property and item removals. An additional column will be added to the table used for storing updates to properties of twins and relationships (defaulted to AdtPropertyEvents).

az dt data-history connection create adx -n {instance_name} --cn {time_series_database_connection_name} --adx-cluster-name {adx_cluster_name} --adx-database-name {adx_database_name} --eventhub {event_hub} --eventhub-namespace {event_hub_namespace} --adx-record-removals true

Adds a data history connection to a target Digital Twins instance with the $Default Event Hub consumer group and creates two extra tables in the Azure Data Explorer database. One table will be for recording twin lifecycle events and the other for relationship lifecycle events.

az dt data-history connection create adx -n {instance_name} --cn {time_series_database_connection_name} --adx-cluster-name {adx_cluster_name} --adx-database-name {adx_database_name} --eventhub {event_hub} --eventhub-namespace {event_hub_namespace} --adx-twin-events-table {adx_twin_events_table_name} --adx-relationship-events-table {adx_relationship_events_table_name}

Adds a data history connection to a target Digital Twins instance with the $Default Event Hub consumer group, uses a custom twin property event table name, and creates two extra tables in the Azure Data Explorer database.

az dt data-history connection create adx -n {instance_name} --cn {time_series_database_connection_name} --adx-cluster-name {adx_cluster_name} --adx-database-name {adx_database_name} --eventhub {event_hub} --eventhub-namespace {event_hub_namespace} --adx-property-events-table {adx_property_events_table_name} --adx-twin-events-table {adx_twin_events_table_name} --adx-relationship-events-table {adx_relationship_events_table_name}

Required Parameters

--adx-cluster-name --adxc

Name of Azure Data Explorer cluster to integrate with.

--adx-database-name --adxd

Name of Azure Data Explorer database to integrate with.

--cn --conn-name

Name of data history connection.

--dt-name --dtn -n

Digital Twins instance name.

--eh --eventhub

Name of EventHub to integrate with.

--ehn --eventhub-namespace

EventHub Namespace identifier.

Optional Parameters

--adx-property-events-table --adxpet

The name of the Azure Data Explorer table used for storing updates to properties of twins and relationships.

Default value: AdtPropertyEvents
--adx-record-removals --adxrr

Specifies whether or not to record twin / relationship property and item removals, including removals of indexed or keyed values (such as map entries, array elements, etc.). Setting this property to 'true' will generate an additional column in the property events table in ADX.

Accepted values: false, true
Default value: False
--adx-relationship-events-table --adxret

The name of the Azure Data Explorer table used for recording relationship lifecycle events. The table will not be created if this property is left unspecified.

--adx-resource-group --adxg

Name of Azure Data Explorer resource group. If not provided, will use the Digital Twin's resource group.

--adx-subscription --adxs

Name or id of subscription where the Azure Data Explorer exists. If not provided, will use the subscription that contains the Digital Twin Instance.

--adx-table-name --adxt
Deprecated

Option '--adx-table-name' has been deprecated and will be removed in a future release. Use '--adx-property-events-table' instead.

The name of the Azure Data Explorer table used for storing updates to properties of twins and relationships.

Default value: AdtPropertyEvents
--adx-twin-events-table --adxtet

The name of the Azure Data Explorer table used for recording twin lifecycle events. The table will not be created if this property is left unspecified.

--ehc --eventhub-consumer-group

The EventHub consumer group to use when ADX reads from EventHub.

Default value: $Default
--ehg --eventhub-resource-group

Name of EventHub resource group. If not provided, will use the Digital Twin's resource group.

--ehs --eventhub-subscription

Name or id of subscription where the EventHub exists. If not provided, will use the subscription that contains the Digital Twin Instance.

--mi-user-assigned --user

Use an user-assigned managed identity for data history connection authentication. Accepts the identity resource id. If not provided, will use system identity instead.

--no-wait

Do not wait for the long-running operation to finish.

Default value: False
--resource-group -g

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

--yes -y

Do not prompt for confirmation when assigning required roles.

Default value: False
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.