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

az iot hub message-endpoint create

注意

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

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

将终结点添加到IoT 中心。

命令

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

为IoT 中心添加 Cosmos DB 容器终结点。

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

为IoT 中心添加事件中心终结点。

分机 预览
az iot hub message-endpoint create servicebus-queue

为IoT 中心添加服务总线队列终结点。

扩展 预览版
az iot hub message-endpoint create servicebus-topic

为IoT 中心添加服务总线主题终结点。

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

为IoT 中心添加存储容器终结点。

分机 预览版

az iot hub message-endpoint create cosmosdb-container

预览

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

为IoT 中心添加 Cosmos DB 容器终结点。

az iot hub message-endpoint create cosmosdb-container --container
                                                      --database-name
                                                      --en
                                                      --hub-name
                                                      [--connection-string]
                                                      [--endpoint-account]
                                                      [--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 create cosmosdb-container -n {iothub_name} --en {endpoint_name} --container {container} --db {database} --endpoint-account {account_name}

使用连接字符串为IoT 中心创建 Cosmos DB 容器终结点。

az iot hub message-endpoint create cosmosdb-container -n {iothub_name} --en {endpoint_name} -c {connection_string} --container {container} --db {database}

使用指定的主密钥和终结点 URI 为IoT 中心创建 Cosmos DB 容器终结点。

az iot hub message-endpoint create cosmosdb-container -n {iothub_name} --en {endpoint_name} --pk {primary_key} --endpoint-uri {endpoint_uri} --container {container} --db {database}

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

az iot hub message-endpoint create cosmosdb-container -n {iothub_name} --en {endpoint_name} --endpoint-uri {endpoint_uri} --container {container} --db {database} --pkn {partition_key_name} --identity [system]

使用用户分配的标识、分区键名称和分区键模板为IoT 中心创建 Cosmos DB 容器终结点。

az iot hub message-endpoint create cosmosdb-container -n {iothub_name} --en {endpoint_name} --endpoint-uri {endpoint_uri} --container {container} --db {database} --pkn {partition_key_name} --pkt {partition_key_template} --identity {user_identity_resource_id}

必需参数

--container --container-name

Cosmos DB 数据库中 Cosmos DB SQL 容器的名称。

--database-name --db

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

--en --endpoint --endpoint-name

路由终结点的名称。

--hub-name -n

IoT 中心名称。

可选参数

--connection-string -c

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

--endpoint-account

终结点资源的帐户名称。

--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 create eventhub

预览

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

为IoT 中心添加事件中心终结点。

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

示例

为IoT 中心创建基于密钥的事件中心终结点。

az iot hub message-endpoint create eventhub -n {iothub_name} --en {endpoint_name} --namespace {namespace_name} --entity-path {entity_path} --policy {policy_name}

使用连接字符串为IoT 中心创建事件中心终结点。 省略终结点 URI 和实体路径。

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

使用系统分配的标识为IoT 中心创建事件中心终结点。 必须指定终结点和实体路径。

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

使用用户分配的标识为IoT 中心创建事件中心终结点。 必须指定终结点和实体路径。

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

必需参数

--en --endpoint --endpoint-name

路由终结点的名称。

--hub-name -n

IoT 中心名称。

可选参数

--connection-string -c

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

--endpoint-namespace-name --namespace

终结点资源的命名空间名称。

--endpoint-policy-name --policy

用于连接字符串检索的策略名称。

--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 create servicebus-queue

预览

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

为IoT 中心添加服务总线队列终结点。

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

示例

为IoT 中心创建基于密钥的服务总线队列终结点。

az iot hub message-endpoint create servicebus-queue -n {iothub_name} --en {endpoint_name} --namespace {namespace_name} --entity-path {entity_path} --policy {policy_name}

使用连接字符串为IoT 中心创建服务总线队列终结点。 省略终结点 URI 和实体路径。

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

使用系统分配的标识为IoT 中心创建服务总线队列终结点。 必须指定终结点和实体路径。

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

使用用户分配的标识为IoT 中心创建服务总线队列终结点。 必须指定终结点和实体路径。

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

必需参数

--en --endpoint --endpoint-name

路由终结点的名称。

--hub-name -n

IoT 中心名称。

可选参数

--connection-string -c

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

--endpoint-namespace-name --namespace

终结点资源的命名空间名称。

--endpoint-policy-name --policy

用于连接字符串检索的策略名称。

--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 create servicebus-topic

预览

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

为IoT 中心添加服务总线主题终结点。

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

示例

为IoT 中心创建基于密钥的服务总线主题终结点。

az iot hub message-endpoint create servicebus-topic -n {iothub_name} --en {endpoint_name} --namespace {namespace_name} --entity-path {entity_path} --policy {policy_name}

使用连接字符串为IoT 中心创建服务总线主题终结点。 省略终结点 URI 和实体路径。

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

使用系统分配的标识为IoT 中心创建服务总线主题终结点。 必须指定终结点和实体路径。

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

使用用户分配的标识为IoT 中心创建服务总线主题终结点。 必须指定终结点和实体路径。

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

必需参数

--en --endpoint --endpoint-name

路由终结点的名称。

--hub-name -n

IoT 中心名称。

可选参数

--connection-string -c

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

--endpoint-namespace-name --namespace

终结点资源的命名空间名称。

--endpoint-policy-name --policy

用于连接字符串检索的策略名称。

--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 create storage-container

预览

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

为IoT 中心添加存储容器终结点。

az iot hub message-endpoint create storage-container --container
                                                     --en
                                                     --hub-name
                                                     [--batch-frequency]
                                                     [--chunk-size]
                                                     [--connection-string]
                                                     [--encoding {avro, json}]
                                                     [--endpoint-account]
                                                     [--endpoint-resource-group]
                                                     [--endpoint-subscription-id]
                                                     [--endpoint-uri]
                                                     [--ff]
                                                     [--identity]
                                                     [--resource-group]

示例

为IoT 中心创建基于密钥的存储容器终结点。

az iot hub message-endpoint create storage-container -n {iothub_name} --en {endpoint_name} --container {container_name} --endpoint-account {account_name}

使用连接字符串为IoT 中心创建存储容器终结点。 省略终结点 URI。

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

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

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

使用用户分配的标识和 json 编码为IoT 中心创建存储容器终结点。 必须指定终结点。

az iot hub message-endpoint create storage-container -n {iothub_name} --en {endpoint_name} --endpoint-uri {endpoint_uri} --container {container_name} --encoding json --identity {user_identity_resource_id}

必需参数

--container --container-name

存储容器的名称。

--en --endpoint --endpoint-name

路由终结点的名称。

--hub-name -n

IoT 中心名称。

可选参数

--batch-frequency -b

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

默认值: 300
--chunk-size -w

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

默认值: 300
--connection-string -c

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

--encoding

容器的编码格式。

接受的值: avro, json
默认值: avro
--endpoint-account

终结点资源的帐户名称。

--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} 字段。 所有参数都是必需参数,但可以使用或不带分隔符重新排序。

默认值: {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 获取完整的调试日志。