az dt data-history connection create

Note

This reference is part of the azure-iot extension for the Azure CLI (version 2.30.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

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.

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 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-resource-group]
                                         [--adx-subscription]
                                         [--adx-table-name]
                                         [--ehc]
                                         [--ehg]
                                         [--ehs]
                                         [--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 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-table-name {adx_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}

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-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

Name of Azure Data Explorer table to be created. If not provided, will use the format adt_dh_{dt_name}_{dt_location}.

--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.

--no-wait

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

--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.