你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

az iot hub message-endpoint update

注意

此参考是 Azure CLI(版本 2.37.0 或更高版本)的 azure-iot 扩展的一部分。 该扩展将在首次运行 az iot hub message-endpoint update 命令时自动安装。 详细了解扩展。

命令组“iot 中心消息终结点”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

更新IoT 中心的现有终结点的属性。

命令

名称 说明 类型 状态
az iot hub message-endpoint update cosmosdb-container

更新IoT 中心的现有 Cosmos DB 容器终结点的属性。

分机 预览
az iot hub message-endpoint update eventhub

更新IoT 中心的现有事件中心终结点的属性。

扩展 预览
az iot hub message-endpoint update servicebus-queue

更新IoT 中心的现有服务总线队列终结点的属性。

分机 预览
az iot hub message-endpoint update servicebus-topic

更新IoT 中心的现有服务总线主题终结点的属性。

扩展 预览
az iot hub message-endpoint update storage-container

更新IoT 中心的现有存储容器终结点的属性。

分机 预览

az iot hub message-endpoint update cosmosdb-container

预览

命令组“iot 中心消息终结点”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

更新IoT 中心的现有 Cosmos DB 容器终结点的属性。

如果从基于密钥的身份验证类型更新到基于标识的 Cosmos DB 容器终结点,则必须提供标识(通过 --identity)和终结点 URI(通过 --endpoint-uri)。 旧的主密钥和辅助密钥将为 null。

如果从基于标识的 Cosmos DB 容器终结点更新身份验证类型,则必须提供连接字符串(通过 --connection-string)、主密钥(通过 --primary-key)或辅助密钥(通过 --secondary-key)。

无法更改终结点的容器名称。 仅当两个帐户中存在同名的容器时,才能更改帐户名称。

az iot hub message-endpoint update cosmosdb-container --en
                                                      --hub-name
                                                      [--connection-string]
                                                      [--database-name]
                                                      [--endpoint-resource-group]
                                                      [--endpoint-subscription-id]
                                                      [--endpoint-uri]
                                                      [--identity]
                                                      [--partition-key-name]
                                                      [--partition-key-template]
                                                      [--pk]
                                                      [--resource-group]
                                                      [--secondary-key]

示例

更新IoT 中心的基于密钥或基于标识的 Cosmos DB 容器终结点,以使用新的指定连接字符串。

az iot hub message-endpoint update cosmosdb-container -n {iothub_name} --en {endpoint_name} --connection-string {connection_string}

更新 IoT 中心的 Cosmos DB 容器终结点以使用指定的主密钥和辅助密钥。

az iot hub message-endpoint update cosmosdb-container -n {iothub_name} --en {endpoint_name} --pk {primary_key} --sk {secondary_key}

更新 IoT 中心的 Cosmos DB 容器终结点,以使用系统分配的标识和分区键名称。 分区键模板将是默认值。

az iot hub message-endpoint update cosmosdb-container -n {iothub_name} --en {endpoint_name} --pkn {partition_key_name} --identity [system]

为IoT 中心更新基于密钥的 Cosmos DB 容器终结点以使用用户分配的标识(如果终结点已基于标识,则可以省略 --endpoint-uri)。

az iot hub message-endpoint update cosmosdb-container -n {iothub_name} --en {endpoint_name} --identity {user_identity_resource_id} --endpoint-uri {endpoint_uri}

必需参数

--en --endpoint --endpoint-name

路由终结点的名称。

--hub-name -n

IoT 中心名称。

可选参数

--connection-string -c

路由终结点的连接字符串。

--database-name --db

cosmos DB 帐户中的 cosmos DB 数据库的名称。

--endpoint-resource-group --erg -r

终结点的资源组会重新调整。 如果未提供,将使用IoT 中心的资源组。

--endpoint-subscription-id -s

终结点资源的订阅 ID。 如果未提供,将使用IoT 中心的订阅。

--endpoint-uri

终结点资源的 URI。

--identity

