az iot edge deployment

Manage IoT Edge deployments at scale.

Commands

az iot edge deployment create Create an IoT Edge deployment in the target IoT Hub.
az iot edge deployment delete Delete an IoT Edge deployment.
az iot edge deployment list List IoT Edge deployments in an IoT Hub.
az iot edge deployment show Get the details of an IoT Edge deployment.
az iot edge deployment show-metric Evaluate a target system metric defined in an IoT Edge deployment.
az iot edge deployment update Update an IoT Edge deployment with the specified properties.

az iot edge deployment create

Create an IoT Edge deployment in the target IoT Hub.

az iot edge deployment create --config-id
--content
[--hub-name]
[--lab]
[--login]
[--pri]
[--resource-group]
[--target-condition]

Examples

Create a deployment with labels (bash syntax example) that applies for devices in 'building 9' and the environment is 'test'.

az iot edge deployment create -d {deployment_name} -n {iothub_name} --content ../modules_content.json --labels '{"key0":"value0", "key1":"value1"}' --target-condition "tags.building=9 and tags.environment='test'" --priority 3

Create a deployment with labels (cmd syntax example) that applies for devices tagged with environment 'dev'.

az iot edge deployment create -d {deployment_name} -n {iothub_name} --content ../modules_content.json --labels "{\"key\":\"value\"}" --target-condition "tags.environment='dev'"

Required Parameters

--config-id --deployment-id -c -d

Target deployment. --config-id/-c is deprecated for deployments. Use --deployment-id/-d instead.

--content -k

IoT Edge deployment content. Provide file path or raw json.

Optional Parameters

--hub-name -n

IoT Hub name.

--lab --labels

Map of labels to be applied to target deployment. Use the following format: '{"key0":"value0", "key1":"value1"}'.

--login -l

This command supports an entity connection string with rights to perform action. Use to avoid session login via "az login". If both an entity connection string and name are provided the connection string takes priority.

--pri --priority

Weight of deployment in case of competing rules (highest wins).

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--target-condition --tc -t

Target condition in which an Edge deployment applies to.

az iot edge deployment delete

Delete an IoT Edge deployment.

az iot edge deployment delete --config-id
[--hub-name]
[--login]
[--resource-group]

Required Parameters

--config-id --deployment-id -c -d

Target deployment. --config-id/-c is deprecated for deployments. Use --deployment-id/-d instead.

Optional Parameters

--hub-name -n

IoT Hub name.

--login -l

This command supports an entity connection string with rights to perform action. Use to avoid session login via "az login". If both an entity connection string and name are provided the connection string takes priority.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az iot edge deployment list

List IoT Edge deployments in an IoT Hub.

az iot edge deployment list [--hub-name]
[--login]
[--resource-group]
[--top]

Optional Parameters

--hub-name -n

IoT Hub name.

--login -l

This command supports an entity connection string with rights to perform action. Use to avoid session login via "az login". If both an entity connection string and name are provided the connection string takes priority.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--top

Maximum number of deployments to return.

default value: 10

az iot edge deployment show

Get the details of an IoT Edge deployment.

az iot edge deployment show --config-id
[--hub-name]
[--login]
[--resource-group]

Required Parameters

--config-id --deployment-id -c -d

Target deployment. --config-id/-c is deprecated for deployments. Use --deployment-id/-d instead.

Optional Parameters

--hub-name -n

IoT Hub name.

--login -l

This command supports an entity connection string with rights to perform action. Use to avoid session login via "az login". If both an entity connection string and name are provided the connection string takes priority.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az iot edge deployment show-metric

Evaluate a target system metric defined in an IoT Edge deployment.

az iot edge deployment show-metric --config-id
--metric-id
[--hub-name]
[--login]
[--resource-group]

Examples

Evaluate the 'appliedCount' system metric

az iot edge deployment show-metric -m appliedCount -d {deployment_name} -n {iothub_name}

Required Parameters

--config-id --deployment-id -c -d

Target deployment. --config-id/-c is deprecated for deployments. Use --deployment-id/-d instead.

--metric-id -m

Target metric for evaluation.

Optional Parameters

--hub-name -n

IoT Hub name.

--login -l

This command supports an entity connection string with rights to perform action. Use to avoid session login via "az login". If both an entity connection string and name are provided the connection string takes priority.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az iot edge deployment update

Update an IoT Edge deployment with the specified properties.

az iot edge deployment update --config-id
[--add]
[--force-string]
[--hub-name]
[--login]
[--remove]
[--resource-group]
[--set]

Examples

Alter the labels and target condition of an existing edge deployment

az iot edge deployment update -d {deployment_name} -n {iothub_name} --set labels='{"purpose":"dev", "owners":"IoTEngineering"}' targetCondition='tags.building=9'

Required Parameters

--config-id --deployment-id -c -d

Target deployment. --config-id/-c is deprecated for deployments. Use --deployment-id/-d instead.

Optional Parameters

--add

Add an object to a list of objects by specifying a path and key value pairs. Example: --add property.listProperty <key=value, string or JSON string>.

--force-string

When using 'set' or 'add', preserve string literals instead of attempting to convert to JSON.

--hub-name -n

IoT Hub name.

--login -l

This command supports an entity connection string with rights to perform action. Use to avoid session login via "az login". If both an entity connection string and name are provided the connection string takes priority.

--remove

Remove a property or an element from a list. Example: --remove property.list OR --remove propertyToRemove.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--set

Update an object by specifying a property path and value to set. Example: --set property1.property2=.