az iot hub module-identity
Note
This reference is part of the azure-iot extension for the Azure CLI (version 2.59.0 or higher). 该扩展会在首次运行 az iot hub module-identity 命令时自动安装。 Learn more about extensions.
管理 IoT 设备模块。
命令
名称 | 说明 | 类型 | Status |
---|---|---|---|
az iot hub module-identity connection-string |
管理 IoT 设备模块的连接字符串。 |
Extension | GA |
az iot hub module-identity connection-string show |
显示目标 IoT 设备模块连接字符串。 |
Extension | GA |
az iot hub module-identity create |
在 IoT 中心的目标 IoT 设备上创建模块。 |
Extension | GA |
az iot hub module-identity delete |
删除IoT 中心中的设备。 |
Extension | GA |
az iot hub module-identity list |
列出位于 IoT 中心 中的 IoT 设备上的模块。 |
Extension | GA |
az iot hub module-identity renew-key |
使用 sas 身份验证续订IoT 中心设备模块的目标密钥。 |
Extension | GA |
az iot hub module-identity show |
获取 IoT 中心 IoT 设备模块的详细信息。 |
Extension | GA |
az iot hub module-identity update |
更新IoT 中心设备模块。 |
Extension | GA |
az iot hub module-identity create
在 IoT 中心的目标 IoT 设备上创建模块。
使用 shared_private_key(也称为对称密钥)的身份验证方法时,如果未提供任何自定义密钥,则服务将为模块生成它们。
az iot hub module-identity create --device-id
--module-id
[--am --auth-method {shared_private_key, x509_ca, x509_thumbprint}]
[--auth-type {key, login}]
[--hub-name]
[--login]
[--od --output-dir]
[--pk --primary-key]
[--primary-thumbprint --ptp]
[--resource-group]
[--secondary-key --sk]
[--secondary-thumbprint --stp]
[--valid-days --vd]
必需参数
目标设备 ID。
目标模块 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
要创建实体的授权方法。
属性 | 值 |
---|---|
默认值: | shared_private_key |
接受的值: | shared_private_key, x509_ca, x509_thumbprint |
指示操作是应自动派生策略密钥还是使用当前的 Azure AD 会话。 如果身份验证类型为登录,并且提供资源主机名,则除非需要,否则将跳过资源查找。可以使用 < a0/a0> 配置默认值 az configure --defaults iothub-data-auth-type={auth-type-value}
。
属性 | 值 |
---|---|
Parameter group: | Access Control Arguments |
默认值: | key |
接受的值: | key, login |
IoT 中心名称或主机名。 如果未提供 --login,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
此命令支持具有执行操作权限的实体连接字符串。 用于避免通过“az login”进行会话登录。 如果同时提供实体连接字符串和名称,则连接字符串优先。 如果未提供 --hub-name,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
生成自签名证书并使用其指纹。 输出到指定的目标目录。
属性 | 值 |
---|---|
Parameter group: | X.509 Arguments |
以 base64 格式存储的主对称共享访问密钥。
属性 | 值 |
---|---|
Parameter group: | Symmetric Key Arguments |
用于主指纹的自签名证书指纹。
属性 | 值 |
---|---|
Parameter group: | X.509 Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
以 base64 格式存储的辅助对称共享访问密钥。
属性 | 值 |
---|---|
Parameter group: | Symmetric Key Arguments |
用于辅助指纹的自签名证书指纹。
属性 | 值 |
---|---|
Parameter group: | X.509 Arguments |
生成自签名证书并使用其指纹。 有效期为指定的天数。 Default: 365.
属性 | 值 |
---|---|
Parameter group: | X.509 Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az iot hub module-identity delete
删除IoT 中心中的设备。
az iot hub module-identity delete --device-id
--module-id
[--auth-type {key, login}]
[--etag]
[--hub-name]
[--login]
[--resource-group]
必需参数
目标设备 ID。
目标模块 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
指示操作是应自动派生策略密钥还是使用当前的 Azure AD 会话。 如果身份验证类型为登录,并且提供资源主机名,则除非需要,否则将跳过资源查找。可以使用 < a0/a0> 配置默认值 az configure --defaults iothub-data-auth-type={auth-type-value}
。
属性 | 值 |
---|---|
Parameter group: | Access Control Arguments |
默认值: | key |
接受的值: | key, login |
对应于资源最后状态的 Etag 或实体标记。 如果未提供 etag,则使用值“*”。
IoT 中心名称或主机名。 如果未提供 --login,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
此命令支持具有执行操作权限的实体连接字符串。 用于避免通过“az login”进行会话登录。 如果同时提供实体连接字符串和名称,则连接字符串优先。 如果未提供 --hub-name,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az iot hub module-identity list
列出位于 IoT 中心 中的 IoT 设备上的模块。
az iot hub module-identity list --device-id
[--auth-type {key, login}]
[--hub-name]
[--login]
[--resource-group]
[--top]
必需参数
目标设备 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
指示操作是应自动派生策略密钥还是使用当前的 Azure AD 会话。 如果身份验证类型为登录,并且提供资源主机名,则除非需要,否则将跳过资源查找。可以使用 < a0/a0> 配置默认值 az configure --defaults iothub-data-auth-type={auth-type-value}
。
属性 | 值 |
---|---|
Parameter group: | Access Control Arguments |
默认值: | key |
接受的值: | key, login |
IoT 中心名称或主机名。 如果未提供 --login,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
此命令支持具有执行操作权限的实体连接字符串。 用于避免通过“az login”进行会话登录。 如果同时提供实体连接字符串和名称,则连接字符串优先。 如果未提供 --hub-name,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
要返回的最大元素数。 将 -1 用于无限制。
属性 | 值 |
---|---|
默认值: | 1000 |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az iot hub module-identity renew-key
使用 sas 身份验证续订IoT 中心设备模块的目标密钥。
目前,大容量密钥重新生成不支持 etag 和密钥类型 swap
。
大容量密钥重新生成将生成与单个模块密钥重新生成不同的输出格式。
az iot hub module-identity renew-key --device-id
--hub-name
--key-type --kt {both, primary, secondary, swap}
--module-id
[--auth-type {key, login}]
[--etag]
[--login]
[--no-progress {false, true}]
[--resource-group]
示例
续订主密钥。
az iot hub module-identity renew-key -m {module_name} -d {device_id} -n {iothub_name} --kt primary
交换主密钥和辅助密钥。
az iot hub module-identity renew-key -m {module_name} -d {device_id} -n {iothub_name} --kt swap
续订两个模块的辅助密钥。
az iot hub module-identity renew-key -m {module_name} {module_name} -d {device_id} -n {iothub_name} --kt secondary
为设备中的所有模块续订这两个密钥。
az iot hub module-identity renew-key -m * -d {device_id} -n {iothub_name} --kt both
必需参数
目标设备 ID。
IoT 中心名称或主机名。 如果未提供 --login,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
要重新生成的目标密钥类型。
属性 | 值 |
---|---|
接受的值: | both, primary, secondary, swap |
目标模块 ID 的空间分隔列表。 对所有模块使用 *
。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
指示操作是应自动派生策略密钥还是使用当前的 Azure AD 会话。 如果身份验证类型为登录,并且提供资源主机名,则除非需要,否则将跳过资源查找。可以使用 < a0/a0> 配置默认值 az configure --defaults iothub-data-auth-type={auth-type-value}
。
属性 | 值 |
---|---|
Parameter group: | Access Control Arguments |
默认值: | key |
接受的值: | key, login |
对应于资源最后状态的 Etag 或实体标记。 如果未提供 etag,则使用值“*”。 此参数仅适用于 swap
。
此命令支持具有执行操作权限的实体连接字符串。 用于避免通过“az login”进行会话登录。 如果同时提供实体连接字符串和名称,则连接字符串优先。 如果未提供 --hub-name,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
隐藏批量密钥重新生成进度栏。
属性 | 值 |
---|---|
接受的值: | false, true |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az iot hub module-identity show
获取 IoT 中心 IoT 设备模块的详细信息。
az iot hub module-identity show --device-id
--module-id
[--auth-type {key, login}]
[--hub-name]
[--login]
[--resource-group]
必需参数
目标设备 ID。
目标模块 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
指示操作是应自动派生策略密钥还是使用当前的 Azure AD 会话。 如果身份验证类型为登录,并且提供资源主机名,则除非需要,否则将跳过资源查找。可以使用 < a0/a0> 配置默认值 az configure --defaults iothub-data-auth-type={auth-type-value}
。
属性 | 值 |
---|---|
Parameter group: | Access Control Arguments |
默认值: | key |
接受的值: | key, login |
IoT 中心名称或主机名。 如果未提供 --login,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
此命令支持具有执行操作权限的实体连接字符串。 用于避免通过“az login”进行会话登录。 如果同时提供实体连接字符串和名称,则连接字符串优先。 如果未提供 --hub-name,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az iot hub module-identity update
更新IoT 中心设备模块。
使用 --set 后跟属性分配来更新模块。 利用从“iot 中心模块标识显示”返回的属性。
az iot hub module-identity update --device-id
--module-id
[--add]
[--auth-type {key, login}]
[--etag]
[--force-string]
[--hub-name]
[--login]
[--remove]
[--resource-group]
[--set]
示例
重新生成模块对称身份验证密钥
az iot hub module-identity update -m {module_name} -d {device_id} -n {iothub_name} --set authentication.symmetricKey.primaryKey="" authentication.symmetricKey.secondaryKey=""
必需参数
目标设备 ID。
目标模块 ID。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
通过指定路径和键值对将对象添加到对象列表。 示例:--add property.listProperty <key=value, string or JSON string>
。
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | [] |
指示操作是应自动派生策略密钥还是使用当前的 Azure AD 会话。 如果身份验证类型为登录,并且提供资源主机名,则除非需要,否则将跳过资源查找。可以使用 < a0/a0> 配置默认值 az configure --defaults iothub-data-auth-type={auth-type-value}
。
属性 | 值 |
---|---|
Parameter group: | Access Control Arguments |
默认值: | key |
接受的值: | key, login |
对应于资源最后状态的 Etag 或实体标记。 如果未提供 etag,则使用值“*”。
使用“set”或“add”时,保留字符串文本,而不是尝试转换为 JSON。
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | False |
IoT 中心名称或主机名。 如果未提供 --login,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
此命令支持具有执行操作权限的实体连接字符串。 用于避免通过“az login”进行会话登录。 如果同时提供实体连接字符串和名称,则连接字符串优先。 如果未提供 --hub-name,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
从列表中删除属性或元素。 示例: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | [] |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=<value>
。
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | [] |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |