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

az tsi event-source iothub

注意

此参考是 Azure CLI(版本 2.50.0 或更高版本)的 timeseriesinsights 扩展的一部分。 该扩展将在首次运行 az tsi event-source iothub 命令时自动安装。 详细了解扩展。

使用 timeseriesinsights 子组 iot-hub 管理事件源。

命令

名称 说明 类型 状态
az tsi event-source iothub create

在指定环境中创建事件源。

分机 GA
az tsi event-source iothub update

更新指定环境中的事件源。

扩展 GA

az tsi event-source iothub create

在指定环境中创建事件源。

az tsi event-source iothub create --consumer-group-name
                                  --environment-name
                                  --event-source-name
                                  --event-source-resource-id
                                  --iot-hub-name
                                  --key-name
                                  --location
                                  --resource-group
                                  --shared-access-key
                                  [--local-timestamp]
                                  [--tags]
                                  [--timestamp-property-name]

示例

CreateIotHubEventSource

az tsi event-source iothub create -g "rg" --environment-name "env1" --name "eventsource" --consumer-group-name "consumer-group" --iot-hub-name "iothub" --location westus --key-name "key-name" --shared-access-key "someSecretvalue" --event-source-resource-id "resource-id"

必需参数

--consumer-group-name

用于保存要从中读取事件的分区的 iot 中心的使用者组的名称。

--environment-name

与指定资源组关联的时序见解环境的名称。

--event-source-name --name -n

与指定环境关联的时序见解事件源的名称。

--event-source-resource-id --resource-id

Azure 资源管理器中事件源的资源 ID。

--iot-hub-name

iot 中心的名称。

--key-name --shared-access-policy-name

授予时序见解服务对 iot 中心的访问权限的共享访问策略密钥的名称。 此共享访问策略密钥必须向 iot 中心授予“服务连接”权限。

--location -l

Location。 az account list-locations 中的值。 可以使用 az configure --defaults location=<location> 配置默认位置。

--resource-group -g

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

--shared-access-key

授予时序见解服务对 iot 中心的读取访问权限的共享访问策略密钥的值。 此属性未显示在事件源响应中。

可选参数

--local-timestamp

一个表示本地时间戳属性的对象。 它包含需要使用的本地时间戳的格式以及相应的时区偏移信息。 如果未为 localTimestamp 指定值,或为 null,则不会使用事件传入本地时间戳。 预期值:json-string/@json-file。

--tags

空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。

--timestamp-property-name --ts-property-name

用作事件源时间戳的事件属性。 如果未为 timestampPropertyName 指定值,或者指定 null 或空字符串,则会使用事件创建时间。

全局参数
--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 tsi event-source iothub update

更新指定环境中的事件源。

az tsi event-source iothub update [--environment-name]
                                  [--event-source-name]
                                  [--ids]
                                  [--local-timestamp]
                                  [--resource-group]
                                  [--shared-access-key]
                                  [--subscription]
                                  [--tags]
                                  [--timestamp-property-name]

示例

UpdateIotHubEventSource

az tsi event-source iothub update -g "rg" --environment-name "env1" --name "eventsource"  --timestamp-property-name timestampProp --shared-access-key "someSecretvalue" --tags test=tag

可选参数

--environment-name

与指定资源组关联的时序见解环境的名称。

--event-source-name --name -n

与指定环境关联的时序见解事件源的名称。

--ids

一个或多个资源 ID(空格分隔)。 它应该是包含“资源 ID”参数的所有信息的完整资源 ID。 应提供 --id 或其他“资源 ID”参数。

--local-timestamp

一个表示本地时间戳属性的对象。 它包含需要使用的本地时间戳的格式以及相应的时区偏移信息。 如果未为 localTimestamp 指定值,或为 null,则不会使用事件传入本地时间戳。 预期值:json-string/@json-file。

--resource-group -g

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

--shared-access-key

授予时序见解服务对 iot 中心的读取访问权限的共享访问策略密钥的值。 此属性未显示在事件源响应中。

--subscription

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

--tags

空格分隔标记:key[=value] [key[=value] ...]。使用“”清除现有标记。

--timestamp-property-name --ts-property-name

用作事件源时间戳的事件属性。 如果未为 timestampPropertyName 指定值,或者指定 null 或空字符串,则会使用事件创建时间。

全局参数
--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 获取完整的调试日志。