az iot ops ns asset stream

Note

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

Manage streams for namespaced assets in an IoT Operations instance.

The connector type is detected automatically from the existing asset. For connector-specific parameters use --stream-config (inline JSON or file). Use --show-template to discover the supported configuration schema for the asset's connector type.

Commands

Name Description Type Status
az iot ops ns asset stream add

Add a stream to a namespaced asset in an IoT Operations instance.

Extension Preview
az iot ops ns asset stream export

Export streams to file.

Extension Preview
az iot ops ns asset stream import

Import streams from file.

Extension Preview
az iot ops ns asset stream list

List streams for a namespaced asset in an IoT Operations instance.

Extension Preview
az iot ops ns asset stream remove

Remove a stream from a namespaced asset in an IoT Operations instance.

Extension Preview
az iot ops ns asset stream show

Show details of a stream for a namespaced asset in an IoT Operations instance.

Extension Preview
az iot ops ns asset stream update

Update a stream for a namespaced asset in an IoT Operations instance.

Extension Preview

az iot ops ns asset stream add

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Add a stream to a namespaced asset in an IoT Operations instance.

The connector type is detected from the asset's device endpoint. Connector-specific configuration and destinations can be supplied via --stream-config. Use --show-template to discover the supported config schema. For non-OPC UA connectors, a connector template must exist in the instance.

az iot ops ns asset stream add --asset
                               --instance
                               --name
                               --resource-group
                               [--acquire-policy-token]
                               [--change-reference]
                               [--replace {false, true}]
                               [--show-template {config, schema}]
                               [--stc --stream-config]
                               [--tr --type-ref]

Examples

Add a basic stream to any asset type

az iot ops ns asset stream add --asset myasset --instance myInstance -g myInstanceResourceGroup --name videoStream

Show the stream config template for the asset's connector type

az iot ops ns asset stream add --asset myasset --instance myInstance -g myInstanceResourceGroup --name videoStream --show-template config

Add a stream with connector-specific configuration from inline JSON

az iot ops ns asset stream add --asset myasset --instance myInstance -g myInstanceResourceGroup --name videoStream --stream-config '{"streamConfiguration": {"taskType": "snapshot-to-mqtt", "snapshotsPerSecond": 5}}'

Add a stream with configuration from a file

az iot ops ns asset stream add --asset myasset --instance myInstance -g myInstanceResourceGroup --name videoStream --stream-config ./stream_config.json

Add a stream with an MQTT destination

az iot ops ns asset stream add --asset myasset --instance myInstance -g myInstanceResourceGroup --name videoStream --stream-config '{"destinations": [{"target": "Mqtt", "configuration": {"topic": "factory/streams", "retain": "Keep", "qos": "Qos1", "ttl": 3600}}]}'

Replace an existing stream

az iot ops ns asset stream add --asset myasset --instance myInstance -g myInstanceResourceGroup --name videoStream --replace

Required Parameters

--asset -a

Asset name.

--instance -i

The name of the Azure IoT Operations instance.

--name -n

Stream name.

--resource-group -g

The resource group of the Azure IoT Operations instance.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--replace

Replace the stream if another stream with the same name is already present.

Property Value
Default value: False
Accepted values: false, true
--show-template

Show a starter stream configuration template for the asset's connector type and exit without modifying the stream. The connector type is read from the existing asset. config: fields shown with their default values (null if no default); output is directly usable as --stream-config input. schema: every field includes type, default, and constraints (min, max, enum, pattern). Draft-07 $ref pointers (#/definitions/...) are resolved inline in both modes.

Property Value
Accepted values: config, schema
--stc --stream-config

Inline JSON string or path to a JSON/YAML file (.json, .yaml, .yml) containing connector-specific stream configuration and/or destinations. Accepted keys are 'streamConfiguration' (connector-specific config object) and 'destinations' (list of destination objects). Use --show-template to discover the supported keys and schema for the asset's connector type. Cannot be combined with --show-template. For non-OPC UA connectors, a connector template must exist in the instance.

--tr --type-ref

Type definition ID or URI.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az iot ops ns asset stream export

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Export streams to file.

az iot ops ns asset stream export --asset
                                  --instance
                                  --resource-group
                                  [--acquire-policy-token]
                                  [--change-reference]
                                  [--format {json, yaml}]
                                  [--od --output-dir]
                                  [--replace {false, true}]

Examples

Export streams to JSON

az iot ops ns asset stream export --asset myasset --instance myInstance -g myInstanceResourceGroup

Required Parameters

--asset -a

Asset name.

--instance -i

The name of the Azure IoT Operations instance.

--resource-group -g

The resource group of the Azure IoT Operations instance.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--format -f

Export file format (JSON or YAML).

Property Value
Default value: json
Accepted values: json, yaml
--od --output-dir

Output directory for export.

Property Value
Default value: .
--replace

Replace the local file if present.

Property Value
Default value: False
Accepted values: false, true
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az iot ops ns asset stream import

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Import streams from file.

