az dt

Note

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

Manage Azure Digital Twins solutions & infrastructure.

Commands

az dt create

Create or update a Digital Twins instance.

az dt data-history

Manage and configure data history.

az dt data-history connection

Manage and configure data history connections.

az dt data-history connection create

Creates a data history connection between a Digital Twins instance and supported 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.

az dt data-history connection delete

Delete a data history connection configured on a Digital Twins instance.

az dt data-history connection list

List all data history connections configured on a Digital Twins instance.

az dt data-history connection show

Show details of a data history connection configured on a Digital Twins instance.

az dt data-history connection wait

Wait until an operation on a data history connection is complete.

az dt delete

Delete an existing Digital Twins instance.

az dt endpoint

Manage and configure Digital Twins instance endpoints.

az dt endpoint create

Add egress endpoints to a Digital Twins instance.

az dt endpoint create eventgrid

Adds an EventGrid Topic endpoint to a Digital Twins instance. Requires pre-created resource.

az dt endpoint create eventhub

Adds an EventHub endpoint to a Digital Twins instance.

az dt endpoint create servicebus

Adds a ServiceBus Topic endpoint to a Digital Twins instance.

az dt endpoint delete

Remove an endpoint from a Digital Twins instance.

az dt endpoint list

List all egress endpoints configured on a Digital Twins instance.

az dt endpoint show

Show details of an endpoint configured on a Digital Twins instance.

az dt endpoint wait

Wait until an endpoint operation is done.

az dt identity

Manage identites of a Digital Twins instance.

az dt identity assign

Assign managed identities to a Digital Twins instance.

az dt identity remove

Remove managed identities from a Digital Twins instance.

az dt identity show

Show the identity properties of a Digital Twins instance.

az dt job

Manage and configure jobs for a digital twin instance.

az dt job import

Manage and configure jobs for importing model, twin and relationships data to a digital twin instance.

az dt job import cancel

Cancel a data import job executed on a digital twins instance.

az dt job import create

Create and execute a data import job on a digital twin instance.

az dt job import delete

Delete a data import job executed on a digital twins instance.

az dt job import list

List all data import jobs executed on a digital twins instance.

az dt job import show

Show details of a data import job executed on a digital twins instance.

az dt list

List the collection of Digital Twins instances by subscription or resource group.

az dt model

Manage DTDL models and definitions on a Digital Twins instance.

az dt model create

Uploads one or more models.

az dt model delete

Delete a model. A model can only be deleted if no other models reference it.

az dt model delete-all

Delete all models within a Digital Twins instance.

az dt model list

List model metadata, definitions and dependencies.

az dt model show

Retrieve a target model or model definition.

az dt model update

Updates the metadata for a model. Currently a model can only be decommisioned.

az dt network

Manage Digital Twins network configuration including private links and endpoint connections.

az dt network private-endpoint

Manage Digital Twins instance private-endpoints.

az dt network private-endpoint connection

Manage Digital Twins instance private-endpoint connections.

az dt network private-endpoint connection delete

Delete a private-endpoint connection associated with the Digital Twins instance.

az dt network private-endpoint connection list

List private-endpoint connections associated with the Digital Twins instance.

az dt network private-endpoint connection set

Set the state of a private-endpoint connection associated with the Digital Twins instance.

az dt network private-endpoint connection show

Show a private-endpoint connection associated with the Digital Twins instance.

az dt network private-endpoint connection wait

Wait until an operation on a private-endpoint connection is complete.

az dt network private-link

Manage Digital Twins instance private-link operations.

az dt network private-link list

List private-links associated with the Digital Twins instance.

az dt network private-link show

Show a private-link associated with the instance.

az dt reset

Reset an existing Digital Twins instance by deleting associated assets. Currently only supports deleting models and twins.

az dt role-assignment

Manage RBAC role assignments for a Digital Twins instance.

az dt role-assignment create

Assign a user, group or service principal to a role against a Digital Twins instance.

az dt role-assignment delete

