az dt data-history connection create
Note
This reference is part of the azure-iot extension for the Azure CLI (version 2.59.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 --adxc
--adx-database-name --adxd
--cn --conn-name
--dt-name --dtn
--eh --eventhub
--ehn --eventhub-namespace
[--adx-property-events-table --adxpet]
[--adx-record-removals --adxrr {false, true}]
[--adx-relationship-events-table --adxret]
[--adx-resource-group --adxg]
[--adx-subscription --adxs]
[--adx-table-name --adxt]
[--adx-twin-events-table --adxtet]
[--ehc --eventhub-consumer-group]
[--ehg --eventhub-resource-group]
[--ehs --eventhub-subscription]
[--mi-user-assigned --user]
[--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
Name of Azure Data Explorer cluster to integrate with.
Property | Value |
---|---|
Parameter group: | Azure Data Explorer Arguments |
Name of Azure Data Explorer database to integrate with.
Property | Value |
---|---|
Parameter group: | Azure Data Explorer Arguments |
Name of data history connection.
Digital Twins instance name.
Name of EventHub to integrate with.
Property | Value |
---|---|
Parameter group: | Event Hub Arguments |
EventHub Namespace identifier.
Property | Value |
---|---|
Parameter group: | Event Hub Arguments |
Optional Parameters
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
The name of the Azure Data Explorer table used for storing updates to properties of twins and relationships.
Property | Value |
---|---|
Parameter group: | Azure Data Explorer Arguments |
Default value: | AdtPropertyEvents |
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.
Property | Value |
---|---|
Parameter group: | Azure Data Explorer Arguments |
Default value: | False |
Accepted values: | false, true |
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.
Property | Value |
---|---|
Parameter group: | Azure Data Explorer Arguments |
Name of Azure Data Explorer resource group. If not provided, will use the Digital Twin's resource group.
Property | Value |
---|---|
Parameter group: | Azure Data Explorer Arguments |
Name or id of subscription where the Azure Data Explorer exists. If not provided, will use the subscription that contains the Digital Twin Instance.
Property | Value |
---|---|
Parameter group: | Azure Data Explorer Arguments |
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.
Property | Value |
---|---|
Parameter group: | Azure Data Explorer Arguments |
Default value: | AdtPropertyEvents |
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.
Property | Value |
---|---|
Parameter group: | Azure Data Explorer Arguments |
The EventHub consumer group to use when ADX reads from EventHub.
Property | Value |
---|---|
Parameter group: | Event Hub Arguments |
Default value: | $Default |
Name of EventHub resource group. If not provided, will use the Digital Twin's resource group.
Property | Value |
---|---|
Parameter group: | Event Hub Arguments |
Name or id of subscription where the EventHub exists. If not provided, will use the subscription that contains the Digital Twin Instance.
Property | Value |
---|---|
Parameter group: | Event Hub Arguments |
Use an user-assigned managed identity for data history connection authentication. Accepts the identity resource id. If not provided, will use system identity instead.
Do not wait for the long-running operation to finish.
Property | Value |
---|---|
Default value: | False |
Digital Twins instance resource group. You can configure the default group using az configure --defaults group={name}
.
Do not prompt for confirmation when assigning required roles.
Property | Value |
---|---|
Default value: | False |
Global Parameters
Increase logging verbosity to show all debug logs.
Property | Value |
---|---|
Default value: | False |
Show this help message and exit.
Only show errors, suppressing warnings.
Property | Value |
---|---|
Default value: | False |
Output format.
Property | Value |
---|---|
Default value: | json |
Accepted values: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Property | Value |
---|---|
Default value: | False |