使用系统分配的或用户分配的托管标识进行终结点身份验证。 使用“[system]”来引用系统分配的标识或资源 ID 来引用用户分配的标识。

--partition-key-name --pkn

与此 Cosmos DB SQL 容器关联的分区键的名称(如果存在)。 若要清除此属性,请将此属性设置为“”。

--partition-key-template --pkt

用于生成用于此 Cosmos DB SQL 容器的合成分区键值的模板。 模板必须至少包含以下占位符之一:{iothub}、{deviceid}、{DD}、{MM}和 {YYYY}。 最多可以指定一个占位符,但顺序和非占位符组件是任意的。 如果提供了分区键名称,则分区键模板默认为 {deviceid}-{YYYY}-{MM}。 若要清除此属性,请将此属性设置为“”。

--pk --primary-key

cosmos DB 帐户的主键。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

--secondary-key --sk

cosmos DB 帐户的辅助密钥。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az iot hub message-endpoint update eventhub

预览

命令组“iot 中心消息终结点”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

更新IoT 中心的现有事件中心终结点的属性。

如果从基于密钥的身份验证类型更新到基于标识的事件中心终结点,则必须提供标识(通过 --identity)、终结点 URI(通过 --endpoint-uri)和实体路径(通过 --entity-path)。 旧的连接字符串将被 null 掉。

如果从基于标识的身份验证类型更新到基于密钥的事件中心终结点,则必须提供连接字符串(通过 --connection-string)。 旧的终结点 URI 和实体路径将为 null。

az iot hub message-endpoint update eventhub --en
                                            --hub-name
                                            [--connection-string]
                                            [--endpoint-resource-group]
                                            [--endpoint-subscription-id]
                                            [--endpoint-uri]
                                            [--entity-path]
                                            [--identity]
                                            [--resource-group]

示例

为IoT 中心更新基于密钥或基于标识的事件中心终结点,以使用新的指定连接字符串。

az iot hub message-endpoint update eventhub -n {iothub_name} --en {endpoint_name} -c {connection_string}

更新IoT 中心的事件中心终结点以使用系统分配的标识和其他实体路径。

az iot hub message-endpoint update eventhub -n {iothub_name} --en {endpoint_name} --entity-path {entity_path} --identity [system]

更新基于密钥的事件中心终结点,使IoT 中心使用用户分配的标识(如果终结点已基于标识,则可以省略 --endpoint-uri)。

az iot hub message-endpoint update eventhub -n {iothub_name} --en {endpoint_name} --identity {user_identity_resource_id} --endpoint-uri {endpoint_uri} --entity-path {entity_path}

必需参数

--en --endpoint --endpoint-name

路由终结点的名称。

--hub-name -n

IoT 中心名称。

可选参数

--connection-string -c

路由终结点的连接字符串。

--endpoint-resource-group --erg -r

终结点的资源组会重新调整。 如果未提供,将使用IoT 中心的资源组。

--endpoint-subscription-id -s

终结点资源的订阅 ID。 如果未提供,将使用IoT 中心的订阅。

--endpoint-uri

终结点资源的 URI。

--entity-path

终结点资源的实体路径。

--identity

使用系统分配的或用户分配的托管标识进行终结点身份验证。 使用“[system]”来引用系统分配的标识或资源 ID 来引用用户分配的标识。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az iot hub message-endpoint update servicebus-queue

预览

命令组“iot 中心消息终结点”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

更新IoT 中心的现有服务总线队列终结点的属性。

如果从基于密钥的身份验证类型更新到基于标识的服务总线队列终结点,则必须提供标识(通过 --identity)、终结点 URI(通过 --endpoint-uri)和实体路径(通过 --entity-path)。 旧的连接字符串将被 null 掉。

如果从基于标识的身份验证类型更新到基于密钥的服务总线队列终结点,则必须提供连接字符串(通过 --connection-string)。 旧的终结点 URI 和实体路径将为 null。

