az iot edge

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 iot edge command. Learn more about extensions.

Manage IoT solutions on the Edge.

Commands

az iot edge deployment

Manage IoT Edge deployments at scale.

az iot edge deployment create

Create an IoT Edge deployment in a 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 specified properties of an IoT Edge deployment.

az iot edge devices

Commands to manage IoT Edge devices.

az iot edge devices create

Create and configure multiple edge devices in an IoT Hub.

az iot edge export-modules

Export the edge modules' configuration on a single edge device.

az iot edge set-modules

Set edge modules on a single device.

az iot edge export-modules

Export the edge modules' configuration on a single edge device.

The module twin configuration output can be directly used as the --content of "az iot edge set-modules".

az iot edge export-modules --device-id
                           [--auth-type {key, login}]
                           [--hub-name]
                           [--login]
                           [--resource-group]

Examples

Export module twin configuration on a target device.

az iot edge export-modules --hub-name {iothub_name} --device-id {device_id}

Required Parameters

--device-id -d

Target Device Id.

Optional Parameters

--auth-type

Indicates whether the operation should auto-derive a policy key or use the current Azure AD session. You can configure the default using az configure --defaults iothub-data-auth-type=<auth-type-value>.

accepted values: key, login
default value: key
--hub-name -n

IoT Hub name. Required if --login is not provided.

--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. Required if --hub-name is not provided.

--resource-group -g

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

az iot edge set-modules

Set edge modules on a single device.

Modules content is json and in the form of {"modulesContent":{...}} or {"content":{"modulesContent":{...}}}.

By default properties of system modules $edgeAgent and $edgeHub are validated against schemas installed with the IoT extension. This can be disabled by using the --no-validation switch.

Note: Upon execution the command will output the collection of modules applied to the device.

az iot edge set-modules --content
                        --device-id
                        [--auth-type {key, login}]
                        [--hub-name]
                        [--login]
                        [--resource-group]

Examples

Test edge modules while in development by setting modules on a target device.

az iot edge set-modules --hub-name {iothub_name} --device-id {device_id} --content ../modules_content.json

Required Parameters

--content -k

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

--device-id -d

Target Device Id.

Optional Parameters

--auth-type

Indicates whether the operation should auto-derive a policy key or use the current Azure AD session. You can configure the default using az configure --defaults iothub-data-auth-type=<auth-type-value>.

accepted values: key, login
default value: key
--hub-name -n

IoT Hub name. Required if --login is not provided.

--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. Required if --hub-name is not provided.

--resource-group -g

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