az iot pnp model

Create, view, and publish device models in your company repository.

Commands

az iot pnp model create

Create a new device model in your company repository.

az iot pnp model list

List or search for models in the PnP model repository.

az iot pnp model publish

Publish a device model located in your company repository.

az iot pnp model show

View a device model by ID.

az iot pnp model create

Create a new device model in your company repository.

az iot pnp model create --model
                        [--pnp-dns-suffix]

Examples

Create a new model by uploading a JSON file

az iot pnp model create --model ./path/to/definition/file.json

Required Parameters

--model

IoT Plug and Play capability-model definition written in DTDL (JSON-LD). Can either be directly input or a file path where the content is extracted from.

Optional Parameters

--pnp-dns-suffix

An optional PnP DNS suffix used to interact with different PnP environments.

az iot pnp model list

List or search for models in the PnP model repository.

az iot pnp model list [--keyword]
                      [--model-state {Created, Listed}]
                      [--model-type {Interface, Undetermined}]
                      [--pnp-dns-suffix]
                      [--pub]
                      [--shared {false, true}]
                      [--top]

Examples

List all models in the repository

az iot pnp model list

Search for all 'Listed' models published by a specific tenant

az iot pnp model list --state Listed --publisher-id {tenant_id}

Search for shared interfaces with name or description matching `{keyword}`

az iot pnp model list -q {keyword} --shared --type Interface

Optional Parameters

--keyword -q

Restrict model list to those matching a provided keyword.

--model-state --state

Restrict model list to models with a specific state.

accepted values: Created, Listed
--model-type --type

Restrict model list to models with a specific type.

accepted values: Interface, Undetermined
--pnp-dns-suffix

An optional PnP DNS suffix used to interact with different PnP environments.

--pub --publisher-id

Restrict model list to models published by a specific tenant.

--shared

Restrict model list to shared models only.

accepted values: false, true
--top

Maximum number of elements to return. Use -1 for unlimited.

az iot pnp model publish

Publish a device model located in your company repository.

az iot pnp model publish --dtmi
                         [--pnp-dns-suffix]
                         [--yes {false, true}]

Examples

Publish a model with the ID {dtmi:my:model}

az iot pnp model publish --model-id {dtmi:my:model}

Required Parameters

--dtmi --model-id

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

Optional Parameters

--pnp-dns-suffix

An optional PnP DNS suffix used to interact with different PnP environments.

--yes -y

Skip user prompts. Indicates acceptance of dependency installation (if required). Used primarily for automation scenarios. Default: false.

accepted values: false, true

az iot pnp model show

View a device model by ID.

az iot pnp model show --dtmi
                      [--def {false, true}]
                      [--pnp-dns-suffix]

Examples

View a model with the ID "dtmi:com:example:ClimateSensor;1"

az iot pnp model show --dtmi "dtmi:com:example:ClimateSensor;1"

Required Parameters

--dtmi --model-id

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

Optional Parameters

--def --definition --expand

Expand the model’s referenced definitions inline.

accepted values: false, true
--pnp-dns-suffix

An optional PnP DNS suffix used to interact with different PnP environments.