az iot hub message-endpoint update servicebus-queue --en
                                                    --hub-name
                                                    [--connection-string]
                                                    [--endpoint-resource-group]
                                                    [--endpoint-subscription-id]
                                                    [--endpoint-uri]
                                                    [--entity-path]
                                                    [--identity]
                                                    [--resource-group]

示例

更新基于密钥或基于标识的服务总线队列终结点,以便IoT 中心使用新的指定连接字符串。

az iot hub message-endpoint update servicebus-queue -n {iothub_name} --en {endpoint_name} -c {connection_string}

更新服务总线队列终结点,以便IoT 中心使用系统分配的标识和其他实体路径。

az iot hub message-endpoint update servicebus-queue -n {iothub_name} --en {endpoint_name} --entity-path {entity_path} --identity [system]

更新基于密钥的服务总线队列终结点,以便IoT 中心使用用户分配的标识(如果终结点已基于标识,则可以省略 --endpoint-uri)。

az iot hub message-endpoint update servicebus-queue -n {iothub_name} --en {endpoint_name} --identity {user_identity_resource_id} --endpoint-uri {endpoint_uri} --entity-path {entity_path}

必需参数

--en --endpoint --endpoint-name

路由终结点的名称。

--hub-name -n

IoT 中心名称。

可选参数

--connection-string -c

路由终结点的连接字符串。

--endpoint-resource-group --erg -r

终结点的资源组会重新调整。 如果未提供,将使用IoT 中心的资源组。

--endpoint-subscription-id -s

终结点资源的订阅 ID。 如果未提供,将使用IoT 中心的订阅。

--endpoint-uri

终结点资源的 URI。

--entity-path

终结点资源的实体路径。

--identity

使用系统分配的或用户分配的托管标识进行终结点身份验证。 使用“[system]”来引用系统分配的标识或资源 ID 来引用用户分配的标识。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az iot hub message-endpoint update servicebus-topic

预览

命令组“iot 中心消息终结点”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

更新IoT 中心的现有服务总线主题终结点的属性。

如果从基于密钥的身份验证类型更新为基于标识服务总线主题终结点,则必须提供标识(通过 --identity)、终结点 URI(通过 --endpoint-uri)和实体路径(通过 --entity-path)。 旧的连接字符串将被 null 掉。

如果从基于标识的身份验证类型更新到基于密钥的服务总线主题终结点,则必须提供连接字符串(通过 --connection-string)。 旧的终结点 URI 和实体路径将为 null。

az iot hub message-endpoint update servicebus-topic --en
                                                    --hub-name
                                                    [--connection-string]
                                                    [--endpoint-resource-group]
                                                    [--endpoint-subscription-id]
                                                    [--endpoint-uri]
                                                    [--entity-path]
                                                    [--identity]
                                                    [--resource-group]

示例

为IoT 中心更新基于密钥或基于标识的服务总线主题终结点,以使用新的指定连接字符串。

az iot hub message-endpoint update servicebus-topic -n {iothub_name} --en {endpoint_name} -c {connection_string}

更新服务总线主题终结点,以便IoT 中心使用系统分配的标识和其他实体路径。

az iot hub message-endpoint update servicebus-topic -n {iothub_name} --en {endpoint_name} --entity-path {entity_path} --identity [system]

为IoT 中心更新基于密钥的服务总线主题终结点以使用用户分配的标识(如果终结点已基于标识,则可以省略 --endpoint-uri)。

az iot hub message-endpoint update servicebus-topic -n {iothub_name} --en {endpoint_name}  --identity {user_identity_resource_id} --endpoint-uri {endpoint_uri} --entity-path {entity_path}

必需参数

--en --endpoint --endpoint-name

路由终结点的名称。

--hub-name -n

IoT 中心名称。

可选参数

--connection-string -c

路由终结点的连接字符串。

--endpoint-resource-group --erg -r

终结点的资源组会重新调整。 如果未提供,将使用IoT 中心的资源组。

--endpoint-subscription-id -s

终结点资源的订阅 ID。 如果未提供,将使用IoT 中心的订阅。

