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
Name of Azure Data Explorer cluster to integrate with.
Name of Azure Data Explorer database to integrate with.
Name of data history connection.
Digital Twins instance name.
Name of EventHub to integrate with.
EventHub Namespace identifier.
Optional Parameters
The name of the Azure Data Explorer table used for storing updates to properties of twins and relationships.
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.
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.
Name of Azure Data Explorer resource group. If not provided, will use the Digital Twin's resource group.
Name or id of subscription where the Azure Data Explorer exists. If not provided, will use the subscription that contains the Digital Twin Instance.
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.
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.
The EventHub consumer group to use when ADX reads from EventHub.
Name of EventHub resource group. If not provided, will use the Digital Twin's resource group.
Name or id of subscription where the EventHub exists. If not provided, will use the subscription that contains the Digital Twin Instance.
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.
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.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
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.