Remove a user, group or service principal role assignment from a Digital Twins instance.

az dt role-assignment list

List the existing role assignments of a Digital Twins instance.

az dt route

Manage and configure event routes.

az dt route create

Add an event route to a Digital Twins instance.

az dt route delete

Remove an event route from a Digital Twins instance.

az dt route list

List the configured event routes of a Digital Twins instance.

az dt route show

Show details of an event route configured on a Digital Twins instance.

az dt show

Show an existing Digital Twins instance.

az dt twin

Manage and configure the digital twins of a Digital Twins instance.

az dt twin component

Show and update the digital twin components of a Digital Twins instance.

az dt twin component show

Show details of a digital twin component.

az dt twin component update

Update a digital twin component via JSON patch specification.

az dt twin create

Create a digital twin on an instance.

az dt twin delete

Remove a digital twin. All relationships referencing this twin must already be deleted.

az dt twin delete-all

Deletes all digital twins within a Digital Twins instance, including all relationships for those twins.

az dt twin query

Query the digital twins of an instance. Allows traversing relationships and filtering by property values.

az dt twin relationship

Manage and configure the digital twin relationships of a Digital Twins instance.

az dt twin relationship create

Create a relationship between source and target digital twins.

az dt twin relationship delete

Delete a digital twin relationship on a Digital Twins instance.

az dt twin relationship delete-all

Deletes all digital twin relationships within a Digital Twins instance, including incoming relationships.

az dt twin relationship list

List the relationships of a digital twin.

az dt twin relationship show

Show details of a digital twin relationship.

az dt twin relationship update

Updates the properties of a relationship between two digital twins via JSON patch specification.

az dt twin show

Show the details of a digital twin.

az dt twin telemetry

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

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 update

Update an instance digital twin via JSON patch specification.

az dt wait

Wait until an operation on an Digital Twins instance is complete.

az dt create

Create or update a Digital Twins instance.

az dt create --dt-name
             --resource-group
             [--assign-identity {false, true}]
             [--location]
             [--mi-system-assigned {false, true}]
             [--mi-user-assigned]
             [--no-wait]
             [--pna {Disabled, Enabled}]
             [--role]
             [--scopes]
             [--tags]

Examples

Create instance in target resource group using the resource group location.

az dt create -n {instance_name} -g {resouce_group}

Create instance in target resource group with specified location and tags.

az dt create -n {instance_name} -g {resouce_group} -l westus --tags a=b c=d

Create instance in the target resource group with a system managed identity.

az dt create -n {instance_name} -g {resouce_group} --mi-system-assigned

Create instance in the target resource group with a user managed identity.

az dt create -n {instance_name} -g {resouce_group} --mi-user-assigned {resource_id}

Create instance in the target resource group with a system managed identity and multiple user managed identities.

az dt create -n {instance_name} -g {resouce_group} --mi-system-assigned --mi-user-assigned {resource_id} {resource_id}

Create instance in the target resource group with a system managed identity then assign the identity to one or more scopes (space-separated) with the role of Contributor.

az dt create -n {instance_name} -g {resouce_group} --mi-system-assigned --scopes "/subscriptions/a12345ea-bb21-994d-2263-c716348e32a1/resourceGroups/ProResourceGroup/providers/Microsoft.EventHub/namespaces/myEventHubNamespace/eventhubs/myEventHub" "/subscriptions/a12345ea-bb21-994d-2263-c716348e32a1/resourceGroups/ProResourceGroup/providers/Microsoft.ServiceBus/namespaces/myServiceBusNamespace/topics/myTopic"

Create instance in the target resource group with a system managed identity then assign the identity to one or more scopes with a custom specified role.

az dt create -n {instance_name} -g {resouce_group} --mi-system-assigned --scopes "/subscriptions/a12345ea-bb21-994d-2263-c716348e32a1/resourceGroups/ProResourceGroup/providers/Microsoft.EventHub/namespaces/myEventHubNamespace/eventhubs/myEventHub" "/subscriptions/a12345ea-bb21-994d-2263-c716348e32a1/resourceGroups/ProResourceGroup/providers/Microsoft.ServiceBus/namespaces/myServiceBusNamespace/topics/myTopic" --role MyCustomRole