az iot ops ns asset stream import --asset
                                  --if --input-file
                                  --instance
                                  --resource-group
                                  [--acquire-policy-token]
                                  [--change-reference]
                                  [--replace {false, true}]

Examples

Import streams from a JSON file

az iot ops ns asset stream import --asset myasset --instance myInstance -g myInstanceResourceGroup --input-file ./streams.json

Required Parameters

--asset -a

Asset name.

--if --input-file

Path to import file (JSON or YAML).

--instance -i

The name of the Azure IoT Operations instance.

--resource-group -g

The resource group of the Azure IoT Operations instance.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--replace

Replace existing streams that share a name with an imported stream.

Property Value
Default value: False
Accepted values: false, true
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az iot ops ns asset stream list

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

List streams for a namespaced asset in an IoT Operations instance.

az iot ops ns asset stream list --asset
                                --instance
                                --resource-group

Examples

List all streams for an asset

az iot ops ns asset stream list --asset myasset --instance myInstance -g myInstanceResourceGroup

Required Parameters

--asset -a

Asset name.

--instance -i

The name of the Azure IoT Operations instance.

--resource-group -g

The resource group of the Azure IoT Operations instance.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az iot ops ns asset stream remove

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Remove a stream from a namespaced asset in an IoT Operations instance.

az iot ops ns asset stream remove --asset
                                  --instance
                                  --name
                                  --resource-group
                                  [--acquire-policy-token]
                                  [--change-reference]

Examples

Remove a stream from an asset

az iot ops ns asset stream remove --asset myasset --instance myInstance -g myInstanceResourceGroup --name videoStream

Required Parameters

--asset -a

Asset name.

--instance -i

The name of the Azure IoT Operations instance.

--name -n

Stream name.

--resource-group -g

The resource group of the Azure IoT Operations instance.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az iot ops ns asset stream show

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Show details of a stream for a namespaced asset in an IoT Operations instance.

az iot ops ns asset stream show --asset
                                --instance
                                --name
                                --resource-group

Examples

Show stream details

az iot ops ns asset stream show --asset myasset --instance myInstance -g myInstanceResourceGroup --name videoStream

Required Parameters

--asset -a

Asset name.

--instance -i

The name of the Azure IoT Operations instance.

--name -n

Stream name.

--resource-group -g

The resource group of the Azure IoT Operations instance.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False

az iot ops ns asset stream update

Preview

This command is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Update a stream for a namespaced asset in an IoT Operations instance.

The connector type is detected from the asset's device endpoint. Use --stream-config to supply connector-specific configuration. Use --show-template config to see current stream values pre-filled in the full schema structure (ready to edit and pass back via --stream-config). Use --show-template schema to see the full connector schema with types and constraints.

az iot ops ns asset stream update --asset
                                  --instance
                                  --name
                                  --resource-group
                                  [--acquire-policy-token]
                                  [--change-reference]
                                  [--show-template {config, schema}]
                                  [--stc --stream-config]
                                  [--tr --type-ref]

Examples

Show current stream config pre-filled with existing values (for editing before update)

az iot ops ns asset stream update --asset myasset --instance myInstance -g myInstanceResourceGroup --name videoStream --show-template config

Show the stream config schema with types and constraints

az iot ops ns asset stream update --asset myasset --instance myInstance -g myInstanceResourceGroup --name videoStream --show-template schema

Update stream configuration from inline JSON

az iot ops ns asset stream update --asset myasset --instance myInstance -g myInstanceResourceGroup --name videoStream --stream-config '{"streamConfiguration": {"snapshotsPerSecond": 10}}'

Update stream type reference

az iot ops ns asset stream update --asset myasset --instance myInstance -g myInstanceResourceGroup --name videoStream --type-ref "myTypeRef"

Required Parameters

--asset -a

Asset name.

--instance -i

The name of the Azure IoT Operations instance.

--name -n

Stream name.

--resource-group -g

The resource group of the Azure IoT Operations instance.

Optional Parameters

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--acquire-policy-token

Acquiring an Azure Policy token automatically for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--change-reference

The related change reference ID for this resource operation.

Property Value
Parameter group: Global Policy Arguments
--show-template

Show a starter stream configuration template for the asset's connector type and exit without modifying the stream. The connector type is read from the existing asset. config: fields shown with their default values (null if no default); output is directly usable as --stream-config input. schema: every field includes type, default, and constraints (min, max, enum, pattern). Draft-07 $ref pointers (#/definitions/...) are resolved inline in both modes.

Property Value
Accepted values: config, schema
--stc --stream-config

Inline JSON string or path to a JSON/YAML file (.json, .yaml, .yml) containing connector-specific stream configuration and/or destinations. Accepted keys are 'streamConfiguration' (connector-specific config object) and 'destinations' (list of destination objects). Use --show-template to discover the supported keys and schema for the asset's connector type. Cannot be combined with --show-template. For non-OPC UA connectors, a connector template must exist in the instance.

--tr --type-ref

Type definition ID or URI.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

Property Value
Default value: False