--endpoint-uri

终结点资源的 URI。

--entity-path

终结点资源的实体路径。

--identity

使用系统分配的或用户分配的托管标识进行终结点身份验证。 使用“[system]”来引用系统分配的标识或资源 ID 来引用用户分配的标识。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。

az iot hub message-endpoint update storage-container

预览

命令组“iot 中心消息终结点”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

更新IoT 中心的现有存储容器终结点的属性。

如果从基于密钥的身份验证类型更新到基于标识的存储容器终结点,则必须提供标识(通过 --identity)和终结点 URI(通过 --endpoint-uri)。 旧的连接字符串将被 null 掉。

如果从基于标识的身份验证类型更新到基于密钥的存储容器终结点,则必须提供连接字符串(通过 --connection-string)。

无法更改终结点的容器名称和编码。 仅当两个帐户中存在同名的容器时,才能更改帐户名称。

az iot hub message-endpoint update storage-container --en
                                                     --hub-name
                                                     [--batch-frequency]
                                                     [--chunk-size]
                                                     [--connection-string]
                                                     [--endpoint-resource-group]
                                                     [--endpoint-subscription-id]
                                                     [--endpoint-uri]
                                                     [--ff]
                                                     [--identity]
                                                     [--resource-group]

示例

更新基于密钥或基于标识的存储容器终结点,以便IoT 中心使用新的指定连接字符串。

az iot hub message-endpoint update storage-container -n {iothub_name} --en {endpoint_name} -c {connection_string}

为IoT 中心更新存储容器终结点,以使用具有给定批处理频率、区块大小和文件名格式的系统分配标识。

az iot hub message-endpoint update storage-container -n {iothub_name} --en {endpoint_name}  -b {batch_frequency} -w {chunk_size} --ff {file_format} --identity [system]

更新基于密钥的存储容器终结点,以便IoT 中心使用用户分配的标识(如果终结点已基于标识,则可以省略 --endpoint-uri)。

az iot hub message-endpoint update storage-container -n {iothub_name} --en {endpoint_name} --identity {user_identity_resource_id} --endpoint-uri {endpoint_uri}

必需参数

--en --endpoint --endpoint-name

路由终结点的名称。

--hub-name -n

IoT 中心名称。

可选参数

--batch-frequency -b

请求批处理频率(以秒为单位)。 在将数据写入 Blob 之前可以经过的最长时间(介于 60 到 720 秒之间)。

--chunk-size -w

请求区块大小(MB)。 Blob 的最大大小,介于 10 到 500 MB 之间。

--connection-string -c

路由终结点的连接字符串。

--endpoint-resource-group --erg -r

终结点的资源组会重新调整。 如果未提供,将使用IoT 中心的资源组。

--endpoint-subscription-id -s

终结点资源的订阅 ID。 如果未提供,将使用IoT 中心的订阅。

--endpoint-uri

终结点资源的 URI。

--ff --file-name-format

Blob 的文件名格式。 文件名格式必须包含 {iothub}、{partition}、{YYYY}、{MM}、{DD}、{HH} 和 {mm} 字段。 所有参数都是必需参数,但可以使用或不带分隔符重新排序。

--identity

使用系统分配的或用户分配的托管标识进行终结点身份验证。 使用“[system]”来引用系统分配的标识或资源 ID 来引用用户分配的标识。

--resource-group -g

资源组的名称。 可以使用 az configure --defaults group=<name> 配置默认组。

全局参数
--debug

提高日志记录详细程度以显示所有调试日志。

--help -h

显示此帮助消息并退出。

--only-show-errors

只显示错误,取消显示警告。

--output -o

输出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
默认值: json
--query

JMESPath 查询字符串。 有关更多信息和示例,请参阅 http://jmespath.org/

--subscription

订阅的名称或 ID。 可以使用 az account set -s NAME_OR_ID 配置默认订阅。

--verbose

提高日志记录详细程度。 使用 --debug 获取完整的调试日志。