Update an instance in the target resource group with new tag values and disable public network access.

az dt create -n {instance_name} -g {resouce_group} --tags env=prod --public-network-access Disabled

Required Parameters

--dt-name --dtn -n

Digital Twins instance name.

--resource-group -g

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

Optional Parameters

--assign-identity

Assign a system generated identity to the Digital Twins instance.

accepted values: false, true
--location -l

Digital Twins instance location. If no location is provided the resource group location is used.You can configure the default location using az configure --defaults location=<name>.

--mi-system-assigned

Assign a system generated identity to this Digital Twins instance.

accepted values: false, true
--mi-user-assigned

Space-separated user identity resource ids to add to the Digital Twins instance.

--no-wait

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

default value: False
--pna --public-network-access

Determines if the Digital Twins instance can be accessed from a public network.

accepted values: Disabled, Enabled
default value: Enabled
--role

Role name or Id the system assigned identity will have.

default value: Contributor
--scopes

Space-separated scopes the system assigned identity can access. Cannot be used with --no-wait.

--tags

Digital Twins instance tags. Property bag in key-value pairs with the following format: a=b c=d.

az dt delete

Delete an existing Digital Twins instance.

az dt delete --dt-name
             [--no-wait]
             [--resource-group]
             [--yes]

Examples

Delete an arbitrary instance in blocking fashion with a confirmation prompt.

az dt delete -n {instance_name}

Delete an arbitrary instance with no blocking or prompt.

az dt delete -n {instance_name} -y --no-wait

Required Parameters

--dt-name --dtn -n

Digital Twins instance name.

Optional Parameters

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

default value: False

az dt list

List the collection of Digital Twins instances by subscription or resource group.

az dt list [--resource-group]

Examples

List all instances in the current subscription.

az dt list

List all instances in target resource group and output in table format.

az dt list -g {resource_group} --output table

List all instances in subscription that meet a condition.

az dt list --query "[?contains(name, 'Production')]"

Count instances that meet condition.

az dt list --query "length([?contains(name, 'Production')])"

Optional Parameters

--resource-group -g

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

az dt reset

Reset an existing Digital Twins instance by deleting associated assets. Currently only supports deleting models and twins.

az dt reset --dt-name
            [--resource-group]
            [--yes]

Examples

Reset all assets for a Digital Twins instance.

az dt reset -n {instance_name}

Required Parameters

--dt-name --dtn -n

Digital Twins instance name.

Optional Parameters

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

default value: False

az dt show

Show an existing Digital Twins instance.

az dt show --dt-name
           [--resource-group]

Examples

Show an instance.

az dt show -n {instance_name}

Show an instance and project certain properties.

az dt show -n {instance_name} --query "{Endpoint:hostName, Location:location}"

Required Parameters

--dt-name --dtn -n

Digital Twins instance name.

Optional Parameters

--resource-group -g

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

az dt wait

Wait until an operation on an Digital Twins instance is complete.

az dt wait --dt-name
           [--created]
           [--custom]
           [--deleted]
           [--exists]
           [--interval]
           [--resource-group]
           [--timeout]

Examples

Wait until an arbitrary instance is created.

az dt wait -n {instance_name} --created

Wait until an existing instance is deleted.

az dt wait -n {instance_name} --deleted

Wait until an existing instance's publicNetworkAccess property is set to Enabled

az dt wait -n {instance_name} --custom "publicNetworkAccess=='Enabled'"

Required Parameters

--dt-name --dtn -n

Digital Twins instance name.

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

default value: False
--exists

Wait until the resource exists.

default value: False
--interval

Polling interval in seconds.

default value: 30
--resource-group -g

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

--timeout

Maximum wait in seconds.

default value: 3600