az iot hub
Note
此命令组具有在 Azure CLI 和至少一个扩展中定义的命令。 安装每个扩展,使其受益于其扩展功能。 Learn more about extensions.
管理 Azure IoT 中心。
命令
名称 | 说明 | 类型 | Status |
---|---|---|---|
az iot hub certificate |
管理 IoT 中心证书。 |
Core | GA |
az iot hub certificate create |
创建/上传Azure IoT 中心证书。 |
Core | GA |
az iot hub certificate delete |
删除 Azure IoT 中心证书。 |
Core | GA |
az iot hub certificate generate-verification-code |
为 Azure IoT 中心证书生成验证码。 |
Core | GA |
az iot hub certificate list |
列出Azure IoT 中心中包含的所有证书。 |
Core | GA |
az iot hub certificate show |
显示有关特定Azure IoT 中心证书的信息。 |
Core | GA |
az iot hub certificate update |
更新Azure IoT 中心证书。 |
Core | GA |
az iot hub certificate verify |
验证 Azure IoT 中心证书。 |
Core | GA |
az iot hub configuration |
大规模管理 IoT 自动设备管理配置。 |
Extension | GA |
az iot hub configuration create |
在目标IoT 中心中创建 IoT 自动设备管理配置。 |
Extension | GA |
az iot hub configuration delete |
删除 IoT 设备配置。 |
Extension | GA |
az iot hub configuration list |
列出 IoT 中心的 IoT 自动设备管理配置。 |
Extension | GA |
az iot hub configuration show |
获取 IoT 自动设备管理配置的详细信息。 |
Extension | GA |
az iot hub configuration show-metric |
评估 IoT 设备配置中定义的目标用户或系统指标。 |
Extension | GA |
az iot hub configuration update |
更新 IoT 自动设备管理配置的指定属性。 |
Extension | GA |
az iot hub connection-string |
管理IoT 中心 连接字符串。 |
Extension | GA |
az iot hub connection-string show |
使用给定的策略名称和密钥显示指定IoT 中心的连接字符串。 |
Extension | GA |
az iot hub consumer-group |
管理 IoT 中心的事件中心使用者组。 |
Core | GA |
az iot hub consumer-group create |
创建事件中心使用者组。 |
Core | GA |
az iot hub consumer-group delete |
删除事件中心使用者组。 |
Core | GA |
az iot hub consumer-group list |
列出事件中心使用者组。 |
Core | GA |
az iot hub consumer-group show |
获取事件中心使用者组的详细信息。 |
Core | GA |
az iot hub create |
创建 Azure IoT 中心。 |
Core | GA |
az iot hub delete |
删除 IoT 中心。 |
Core | GA |
az iot hub device-identity |
管理 IoT 设备。 |
Extension | GA |
az iot hub device-identity children |
管理 IoT 边缘设备的子设备关系。 |
Extension | GA |
az iot hub device-identity children add |
将设备作为子级添加到目标边缘设备。 |
Extension | GA |
az iot hub device-identity children list |
输出分配的子设备的集合。 |
Extension | GA |
az iot hub device-identity children remove |
从目标边缘设备中删除子设备。 |
Extension | GA |
az iot hub device-identity connection-string |
管理 IoT 设备的连接字符串。 |
Extension | GA |
az iot hub device-identity connection-string show |
显示给定IoT 中心设备连接字符串。 |
Extension | GA |
az iot hub device-identity create |
在 IoT 中心创建设备。 |
Extension | GA |
az iot hub device-identity delete |
删除 IoT 中心设备。 |
Extension | GA |
az iot hub device-identity export |
将所有设备标识从IoT 中心导出到Azure 存储 blob 容器。 |
Extension | GA |
az iot hub device-identity import |
将设备标识从存储容器 blob 导入到IoT 中心。 |
Extension | GA |
az iot hub device-identity list |
列出IoT 中心中的设备。 |
Extension | GA |
az iot hub device-identity parent |
管理 IoT 设备的父设备关系。 |
Extension | GA |
az iot hub device-identity parent set |
设置目标设备的父设备。 |
Extension | GA |
az iot hub device-identity parent show |
获取目标设备的父设备。 |
Extension | GA |
az iot hub device-identity renew-key |
使用 sas 身份验证续订IoT 中心设备的目标密钥。 |
Extension | GA |
az iot hub device-identity show |
获取 IoT 中心设备的详细信息。 |
Extension | GA |
az iot hub device-identity update |
更新 IoT 中心设备。 |
Extension | GA |
az iot hub device-twin |
管理 IoT 设备孪生配置。 |
Extension | GA |
az iot hub device-twin list |
列出IoT 中心中的设备孪生。 |
Extension | GA |
az iot hub device-twin replace |
将设备孪生定义替换为目标 json。 |
Extension | GA |
az iot hub device-twin show |
获取设备孪生定义。 |
Extension | GA |
az iot hub device-twin update |
更新设备孪生所需的属性和标记。 |
Extension | GA |
az iot hub devicestream |
管理 IoT 中心的设备流。 |
Core | Preview |
az iot hub devicestream show |
获取IoT 中心的设备流终结点。 |
Core | Preview |
az iot hub digital-twin |
操作IoT 中心设备的数字孪生并与之交互。 |
Extension | GA |
az iot hub digital-twin invoke-command |
调用数字孪生设备的根或组件级命令。 |
Extension | GA |
az iot hub digital-twin show |
显示IoT 中心设备的数字孪生体。 |
Extension | GA |
az iot hub digital-twin update |
通过 JSON 修补程序规范更新数字孪生设备的读写属性。 |
Extension | GA |
az iot hub distributed-tracing |
管理每个设备的分布式设置。 |
Extension | Preview |
az iot hub distributed-tracing show |
获取设备的分布式跟踪设置。 |
Extension | Preview |
az iot hub distributed-tracing update |
更新设备的分布式跟踪选项。 |
Extension | Preview |
az iot hub generate-sas-token |
为目标 IoT 中心、设备或模块生成 SAS 令牌。 |
Extension | GA |
az iot hub identity |
管理 Azure IoT 中心的标识。 |
Core | GA |
az iot hub identity assign |
将托管标识分配给IoT 中心。 |
Core | GA |
az iot hub identity remove |
从IoT 中心中删除托管标识。 |
Core | GA |
az iot hub identity show |
显示IoT 中心的标识属性。 |
Core | GA |
az iot hub invoke-device-method |
调用设备方法。 |
Extension | GA |
az iot hub invoke-module-method |
调用模块方法。 |
Extension | GA |
az iot hub job |
管理IoT 中心作业(v2)。 |
Extension | GA |
az iot hub job cancel |
取消IoT 中心作业。 |
Extension | GA |
az iot hub job create |
创建并计划执行IoT 中心作业。 |
Extension | GA |
az iot hub job list |
列出IoT 中心的历史作业。 |
Extension | GA |
az iot hub job show |
显示现有IoT 中心作业的详细信息。 |
Extension | GA |
az iot hub list |
列出 IoT 中心。 |
Core | GA |
az iot hub list-skus |
列出可用定价层。 |
Core | GA |
az iot hub manual-failover |
为 IoT 中心启动到异地配对灾难恢复区域的手动故障转移。 |
Core | GA |
az iot hub message-endpoint |
管理 IoT 中心的自定义终结点。 |
Extension | Preview |
az iot hub message-endpoint create |
将终结点添加到IoT 中心。 |
Extension | Preview |
az iot hub message-endpoint create cosmosdb-container |
为IoT 中心添加 Cosmos DB 容器终结点。 |
Extension | Preview |
az iot hub message-endpoint create eventhub |
为IoT 中心添加事件中心终结点。 |
Extension | Preview |
az iot hub message-endpoint create servicebus-queue |
为IoT 中心添加服务总线队列终结点。 |
Extension | Preview |
az iot hub message-endpoint create servicebus-topic |
为IoT 中心添加服务总线主题终结点。 |
Extension | Preview |
az iot hub message-endpoint create storage-container |
为IoT 中心添加存储容器终结点。 |
Extension | Preview |
az iot hub message-endpoint delete |
删除IoT 中心的所有或特定终结点。 |
Extension | Preview |
az iot hub message-endpoint list |
获取有关IoT 中心的所有终结点的信息。 |
Extension | Preview |
az iot hub message-endpoint show |
获取有关IoT 中心的已提及终结点的信息。 |
Extension | Preview |
az iot hub message-endpoint update |
更新IoT 中心的现有终结点的属性。 |
Extension | Preview |
az iot hub message-endpoint update cosmosdb-container |
更新IoT 中心的现有 Cosmos DB 容器终结点的属性。 |
Extension | Preview |
az iot hub message-endpoint update eventhub |
更新IoT 中心的现有事件中心终结点的属性。 |
Extension | Preview |
az iot hub message-endpoint update servicebus-queue |
更新IoT 中心的现有服务总线队列终结点的属性。 |
Extension | Preview |
az iot hub message-endpoint update servicebus-topic |
更新IoT 中心的现有服务总线主题终结点的属性。 |
Extension | Preview |
az iot hub message-endpoint update storage-container |
更新IoT 中心的现有存储容器终结点的属性。 |
Extension | Preview |
az iot hub message-enrichment |
管理 IoT 中心的终结点的消息扩充。 |
Core | GA |
az iot hub message-enrichment create |
为IoT 中心中选择的终结点创建消息扩充。 |
Core | GA |
az iot hub message-enrichment delete |
在 IoT 中心(按密钥)中删除消息扩充。 |
Core | GA |
az iot hub message-enrichment list |
获取有关IoT 中心的所有消息扩充的信息。 |
Core | GA |
az iot hub message-enrichment update |
更新 IoT 中心的消息扩充(按密钥)。 |
Core | GA |
az iot hub message-route |
管理 IoT 中心的路由。 |
Extension | Preview |
az iot hub message-route create |
为IoT 中心添加路由。 |
Extension | Preview |
az iot hub message-route delete |
删除IoT 中心中的所有路由或提及的路由。 |
Extension | Preview |
az iot hub message-route fallback |
管理 IoT 中心的回退路由。 |
Extension | Preview |
az iot hub message-route fallback set |
启用或禁用IoT 中心中的回退路由。 |
Extension | Preview |
az iot hub message-route fallback show |
显示IoT 中心的回退路由。 |
Extension | Preview |
az iot hub message-route list |
获取IoT 中心中的所有路由。 |
Extension | Preview |
az iot hub message-route show |
获取有关IoT 中心中的路由的信息。 |
Extension | Preview |
az iot hub message-route test |
在IoT 中心中测试所有路由或提及的路由。 |
Extension | Preview |
az iot hub message-route update |
更新IoT 中心的路由。 |
Extension | Preview |
az iot hub module-identity |
管理 IoT 设备模块。 |
Extension | GA |
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-twin |
管理 IoT 设备模块孪生配置。 |
Extension | GA |
az iot hub module-twin replace |
将模块孪生定义替换为目标 json。 |
Extension | GA |
az iot hub module-twin show |
显示模块孪生定义。 |
Extension | GA |
az iot hub module-twin update |
更新模块孪生所需的属性和标记。 |
Extension | GA |
az iot hub monitor-events |
监视发送到IoT 中心的设备遥测和消息。 |
Extension | GA |
az iot hub monitor-feedback |
监视设备发送的反馈,以确认云到设备 (C2D) 消息。 |
Extension | GA |
az iot hub policy |
管理 IoT 中心的共享访问策略。 |
Core | GA |
az iot hub policy create |
在 IoT 中心创建新的共享访问策略。 |
Core | GA |
az iot hub policy delete |
从 IoT 中心删除共享访问策略。 |
Core | GA |
az iot hub policy list |
列出 IoT 中心的共享访问策略。 |
Core | GA |
az iot hub policy renew-key |
重新生成 IoT 中心的共享访问策略的密钥。 |
Core | GA |
az iot hub policy show |
获取 IoT 中心的共享访问策略的详细信息。 |
Core | GA |
az iot hub query |
使用功能强大的类似于 SQL 的语言查询 IoT 中心。 |
Extension | GA |
az iot hub show |
获取 IoT 中心的详细信息。 |
Core | GA |
az iot hub show-quota-metrics |
获取 IoT 中心的配额指标。 |
Core | GA |
az iot hub show-stats |
获取 IoT 中心的统计信息。 |
Core | GA |
az iot hub state |
管理IoT 中心的状态。 |
Extension | Experimental |
az iot hub state export |
将IoT 中心的状态导出到文件。 |
Extension | Experimental |
az iot hub state import |
将中心状态从文件导入到IoT 中心。 |
Extension | Experimental |
az iot hub state migrate |
在不保存到文件的情况下,将一个中心的状态迁移到另一个中心。 |
Extension | Experimental |
az iot hub update |
更新 IoT 中心的元数据。 |
Core | GA |
az iot hub wait |
等待IoT 中心实例上的操作完成。 |
Core | GA |
az iot hub create
创建 Azure IoT 中心。
有关Azure IoT 中心简介,请参阅https://learn.microsoft.com/azure/iot-hub/。
az iot hub create --name
--resource-group
[--c2d-max-delivery-count --cdd]
[--c2d-ttl --ct]
[--dds --disable-device-sas {false, true}]
[--disable-local-auth --dla {false, true}]
[--disable-module-sas --dms {false, true}]
[--edr --enforce-data-residency {false, true}]
[--fc --fileupload-storage-container-name]
[--fcs --fileupload-storage-connectionstring]
[--fd --feedback-max-delivery-count]
[--feedback-lock-duration --fld]
[--feedback-ttl --ft]
[--fileupload-notification-lock-duration --fnld]
[--fileupload-notification-max-delivery-count --fnd]
[--fileupload-notification-ttl --fnt]
[--fileupload-notifications --fn {false, true}]
[--fileupload-sas-ttl --fst]
[--fileupload-storage-auth-type --fsa {identityBased, keyBased}]
[--fileupload-storage-identity --fsi]
[--location]
[--mi-system-assigned {false, true}]
[--mi-user-assigned]
[--min-tls-version --mintls]
[--no-wait]
[--partition-count]
[--rd --retention-day]
[--role]
[--scopes]
[--sku {B1, B2, B3, F1, S1, S2, S3}]
[--tags]
[--unit]
示例
使用资源组区域中的免费定价层 F1 创建IoT 中心。
az iot hub create --resource-group MyResourceGroup --name MyIotHub --sku F1 --partition-count 2
使用标准定价层 S1 和 4 分区在“westus”区域中创建一个具有标记的IoT 中心。
az iot hub create --resource-group MyResourceGroup --name MyIotHub --location westus --tags a=b c=d
使用系统分配的托管标识创建IoT 中心,并为创建的标识分配角色和作用域。
az iot hub create --resource-group MyResourceGroup --name MyIotHub --location westus --mi-system-assigned --role "Storage Blob Data Contributor" --scopes {resourceId}
使用本地身份验证、设备 SAS 密钥和模块 SAS 密钥创建IoT 中心,所有已禁用
az iot hub create --resource-group MyResourceGroup --name MyIotHub --location westus --disable-local-auth --disable-device-sas --disable-module-sas
创建强制实施数据驻留的IoT 中心。 这将禁用跨区域灾难恢复。
az iot hub create --resource-group MyResourceGroup --name MyIoTHub --edr
必需参数
IoT 中心名称。
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
IoT 中心尝试将云到设备消息传送到设备的次数(介于 1 到 100 之间)。
属性 | 值 |
---|---|
默认值: | 10 |
消息在 1 到 48 小时之间IoT 中心过期之前可供设备使用的时间量。
属性 | 值 |
---|---|
默认值: | 1 |
一个布尔值,指示是否禁用所有设备(包括边缘设备,但不包括模块)范围的 SAS 密钥进行身份验证。
属性 | 值 |
---|---|
接受的值: | false, true |
一个布尔值,指示是否禁用 IoT 中心范围的 SAS 密钥进行身份验证。
属性 | 值 |
---|---|
接受的值: | false, true |
一个布尔值,指示是否禁用模块范围的 SAS 密钥进行身份验证。
属性 | 值 |
---|---|
接受的值: | false, true |
通过禁用跨区域灾难恢复来强制实施此IoT 中心的数据驻留。 在资源上设置此属性后,此属性是不可变的。 仅在选择区域中可用。 在 https://aka.ms/iothubdisabledr了解详细信息。
属性 | 值 |
---|---|
接受的值: | false, true |
上传文件的根容器的名称。 容器不需要存在,但应使用指定的 connectionString 进行创建。
将文件上传到的 Azure 存储帐户的连接字符串。
IoT 中心在 1 到 100 之间尝试在反馈队列上传递消息的次数。
属性 | 值 |
---|---|
默认值: | 10 |
反馈队列的锁定持续时间介于 5 到 300 秒之间。
属性 | 值 |
---|---|
默认值: | 5 |
IoT 中心将保留 1 到 48 小时之间的云到设备消息过期或交付反馈的时间段。
属性 | 值 |
---|---|
默认值: | 1 |
文件上传通知队列的锁定持续时间介于 5 到 300 秒之间。
属性 | 值 |
---|---|
默认值: | 5 |
IoT 中心尝试在 1 到 100 之间传递文件通知消息的次数。
属性 | 值 |
---|---|
默认值: | 10 |
文件上传通知在 1 到 48 小时之间IoT 中心过期之前可供服务使用的时间量。
属性 | 值 |
---|---|
默认值: | 1 |
一个布尔值,指示是否将有关上传的文件的信息记录到消息/servicebound/filenotifications IoT 中心终结点。
属性 | 值 |
---|---|
默认值: | False |
接受的值: | false, true |
IoT 中心生成的 SAS URI 在 1 到 24 小时内过期之前有效的时间。
属性 | 值 |
---|---|
默认值: | 1 |
文件上传到Azure 存储帐户的身份验证类型。
属性 | 值 |
---|---|
接受的值: | identityBased, keyBased |
用于文件上传身份验证的托管标识。 使用“[system]”来引用系统分配的托管标识或资源 ID 来引用用户分配的托管标识。
IoT 中心的位置。 默认值为目标资源组的位置。
为此中心启用系统分配的托管标识。
属性 | 值 |
---|---|
接受的值: | false, true |
为此中心启用用户分配的托管标识。 接受标识资源 ID 的空间分隔列表。
指定支持此中心的最低 TLS 版本。 可设置为“1.0”或“1.2”。 例如,最低 TLS 版本设置为“1.2”会导致使用低于 1.2 的 TLS 版本的客户端被拒绝。
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
设备到云消息的后盾事件中心的分区数。
属性 | 值 |
---|---|
默认值: | 4 |
指定此 IoT 中心在 1 到 7 天内维护设备到云事件的时间。
属性 | 值 |
---|---|
默认值: | 1 |
要分配给中心系统分配的托管标识的角色。
为系统分配的托管标识分配角色(--role)的范围分隔列表。
Azure IoT 中心的定价层。 请注意,每个订阅中只允许一个免费的 IoT 中心实例(F1)。 如果可用实例超过一个,将引发异常。
属性 | 值 |
---|---|
默认值: | S1 |
接受的值: | B1, B2, B3, F1, S1, S2, S3 |
空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。
IoT 中心中的单位。
属性 | 值 |
---|---|
默认值: | 1 |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | 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 delete
删除 IoT 中心。
az iot hub delete [--ids]
[--name]
[--no-wait]
[--resource-group]
[--subscription]
示例
删除 IoT 中心。 (autogenerated)
az iot hub delete --name MyIoTHub --resource-group MyResourceGroup
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
IoT 中心名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az iot hub generate-sas-token
为目标 IoT 中心、设备或模块生成 SAS 令牌。
对于设备 SAS 令牌,策略参数仅用于访问设备注册表。 因此,策略应具有注册表的读取访问权限。 对于 IoT 中心令牌,策略是 SAS 的一部分。
az iot hub generate-sas-token [--auth-type {key, login}]
[--connection-string --cs]
[--device-id]
[--du --duration]
[--hub-name]
[--key-type --kt {primary, secondary}]
[--login]
[--module-id]
[--pn --policy-name]
[--resource-group]
示例
使用 iothubowner 策略和主密钥生成 IoT 中心 SAS 令牌。
az iot hub generate-sas-token -n {iothub_name}
使用 registryRead 策略和辅助密钥生成 IoT 中心 SAS 令牌。
az iot hub generate-sas-token -n {iothub_name} --policy registryRead --key-type secondary
使用 iothubowner 策略生成设备 SAS 令牌,以访问 {iothub_name} 设备注册表。
az iot hub generate-sas-token -d {device_id} -n {iothub_name}
使用IoT 中心 连接字符串生成设备 SAS 令牌(具有注册表访问权限)
az iot hub generate-sas-token -d {device_id} --login 'HostName=myhub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=12345'
使用IoT 中心 连接字符串生成 Iot 中心 SAS 令牌
az iot hub generate-sas-token --connection-string 'HostName=myhub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=12345'
使用设备连接字符串生成设备 SAS 令牌
az iot hub generate-sas-token --connection-string 'HostName=myhub.azure-devices.net;DeviceId=mydevice;SharedAccessKeyName=iothubowner;SharedAccessKey=12345'
使用模块连接字符串生成模块 SAS 令牌
az iot hub generate-sas-token --connection-string 'HostName=myhub.azure-devices.net;DeviceId=mydevice;ModuleId=mymodule;SharedAccessKeyName=iothubowner;SharedAccessKey=12345'
可选参数
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 中心注册表,直接从提供的对称密钥生成 SAS 令牌,而无需进一步验证。 除了持续时间之外,所有其他命令参数将被忽略。 支持的连接字符串类型:Iot 中心、设备、模块。
目标设备 ID。
有效的令牌持续时间(以秒为单位)。
属性 | 值 |
---|---|
默认值: | 3600 |
IoT 中心名称或主机名。 如果未提供 --login,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
用于身份验证的共享访问策略密钥类型。
属性 | 值 |
---|---|
默认值: | primary |
接受的值: | primary, secondary |
此命令支持具有执行操作权限的实体连接字符串。 用于避免通过“az login”进行会话登录。 如果同时提供实体连接字符串和名称,则连接字符串优先。 如果未提供 --hub-name,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
目标模块 ID。
具有目标IoT 中心实体的操作权限的共享访问策略。
属性 | 值 |
---|---|
默认值: | iothubowner |
资源组的名称。 可以使用 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 invoke-device-method
调用设备方法。
az iot hub invoke-device-method --device-id
--method-name --mn
[--auth-type {key, login}]
[--hub-name]
[--login]
[--method-payload --mp]
[--resource-group]
[--timeout --to]
示例
在设备上调用直接方法。
az iot hub invoke-device-method --hub-name {iothub_name} --device-id {device_id} --method-name Reboot --method-payload '{"version":"1.0"}'
必需参数
目标设备 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 |
要传递给方法的 Json 有效负载。 必须是文件路径或原始 json。
属性 | 值 |
---|---|
默认值: | {} |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
等待设备方法结果的最大秒数。
属性 | 值 |
---|---|
默认值: | 30 |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | 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 invoke-module-method
调用模块方法。
此命令支持边缘和非边缘设备模块。
az iot hub invoke-module-method --device-id
--method-name --mn
--module-id
[--auth-type {key, login}]
[--hub-name]
[--login]
[--method-payload --mp]
[--resource-group]
[--timeout --to]
示例
在边缘设备模块上调用直接方法。
az iot hub invoke-module-method -n {iothub_name} -d {device_id} -m '$edgeAgent' --method-name 'RestartModule' --method-payload '{"schemaVersion": "1.0"}'
必需参数
目标设备 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 |
要传递给方法的 Json 有效负载。 必须是文件路径或原始 json。
属性 | 值 |
---|---|
默认值: | {} |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
等待模块方法结果的最大秒数。
属性 | 值 |
---|---|
默认值: | 30 |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | 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 list
列出 IoT 中心。
az iot hub list [--resource-group]
示例
列出订阅中的所有 IoT 中心。
az iot hub list
列出资源组“MyGroup”中的所有 IoT 中心
az iot hub list --resource-group MyGroup
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
资源组的名称。 可以使用 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 list-skus
列出可用定价层。
az iot hub list-skus [--ids]
[--name]
[--resource-group]
[--subscription]
示例
列出可用定价层。 (autogenerated)
az iot hub list-skus --name MyIoTHub
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
IoT 中心名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az iot hub manual-failover
为 IoT 中心启动到异地配对灾难恢复区域的手动故障转移。
az iot hub manual-failover [--ids]
[--name]
[--no-wait]
[--resource-group]
[--subscription]
示例
启动从主要区域到次要区域的故障转移“myhub”。
az iot hub manual-failover -n myhub
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
IoT 中心名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
不等待长时间运行的操作完成。
属性 | 值 |
---|---|
默认值: | False |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az iot hub monitor-events
监视发送到IoT 中心的设备遥测和消息。
此命令依赖于并可能在首次执行时安装依赖的 Cython 包(uamqp)。 https://github.com/Azure/azure-uamqp-python
注意:即使消息正文不可解码,事件也会显示,在这种情况下,事件有效负载部分将显示为 {{non-decodable payload}},其余事件属性可用。
az iot hub monitor-events [--cg --consumer-group]
[--content-type --ct]
[--device-id]
[--device-query]
[--enqueued-time --et]
[--hub-name]
[--interface]
[--login]
[--mc --message-count]
[--module-id]
[--properties --props {all, anno, app, sys}]
[--repair {false, true}]
[--resource-group]
[--timeout --to]
[--yes {false, true}]
示例
Basic usage
az iot hub monitor-events -n {iothub_name}
使用 IoT 中心 连接字符串 的基本用法
az iot hub monitor-events -n {iothub_name} --login 'HostName=myhub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=12345'
在目标设备上筛选时的基本用法
az iot hub monitor-events -n {iothub_name} -d {device_id}
在 ID 中使用通配符筛选目标设备时的基本用法
az iot hub monitor-events -n {iothub_name} -d Device*
使用IoT 中心查询语言筛选设备
az iot hub monitor-events -n {iothub_name} -q "select * from devices where tags.location.region = 'US'"
筛选设备并指定要绑定到的事件中心使用者组。
az iot hub monitor-events -n {iothub_name} -d {device_id} --cg {consumer_group_name}
接收消息注释(消息标头)
az iot hub monitor-events -n {iothub_name} -d {device_id} --properties anno
接收消息批注 + 系统属性。 永不超时。
az iot hub monitor-events -n {iothub_name} -d {device_id} --properties anno sys --timeout 0
从所有设备消息接收所有消息属性
az iot hub monitor-events -n {iothub_name} --props all
接收所有消息并将消息有效负载分析为 JSON
az iot hub monitor-events -n {iothub_name} --content-type application/json
从中心接收指定的消息数,然后关闭。
az iot hub monitor-events -n {iothub_name} --message-count {message_count}
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
指定连接到事件中心终结点时要使用的使用者组。
属性 | 值 |
---|---|
默认值: | $Default |
指定消息有效负载的内容类型,以自动将输出格式设置为该类型。
目标设备 ID。
指定用于筛选设备的自定义查询。
指示应用作从分区读取消息的起点的时间。 单位是自 unix 纪元以来的毫秒数。 如果未指示“立即”使用任何时间。
IoT 中心名称或主机名。 如果未提供 --login,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
要筛选的目标接口标识符。 例如:dtmi:com:example:TemperatureController;1。
此命令支持具有执行操作权限的实体连接字符串。 用于避免通过“az login”进行会话登录。 如果同时提供实体连接字符串和名称,则连接字符串优先。 如果未提供 --hub-name,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
在监视器终止之前要捕获的遥测消息数。 如果未指定,监视器将一直运行,直到满足不从中心接收消息的超时阈值。
目标模块 ID。
指示要输出的关键消息属性。 sys = 系统属性,应用 = 应用程序属性,anno = 批注。
属性 | 值 |
---|---|
接受的值: | all, anno, app, sys |
重新安装与扩展版本兼容的 uamqp 依赖项。 Default: false.
属性 | 值 |
---|---|
默认值: | False |
接受的值: | false, true |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
在未收到消息的情况下维护连接的最大秒数。 将 0 用于无穷大。
属性 | 值 |
---|---|
默认值: | 300 |
跳过用户提示。 指示接受操作。 主要用于自动化方案。 Default: false.
属性 | 值 |
---|---|
默认值: | False |
接受的值: | false, true |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | 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 monitor-feedback
监视设备发送的反馈,以确认云到设备 (C2D) 消息。
此命令依赖于并可能在首次执行时安装依赖的 Cython 包(uamqp)。 https://github.com/Azure/azure-uamqp-python.
az iot hub monitor-feedback [--auth-type {key, login}]
[--device-id]
[--hub-name]
[--login]
[--repair {false, true}]
[--resource-group]
[--wait-on-msg]
[--yes {false, true}]
示例
Basic usage
az iot hub monitor-feedback -n {iothub_name}
使用 IoT 中心 连接字符串 的基本用法
az iot hub monitor-feedback -n {iothub_name} --login 'HostName=myhub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=12345'
在目标设备上筛选时的基本用法
az iot hub monitor-feedback -n {iothub_name} -d {device_id}
收到具有特定 ID 的消息时退出反馈监视器 (uuid)
az iot hub monitor-feedback -n {iothub_name} -d {device_id} -w {message_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 |
目标设备 ID。
IoT 中心名称或主机名。 如果未提供 --login,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
此命令支持具有执行操作权限的实体连接字符串。 用于避免通过“az login”进行会话登录。 如果同时提供实体连接字符串和名称,则连接字符串优先。 如果未提供 --hub-name,则为必需。
属性 | 值 |
---|---|
Parameter group: | IoT Hub Identifier Arguments |
重新安装与扩展版本兼容的 uamqp 依赖项。 Default: false.
属性 | 值 |
---|---|
默认值: | False |
接受的值: | false, true |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
反馈监视器将阻止,直到收到具有特定 ID(uuid)的消息。
跳过用户提示。 指示接受操作。 主要用于自动化方案。 Default: false.
属性 | 值 |
---|---|
默认值: | False |
接受的值: | false, true |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | 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 query
使用功能强大的类似于 SQL 的语言查询 IoT 中心。
检索有关设备和模块孪生、作业和消息路由的信息。 有关详细信息,请参阅 https://learn.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language。
az iot hub query --query-command
[--auth-type {key, login}]
[--hub-name]
[--login]
[--resource-group]
[--top]
示例
查询 Azure IoT 中心中的所有设备孪生数据。
az iot hub query -n {iothub_name} -q "select * from devices"
查询目标设备上的所有模块孪生数据。
az iot hub query -n {iothub_name} -q "select * from devices.modules where devices.deviceId = '{device_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 show
获取 IoT 中心的详细信息。
az iot hub show [--ids]
[--name]
[--resource-group]
[--subscription]
示例
获取 IoT 中心的详细信息。 (autogenerated)
az iot hub show --name MyIoTHub
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
IoT 中心名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az iot hub show-quota-metrics
获取 IoT 中心的配额指标。
az iot hub show-quota-metrics [--ids]
[--name]
[--resource-group]
[--subscription]
示例
获取 IoT 中心的配额指标。 (autogenerated)
az iot hub show-quota-metrics --ids {ids}
获取 IoT 中心的配额指标。 (autogenerated)
az iot hub show-quota-metrics --name MyIoTHub
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
IoT 中心名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az iot hub show-stats
获取 IoT 中心的统计信息。
az iot hub show-stats [--ids]
[--name]
[--resource-group]
[--subscription]
示例
获取 IoT 中心的统计信息。 (autogenerated)
az iot hub show-stats --name MyIoTHub
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
IoT 中心名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az iot hub update
更新 IoT 中心的元数据。
az iot hub update [--add]
[--c2d-max-delivery-count --cdd]
[--c2d-ttl --ct]
[--dds --disable-device-sas {false, true}]
[--disable-local-auth --dla {false, true}]
[--disable-module-sas --dms {false, true}]
[--fc --fileupload-storage-container-name]
[--fcs --fileupload-storage-connectionstring]
[--fd --feedback-max-delivery-count]
[--feedback-lock-duration --fld]
[--feedback-ttl --ft]
[--fileupload-notification-lock-duration --fnld]
[--fileupload-notification-max-delivery-count --fnd]
[--fileupload-notification-ttl --fnt]
[--fileupload-notifications --fn {false, true}]
[--fileupload-sas-ttl --fst]
[--fileupload-storage-auth-type --fsa {identityBased, keyBased}]
[--fileupload-storage-identity --fsi]
[--force-string]
[--ids]
[--min-tls-version --mintls]
[--name]
[--rd --retention-day]
[--remove]
[--resource-group]
[--set]
[--sku {B1, B2, B3, F1, S1, S2, S3}]
[--subscription]
[--tags]
[--unit]
示例
将存储容器设置添加到文件上传
az iot hub update --name MyIotHub --fileupload-storage-connectionstring "connection-string" \ --fileupload-storage-container-name "container_name"
添加防火墙筛选器规则以接受来自 IP 掩码 127.0.0.0/31 的流量。
az iot hub update --name MyIotHub --add properties.ipFilterRules filter_name=test-rule action=Accept ip_mask=127.0.0.0/31
更新 IoT 中心的元数据。 (autogenerated)
az iot hub update --name MyIotHub --set properties.allocationPolicy="GeoLatency"
将IoT 中心单位更新为 2 并添加标记
az iot hub update -n MyIotHub --unit 2 --tags a=b c=d
将IoT 中心的定价层更新为 S2
az iot hub update -n MyIotHub --sku S2
将IoT 中心设备到云事件的保留天数更新为 3 天
az iot hub update -n MyIotHub --retention-day 3
更新IoT 中心云到设备的消息传送设置
az iot hub update --name MyIotHub --c2d-max-delivery-count 30 --c2d-ttl 5
更新IoT 中心反馈队列设置
az iot hub update --name MyIoTHub --feedback-max-delivery-count 20 --feedback-lock-duration 100 --feedback-ttl 4
更新IoT 中心文件上传设置,并将托管标识分配给用户进行文件上传
az iot hub update -n MyIoTHub --fileupload-sas-ttl 5 --fileupload-storage-auth-type identityBased --fileupload-storage-identity [system]
更新IoT 中心文件上传通知设置和队列锁定持续时间
az iot hub update -n MyIoTHub --fileupload-notification-max-delivery-count 50 --fileupload-notification-ttl 48 --fileupload-notifications --fileupload-notification-lock-duration 10
更新IoT 中心本地身份验证、设备 SAS 和模块 SAS 设置
az iot hub update -n MyIoTHub --disable-local-auth --disable-device-sas false --disable-module-sas true
可选参数
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 |
默认值: | [] |
IoT 中心尝试将云到设备消息传送到设备的次数(介于 1 到 100 之间)。
消息在 1 到 48 小时之间IoT 中心过期之前可供设备使用的时间量。
一个布尔值,指示是否禁用所有设备(包括边缘设备,但不包括模块)范围的 SAS 密钥进行身份验证。
属性 | 值 |
---|---|
接受的值: | false, true |
一个布尔值,指示是否禁用 IoT 中心范围的 SAS 密钥进行身份验证。
属性 | 值 |
---|---|
接受的值: | false, true |
一个布尔值,指示是否禁用模块范围的 SAS 密钥进行身份验证。
属性 | 值 |
---|---|
接受的值: | false, true |
上传文件的根容器的名称。 容器不需要存在,但应使用指定的 connectionString 进行创建。
将文件上传到的 Azure 存储帐户的连接字符串。
IoT 中心在 1 到 100 之间尝试在反馈队列上传递消息的次数。
反馈队列的锁定持续时间介于 5 到 300 秒之间。
IoT 中心将保留 1 到 48 小时之间的云到设备消息过期或交付反馈的时间段。
文件上传通知队列的锁定持续时间介于 5 到 300 秒之间。
IoT 中心尝试在 1 到 100 之间传递文件通知消息的次数。
文件上传通知在 1 到 48 小时之间IoT 中心过期之前可供服务使用的时间量。
一个布尔值,指示是否将有关上传的文件的信息记录到消息/servicebound/filenotifications IoT 中心终结点。
属性 | 值 |
---|---|
接受的值: | false, true |
IoT 中心生成的 SAS URI 在 1 到 24 小时内过期之前有效的时间。
文件上传到Azure 存储帐户的身份验证类型。
属性 | 值 |
---|---|
接受的值: | identityBased, keyBased |
用于文件上传身份验证的托管标识。 使用“[system]”来引用系统分配的托管标识或资源 ID 来引用用户分配的托管标识。
使用“set”或“add”时,保留字符串文本,而不是尝试转换为 JSON。
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | False |
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
指定支持此中心的最低 TLS 版本。 可设置为“1.0”或“1.2”。 例如,最低 TLS 版本设置为“1.2”会导致使用低于 1.2 的 TLS 版本的客户端被拒绝。
IoT 中心名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
指定此 IoT 中心在 1 到 7 天内维护设备到云事件的时间。
从列表中删除属性或元素。 示例: --remove property.list <indexToRemove>
OR --remove propertyToRemove
.
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | [] |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=<value>
。
属性 | 值 |
---|---|
Parameter group: | Generic Update Arguments |
默认值: | [] |
Azure IoT 中心的定价层。 请注意,每个订阅中只允许一个免费的 IoT 中心实例(F1)。 如果可用实例超过一个,将引发异常。
属性 | 值 |
---|---|
接受的值: | B1, B2, B3, F1, S1, S2, S3 |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。
IoT 中心中的单位。
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |
az iot hub wait
等待IoT 中心实例上的操作完成。
az iot hub wait [--created]
[--custom]
[--deleted]
[--exists]
[--ids]
[--interval]
[--name]
[--resource-group]
[--subscription]
[--timeout]
[--updated]
示例
等到创建现有IoT 中心实例
az iot hub wait -n MyIoTHub --created
等到删除IoT 中心实例
az iot hub wait -n MyIoTHub --deleted
等待现有IoT 中心实例处于活动状态
az iot hub wait -n MyIoTHub --custom "properties.state=='Active'"
可选参数
The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.
等待在“Succeeded”中使用“provisioningState”创建。
属性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
默认值: | False |
等待条件满足自定义 JMESPath 查询。 例如 provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running']。
属性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
等到删除为止。
属性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
默认值: | False |
等待资源存在。
属性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
默认值: | False |
一个或多个资源 ID(以空格分隔)。 它应该是包含“Resource Id”参数的所有信息的完整资源 ID。 应提供 --ids 或其他“Resource Id”参数。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
轮询间隔(以秒为单位)。
属性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
默认值: | 30 |
IoT 中心名称。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
资源组的名称。 可以使用 az configure --defaults group=<name>
配置默认组。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID
配置默认订阅。
属性 | 值 |
---|---|
Parameter group: | Resource Id Arguments |
最大等待(以秒为单位)。
属性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
默认值: | 3600 |
等到 provisioningState 更新为“Succeeded”。
属性 | 值 |
---|---|
Parameter group: | Wait Condition Arguments |
默认值: | False |
全局参数
提高日志记录详细程度以显示所有调试日志。
属性 | 值 |
---|---|
默认值: | False |
显示此帮助消息并退出。
仅显示错误,禁止显示警告。
属性 | 值 |
---|---|
默认值: | False |
Output format.
属性 | 值 |
---|---|
默认值: | json |
接受的值: | json, jsonc, none, table, tsv, yaml, yamlc |
JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/。
增加日志记录详细程度。 使用 --debug 获取完整的调试日志。
属性 | 值 |
---|---|
默认值: | False |