az dt model

Manage DTDL models and definitions on a Digital Twins instance.

Commands

az dt model create

Uploads one or more models. When any error occurs, no models are uploaded.

az dt model delete

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

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

Uploads one or more models. When any error occurs, no models are uploaded.

--models can be inline json or file path.

az dt model create --dt-name
                   [--fd]
                   [--models]
                   [--resource-group]

Examples

Bulk upload all .json or .dtdl model files from a target directory. Model processing is recursive.

az dt model create -n {instance_or_hostname} --from-directory {directory_path}

Upload model json inline or from file path.

az dt model create -n {instance_or_hostname} --models {file_path_or_inline_json}

Required Parameters

--dt-name --dtn -n

Digital Twins instance name or hostname. If an instance name is provided, the user subscription is first queried for the target instance to retrieve the hostname. If a hostname is provided, the subscription query is skipped and the provided value is used for subsequent interaction.

Optional Parameters

--fd --from-directory

The directory JSON model files will be parsed from.

--models

Inline model JSON or file path to model JSON.

--resource-group -g

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

az dt model delete

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

az dt model delete --dt-name
                   --dtmi
                   [--resource-group]

Examples

Delete a target model.

az dt model delete -n {instance_or_hostname} --dtmi "dtmi:example:Floor;1"

Required Parameters

--dt-name --dtn -n

Digital Twins instance name or hostname. If an instance name is provided, the user subscription is first queried for the target instance to retrieve the hostname. If a hostname is provided, the subscription query is skipped and the provided value is used for subsequent interaction.

--dtmi --model-id -m

Digital Twins model Id. Example: dtmi:example:Room;2.

Optional Parameters

--resource-group -g

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

az dt model list

List model metadata, definitions and dependencies.

az dt model list --dt-name
                 [--def {false, true}]
                 [--dependencies-for]
                 [--resource-group]

Examples

List model metadata

az dt model list -n {instance_or_hostname}

List model definitions

az dt model list -n {instance_or_hostname} --definition

List dependencies of particular pre-existing model(s). Space seperate dtmi values.

az dt model list -n {instance_or_hostname} --dependencies-for {model_id0} {model_id1}

Required Parameters

--dt-name --dtn -n

Digital Twins instance name or hostname. If an instance name is provided, the user subscription is first queried for the target instance to retrieve the hostname. If a hostname is provided, the subscription query is skipped and the provided value is used for subsequent interaction.

Optional Parameters

--def --definition

The operation will retrieve the model definition.

accepted values: false, true
--dependencies-for

The set of models which will have their dependencies retrieved. If omitted, all models are retrieved. Format is a whitespace separated list.

--resource-group -g

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

az dt model show

Retrieve a target model or model definition.

az dt model show --dt-name
                 --dtmi
                 [--def {false, true}]
                 [--resource-group]

Examples

Show model meta data

az dt model show -n {instance_or_hostname} --dtmi "dtmi:example:Floor;1"

Show model meta data and definition

az dt model show -n {instance_or_hostname} --dtmi "dtmi:example:Floor;1" --definition

Required Parameters

--dt-name --dtn -n

Digital Twins instance name or hostname. If an instance name is provided, the user subscription is first queried for the target instance to retrieve the hostname. If a hostname is provided, the subscription query is skipped and the provided value is used for subsequent interaction.

--dtmi --model-id -m

Digital Twins model Id. Example: dtmi:example:Room;2.

Optional Parameters

--def --definition

The operation will retrieve the model definition.

accepted values: false, true
--resource-group -g

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

az dt model update

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

az dt model update --dt-name
                   --dtmi
                   [--decommission {false, true}]
                   [--resource-group]

Examples

Decommision a target model

az dt model update -n {instance_or_hostname} --dtmi "dtmi:example:Floor;1" --decommission

Required Parameters

--dt-name --dtn -n

Digital Twins instance name or hostname. If an instance name is provided, the user subscription is first queried for the target instance to retrieve the hostname. If a hostname is provided, the subscription query is skipped and the provided value is used for subsequent interaction.

--dtmi --model-id -m

Digital Twins model Id. Example: dtmi:example:Room;2.

Optional Parameters

--decommission

Indicates intent to decommission a target model.

accepted values: false, true
--resource-group -g

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