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

az eventgrid event-subscription

注意

此命令组具有在 Azure CLI 和至少一个扩展中定义的命令。 安装每个扩展,使其受益于其扩展功能。 详细了解扩展。

管理事件订阅。

管理事件网格主题、域、域主题、Azure 订阅、资源组或支持事件通知的任何其他 Azure 资源的事件订阅。

命令

名称 说明 类型 状态
az eventgrid event-subscription create

创建新的事件订阅。

核心 GA
az eventgrid event-subscription create (eventgrid 扩展)

创建新的事件订阅。

扩展 预览
az eventgrid event-subscription delete

删除事件订阅。

核心 GA
az eventgrid event-subscription delete (eventgrid 扩展)

删除事件订阅。

扩展 预览
az eventgrid event-subscription list

列出事件订阅。

核心 GA
az eventgrid event-subscription list (eventgrid 扩展)

列出事件订阅。

扩展 预览
az eventgrid event-subscription show

获取事件订阅的详细信息。

核心 GA
az eventgrid event-subscription show (eventgrid 扩展)

获取事件订阅的详细信息。

扩展 预览
az eventgrid event-subscription update

更新事件订阅。

核心 GA
az eventgrid event-subscription update (eventgrid 扩展)

更新事件订阅。

扩展 预览

az eventgrid event-subscription create

创建新的事件订阅。

az eventgrid event-subscription create --name
                                       [--aad-tenant-id]
                                       [--advanced-filter]
                                       [--azure-active-directory-application-id-or-uri]
                                       [--deadletter-endpoint]
                                       [--deadletter-identity {systemassigned}]
                                       [--deadletter-identity-endpoint]
                                       [--delivery-attribute-mapping]
                                       [--delivery-identity {systemassigned}]
                                       [--delivery-identity-endpoint]
                                       [--delivery-identity-endpoint-type {azurefunction, eventhub, hybridconnection, servicebusqueue, servicebustopic, storagequeue, webhook}]
                                       [--enable-advanced-filtering-on-arrays {false, true}]
                                       [--endpoint]
                                       [--endpoint-type]
                                       [--event-delivery-schema {cloudeventschemav1_0, custominputschema, eventgridschema}]
                                       [--event-ttl]
                                       [--expiration-date]
                                       [--included-event-types]
                                       [--labels]
                                       [--max-delivery-attempts]
                                       [--max-events-per-batch]
                                       [--preferred-batch-size-in-kilobytes]
                                       [--qttl]
                                       [--source-resource-id]
                                       [--subject-begins-with]
                                       [--subject-case-sensitive {false, true}]
                                       [--subject-ends-with]

示例

使用默认筛选器为事件网格主题创建新的事件订阅。

az eventgrid event-subscription create --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code

使用默认筛选器为 Azure 订阅创建新的事件订阅。

az eventgrid event-subscription create --name es2 \
    --source-resource-id /subscriptions/{SubID} \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code

使用默认筛选器为资源组创建新的事件订阅。

az eventgrid event-subscription create --name es3 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG} \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code

使用默认筛选器为存储帐户创建新的事件订阅。

az eventgrid event-subscription create --name es3 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/s1"  \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code

使用高级筛选器为存储帐户创建新的事件订阅。

az eventgrid event-subscription create  --name es3 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/s1" \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code
    --advanced-filter data.blobType StringIn BlockBlob
    --advanced-filter data.url StringBeginsWith https://myaccount.blob.core.windows.net

为 Azure 订阅创建新的事件订阅,其中包含指定主题前缀的筛选器。

az eventgrid event-subscription create --name es4 \
    --source-resource-id /subscriptions/{SubID} \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code \
    --subject-begins-with mysubject_prefix

为资源组创建新的事件订阅,其中包含指定主题后缀的筛选器。

az eventgrid event-subscription create --name es5 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG} \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code \
    --subject-ends-with mysubject_suffix

使用默认筛选器和 EventHub 作为目标,为 Azure 订阅创建新的事件订阅。

az eventgrid event-subscription create --name es2 \
    --source-resource-id /subscriptions/{SubID} \
    --endpoint-type eventhub \
    --endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/n1/eventhubs/EH1

使用默认筛选器和Azure 存储队列作为目标,为 Azure 订阅创建新的事件订阅。

az eventgrid event-subscription create --name es2 \
    --source-resource-id /subscriptions/{SubID} \
    --endpoint-type storagequeue \
    --endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/queueservices/default/queues/q1

使用默认筛选器和 Azure ServiceBusQueue 作为目标,为 Azure 订阅创建新的事件订阅。

az eventgrid event-subscription create --name es2 \
    --source-resource-id /subscriptions/{SubID} \
    --endpoint-type servicebusqueue \
    --endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ns1/queues/queue1

使用默认筛选器和 CloudEvent V 1.0 作为传递架构,为事件网格域创建新的事件订阅。

az eventgrid event-subscription create --name es2 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1 \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code \
    --event-delivery-schema cloudeventschemav1_0

为存储帐户创建新的事件订阅,其中包含死信目标,自定义重试策略最多 10 次传递尝试,事件 TTL 为 2 小时(以之前发生为准)。

az eventgrid event-subscription create --name es2 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/s1" \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code \
    --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/s2/blobServices/default/containers/blobcontainer1 \
    --max-delivery-attempts 10 --event-ttl 120

为域主题创建新的事件订阅。

az eventgrid event-subscription create --name es2 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/domain1/topics/t1" \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code

创建过期日期的新事件订阅(用于存储帐户)。

az eventgrid event-subscription create --name es2 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/sa1" \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code
    --expiration-date "2018-10-31"

使用已启用 Azure Active Directory 的 Webhook 作为目标,为事件网格主题创建新的事件订阅。

az eventgrid event-subscription create --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code
    --azure-active-directory-tenant-id azureactivedirectorytenantid
    --azure-active-directory-application-id-or-uri azureactivedirectoryapplicationidoruri

使用 Azure Function 作为目标,为事件网格主题创建新的事件订阅。

az eventgrid event-subscription create --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \
    --endpoint /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Web/sites/{functionappname}/functions/{functionname} --endpoint-type azurefunction

为事件网格主题创建新的事件订阅,将 Eventhub 与 systemassigned MSI 标识用作目标,使用具有 MSI 标识的死信

az eventgrid event-subscription create --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \
    --delivery-identity-endpoint-type eventhub --delivery-identity systemassigned --delivery-identity-endpoint /subscriptions/{SubId2|}/resourceGroups/{RG2}/providers/Microsoft.eventhub/namespaces/{EventHubNamespace}/eventhubs/{EventhubName} \
    --deadletter-identity-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/s2/blobServices/default/containers/blobcontainer1 --deadletter-identity systemassigned -n {EventSubscriptionName}

使用存储队列作为目标(消息ttl 为 5 分钟)为事件网格主题创建新的事件订阅

az eventgrid event-subscription create -n es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1
    --endpoint-type storagequeue \
    --endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/queueservices/default/queues/q1 \
    --storage-queue-msg-ttl 300

使用具有 systemassigned MSI 标识作为目标的 存储Queue 为事件网格主题创建新的事件订阅

az eventgrid event-subscription create -n {EventSubscriptionName} --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \
    --delivery-identity-endpoint-type StorageQueue --delivery-identity systemassigned --delivery-identity-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/queueservices/default/queues/q1 \
    --storage-queue-msg-ttl 300

为在数组上启用高级筛选的事件网格主题创建新的事件订阅

az eventgrid event-subscription create -n es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1
    --endpoint-type storagequeue \
    --endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/queueservices/default/queues/q1 \
    --enable-advanced-filtering-on-arrays true

必需参数

--name -n

事件订阅的名称。

可选参数

--aad-tenant-id --azure-active-directory-tenant-id

用于获取将作为传递请求中的持有者令牌包含的访问令牌的 Azure Active Directory 租户 ID。 仅适用于 Webhook 作为目标。

--advanced-filter

高级筛选器允许基于特定事件属性筛选事件。

用法:--advanced-filter KEY[.INNERKEY] FILTEROPERATOR 值 [VALUE ...]StringIn:--advanced-filter 数据。颜色 StringIn 蓝色红色橙色黄色 StringNotIn:--advanced-filter 数据。Color StringNotIn Blue Red Orange Yellow StringContains: --advanced-filter subject StringContains Blue Red StringNotContains: --advanced-filter subject StringNotContains Blue Red StringBeginsWith: --advanced-filter subject StringBeginsWith Blue Red StringNotBeginsWith: --advanced-filter subject StringNotBeginsWith Blue Red StringEndsWith: --advanced-filter subject StringEndsWith img png jpg StringNotEndsWith: --advanced-filter subject StringNotEndsWith img png jpg NumberIn: --advanced-filterdata.property1 NumberIn 5 10 20 NumberInRange --advanced-filter data.property1 NumberInRange 5,10 20,30 40,50 NumberNotIn: --advanced-filter data.property2 NumberNotIn 100 200 300 NumberNotInRange: --advanced-filter data.property2 NumberNotInRange 100,110 200,210 300,310 NumberLessThan: --advanced-filter data.property3 NumberLessThan 100 NumberLessThanOrEquals: --advanced-filter data.property2 NumberLessThanOrEquals 100 NumberGreaterThan: --advanced-filter data.property3NumberGreaterThan 100 NumberGreaterThanOrEquals: --advanced-filter data.property2 NumberGreaterThanOrEquals 100 BoolEquals: --advanced-filter data.property3 BoolE true IsNullOrUndefined: --advanced-filter data.property3 IsNullOrUndefined IsNotNull: --advanced-filter data.property3 IsNotNull 多个高级筛选器可以使用多个 --advanced-filter 参数来指定。

--azure-active-directory-application-id-or-uri

用于获取访问令牌的 Azure Active Directory 应用程序 ID 或 URI,该令牌将作为持有者令牌包含在传递请求中。 仅适用于 Webhook 作为目标。

--deadletter-endpoint

Azure 存储 Blob 容器目标的 Azure 资源 ID,其中 EventGrid 应为此事件订阅删除无法传送的事件。

示例:--deadletter-endpoint /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft。存储/storageAccounts/sa1/blobServices/default/containers/containerName。

--deadletter-identity
预览

死信目标资源的标识类型。

接受的值: systemassigned
--deadletter-identity-endpoint

Azure 存储 blob 容器目标的 Azure 资源 ID,其中 EventGrid 应为此事件订阅死掉无法传送的事件。

--delivery-attribute-mapping

添加传递属性映射,以在传递事件时通过 HTTP 标头发送其他信息。 此属性适用于所有目标类型,存储Queue 除外。 可以使用多个 --delivery-attribute-mapping 参数来指定多个属性。

用法:--delivery-attribute-mapping attribute-name attribute-type attribute-value [attribute-is-secret] Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue false Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue true Dynamic Attribute Mapping: --delivery-attribute-mapping somename dynamic somevalue Both Static and Dynamic: --delivery-attribute-mapping somename dynamic somevalue --delivery-attribute-mapping somename2 static somevalue.

--delivery-identity
预览

传递目标资源的标识类型(例如存储队列或事件中心)。

接受的值: systemassigned
--delivery-identity-endpoint
预览

具有 EventGrid 应提供匹配此事件订阅的事件的标识的终结点。 对于 Webhook 终结点类型,应为相应的 Webhook URL。 对于其他终结点类型,这应该是终结点的 Azure 资源标识符。

--delivery-identity-endpoint-type
预览

具有资源标识的目标终结点的类型。

接受的值: azurefunction, eventhub, hybridconnection, servicebusqueue, servicebustopic, storagequeue, webhook
--enable-advanced-filtering-on-arrays --enable-af-arr

允许针对值数组(而不是期望一个单一值)评估高级筛选器。

接受的值: false, true
--endpoint

EventGrid 应提供匹配此事件订阅的事件的终结点。 对于 Webhook 终结点类型,应为相应的 Webhook URL。 对于其他终结点类型,这应该是终结点的 Azure 资源标识符。 预期目标终结点已在执行任何事件网格命令之前创建并可供使用。

--endpoint-type

目标终结点的类型。

默认值: webhook
--event-delivery-schema

应为此事件订阅传递事件的架构。 默认情况下,事件将以发布它们的同一架构(基于相应主题的输入架构)传送。

接受的值: cloudeventschemav1_0, custominputschema, eventgridschema
--event-ttl

活动生存时间(以分钟为单位)。 必须是介于 1 和 1440 之间的数字。

默认值: 1440
--expiration-date

日期或日期/时间(UTC,例如“2018-11-30T11:59:59+00:00”或“2018-11-30”),之后事件订阅将过期。 默认情况下,事件订阅没有过期时间。

--included-event-types

事件类型的空格分隔列表(例如 Microsoft.存储)。BlobCreated 和 Microsoft。存储。BlobDeleted)。 若要订阅所有默认事件类型,请不要为此参数指定任何值。 对于事件网格主题,事件类型是客户定义的。 对于 Azure 事件,例如存储帐户、IoT 中心等,可以使用此 CLI 命令“az eventgrid topic-type list-event-types”查询其事件类型。

--labels

要与此事件订阅关联的标签的空格分隔列表。

--max-delivery-attempts

最大传递尝试次数。 必须是介于 1 和 30 之间的数字。

默认值: 30
--max-events-per-batch

批处理中的最大事件数。 必须是介于 1 和 5000 之间的数字。

--preferred-batch-size-in-kilobytes

首选批大小(以 KB 为单位)。 必须是介于 1 和 1024 之间的数字。

--qttl --storage-queue-msg-ttl

存储队列消息生存时间(以秒为单位)。

--source-resource-id

需要向其创建事件订阅的 Azure 资源的完全限定标识符。

使用情况:--source-resource-id Azure-Resource-ID For Azure 订阅:--source-resource-id /subscriptions/{SubID} 对于资源组:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 For EventGrid 主题: --source--resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 对于存储帐户:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.存储/storageaccounts/sa1 For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1。

--subject-begins-with

一个可选字符串,用于根据前缀筛选事件订阅的事件。 不支持通配符。

--subject-case-sensitive

指定以指示是否应以区分大小写的方式比较主题字段。 如此 如果存在标志。

接受的值: false, true
默认值: False
--subject-ends-with

一个可选字符串,用于根据后缀筛选事件订阅的事件。 不支持通配符。

全局参数
--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 eventgrid event-subscription create (eventgrid 扩展)

预览

命令组“az eventgrid”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

创建新的事件订阅。

az eventgrid event-subscription create --name
                                       [--advanced-filter]
                                       [--azure-active-directory-application-id-or-uri]
                                       [--azure-active-directory-tenant-id]
                                       [--deadletter-endpoint]
                                       [--deadletter-identity {systemassigned}]
                                       [--deadletter-identity-endpoint]
                                       [--delivery-identity {systemassigned}]
                                       [--delivery-identity-endpoint]
                                       [--delivery-identity-endpoint-type {azurefunction, eventhub, hybridconnection, servicebusqueue, servicebustopic, storagequeue, webhook}]
                                       [--endpoint]
                                       [--endpoint-type {azurefunction, eventhub, hybridconnection, servicebusqueue, servicebustopic, storagequeue, webhook}]
                                       [--event-delivery-schema {cloudeventschemav1_0, custominputschema, eventgridschema}]
                                       [--event-ttl]
                                       [--expiration-date]
                                       [--included-event-types]
                                       [--labels]
                                       [--max-delivery-attempts]
                                       [--max-events-per-batch]
                                       [--preferred-batch-size-in-kilobytes]
                                       [--source-resource-id]
                                       [--subject-begins-with]
                                       [--subject-case-sensitive {false, true}]
                                       [--subject-ends-with]

示例

使用默认筛选器为事件网格主题创建新的事件订阅。

az eventgrid event-subscription create --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code

使用默认筛选器为 Azure 订阅订阅创建新的事件订阅。

az eventgrid event-subscription create --name es2 \
    --source-resource-id /subscriptions/{SubID} \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code

使用默认筛选器为资源组创建新的事件订阅。

az eventgrid event-subscription create --name es3 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG} \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code

使用默认筛选器为存储帐户创建新的事件订阅。

az eventgrid event-subscription create --name es3 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/s1"  \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code

使用高级筛选器为存储帐户创建新的事件订阅。

az eventgrid event-subscription create  --name es3 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/s1" \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code
    --advanced-filter data.blobType StringIn BlockBlob
    --advanced-filter data.url StringBeginsWith https://myaccount.blob.core.windows.net

为 Azure 订阅创建新的事件订阅,其中包含指定主题前缀的筛选器。

az eventgrid event-subscription create --name es4 \
    --source-resource-id /subscriptions/{SubID} \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code \
    --subject-begins-with mysubject_prefix

为资源组创建新的事件订阅,其中包含指定主题后缀的筛选器。

az eventgrid event-subscription create --name es5 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG} \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code \
    --subject-ends-with mysubject_suffix

使用默认筛选器和 EventHub 作为目标,为 Azure 订阅创建新的事件订阅。

az eventgrid event-subscription create --name es2 \
    --source-resource-id /subscriptions/{SubID} \
    --endpoint-type eventhub \
    --endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.EventHub/namespaces/n1/eventhubs/EH1

使用默认筛选器和Azure 存储队列作为目标,为 Azure 订阅创建新的事件订阅。

az eventgrid event-subscription create --name es2 \
    --source-resource-id /subscriptions/{SubID} \
    --endpoint-type storagequeue \
    --endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/queueservices/default/queues/q1

使用默认筛选器和 Azure ServiceBusQueue 作为目标,为 Azure 订阅创建新的事件订阅。

az eventgrid event-subscription create --name es2 \
    --source-resource-id /subscriptions/{SubID} \
    --endpoint-type servicebusqueue \
    --endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.ServiceBus/namespaces/ns1/queues/queue1

使用默认筛选器和 CloudEvent V 1.0 作为传递架构,为事件网格域创建新的事件订阅。

az eventgrid event-subscription create --name es2 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1 \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code \
    --event-delivery-schema cloudeventschemav1_0

为存储帐户创建新的事件订阅,其中包含死信目标,自定义重试策略最多 10 次传递尝试,事件 TTL 为 2 小时(以之前发生为准)。

az eventgrid event-subscription create --name es2 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/s1" \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code \
    --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/s2/blobServices/default/containers/blobcontainer1 \
    --max-delivery-attempts 10 --event-ttl 120

为域主题创建新的事件订阅。

az eventgrid event-subscription create --name es2 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/domain1/topics/t1" \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code

创建过期日期的新事件订阅(用于存储帐户)。

az eventgrid event-subscription create --name es2 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/sa1" \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code
    --expiration-date "2018-10-31"

使用已启用 Azure Active Directory 的 Webhook 作为目标,为事件网格主题创建新的事件订阅。

az eventgrid event-subscription create --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code
    --azure-active-directory-tenant-id azureactivedirectorytenantid
    --azure-active-directory-application-id-or-uri azureactivedirectoryapplicationidoruri

使用 Azure Function 作为目标,为事件网格主题创建新的事件订阅。

az eventgrid event-subscription create --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \
    --endpoint /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Web/sites/{functionappname}/functions/{functionname} --endpoint-type azurefunction

为事件网格主题创建新的事件订阅,将 Eventhub 与 systemassigned MSI 标识用作目标,使用具有 MSI 标识的死信

az eventgrid event-subscription create --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \
    --delivery-identity-endpoint-type eventhub --delivery-identity systemassigned --delivery-identity-endpoint /subscriptions/{SubId2|}/resourceGroups/{RG2}/providers/Microsoft.eventhub/namespaces/{EventHubNamespace}/eventhubs/{EventhubName} \
    --deadletter-identity-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/s2/blobServices/default/containers/blobcontainer1 --deadletter-identity systemassigned -n {EventSubscriptionName}

必需参数

--name -n

事件订阅的名称。

可选参数

--advanced-filter

高级筛选器允许基于特定事件属性筛选事件。

用法:--advanced-filter KEY[.INNERKEY] FILTEROPERATOR 值 [VALUE ...]StringIn:--advanced-filter 数据。颜色 StringIn 蓝色红色橙色黄色 StringNotIn:--advanced-filter 数据。Color StringNotIn Blue Red Orange Yellow StringContains: --advanced-filter subject StringContains Blue Red StringBeginsWith: --advanced-filter subject StringBeginsWith Blue StringEndsWith: --advanced-filter subject StringEndsWith img png jpg NumberIn: --advanced--filter subject StringEndsWith filter data.property1 NumberIn 5 10 20 NumberNotIn: --advanced-filter data.property2 NumberNotIn 100 200 300 NumberLessThan: --advanced-filter data.property3 NumberLessThan 100 NumberLessThanOrEquals: --advanced-filterdata.property2 NumberLessThanOrEquals 100 NumberGreaterThan: --advanced-filter data.property3 NumberGreaterThan 100 NumberGreaterThanOrEquals: --advanced-filter data.property2 NumberGreaterThanOrEquals 100 BoolEquals: --advanced-filter data.property3 BoolEquals true Multiple advanced filters can specified by multiple --advanced-filter advanced filters.

--azure-active-directory-application-id-or-uri

用于获取访问令牌的 Azure Active Directory 应用程序 ID 或 URI,该令牌将作为持有者令牌包含在传递请求中。 仅适用于 Webhook 作为目标。

--azure-active-directory-tenant-id

用于获取将作为传递请求中的持有者令牌包含的访问令牌的 Azure Active Directory 租户 ID。 仅适用于 Webhook 作为目标。

--deadletter-endpoint

Azure 存储 Blob 容器目标的 Azure 资源 ID,其中 EventGrid 应为此事件订阅删除无法传送的事件。

示例:--deadletter-endpoint /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft。存储/storageAccounts/sa1/blobServices/default/containers/containerName。

--deadletter-identity

死信目标资源的标识类型。

接受的值: systemassigned
--deadletter-identity-endpoint

Azure 存储 blob 容器目标的 Azure 资源 ID,其中 EventGrid 应为此事件订阅死掉无法传送的事件。

--delivery-identity

传递目标资源的标识类型(例如存储队列或事件中心)。

接受的值: systemassigned
--delivery-identity-endpoint

具有 EventGrid 应提供匹配此事件订阅的事件的标识的终结点。 对于 Webhook 终结点类型,应为相应的 Webhook URL。 对于其他终结点类型,这应该是终结点的 Azure 资源标识符。

--delivery-identity-endpoint-type

具有资源标识的目标终结点的类型。

接受的值: azurefunction, eventhub, hybridconnection, servicebusqueue, servicebustopic, storagequeue, webhook
--endpoint

EventGrid 应提供匹配此事件订阅的事件的终结点。 对于 Webhook 终结点类型,应为相应的 Webhook URL。 对于其他终结点类型,这应该是终结点的 Azure 资源标识符。

--endpoint-type

目标终结点的类型。

接受的值: azurefunction, eventhub, hybridconnection, servicebusqueue, servicebustopic, storagequeue, webhook
默认值: webhook
--event-delivery-schema

应为此事件订阅传递事件的架构。 默认情况下,事件将以发布它们的同一架构(基于相应主题的输入架构)传送。

接受的值: cloudeventschemav1_0, custominputschema, eventgridschema
--event-ttl

活动生存时间(以分钟为单位)。 必须是介于 1 和 1440 之间的数字。

默认值: 1440
--expiration-date

日期或日期/时间(UTC,例如“2018-11-30T11:59:59+00:00”或“2018-11-30”),之后事件订阅将过期。 默认情况下,事件订阅没有过期时间。

--included-event-types

事件类型的空格分隔列表。 示例:Microsoft。存储。BlobCreated Microsoft。存储。BlobDeleted。 若要订阅所有默认事件类型,请不要为此参数指定任何值。

--labels

要与此事件订阅关联的标签的空格分隔列表。

--max-delivery-attempts

最大传递尝试次数。 必须是介于 1 和 30 之间的数字。

默认值: 30
--max-events-per-batch

批处理中的最大事件数。 必须是介于 1 和 5000 之间的数字。

--preferred-batch-size-in-kilobytes

首选批大小(以 KB 为单位)。 必须是介于 1 和 1024 之间的数字。

--source-resource-id

需要向其创建事件订阅的 Azure 资源的完全限定标识符。

使用情况:--source-resource-id Azure-Resource-ID For Azure 订阅:--source-resource-id /subscriptions/{SubID} 对于资源组:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 For EventGrid 主题: --source--resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 对于存储帐户:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.存储/storageaccounts/sa1 For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1。

--subject-begins-with

一个可选字符串,用于根据前缀筛选事件订阅的事件。 不支持通配符。

--subject-case-sensitive

指定以指示是否应以区分大小写的方式比较主题字段。 如此 如果存在标志。

接受的值: false, true
默认值: False
--subject-ends-with

一个可选字符串,用于根据后缀筛选事件订阅的事件。 不支持通配符。

全局参数
--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 eventgrid event-subscription delete

删除事件订阅。

az eventgrid event-subscription delete --name
                                       [--source-resource-id]

示例

删除事件网格主题的事件订阅。

az eventgrid event-subscription delete --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1

删除事件网格域主题的事件订阅。

az eventgrid event-subscription delete --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/domain1/topics/topic1

删除事件网格域的事件订阅。

az eventgrid event-subscription delete --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/domain1

删除 Azure 订阅的事件订阅。

az eventgrid event-subscription delete --name es2 \
    --source-resource-id /subscriptions/{SubID}

删除资源组的事件订阅。

az eventgrid event-subscription delete --name es3 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}

删除存储帐户的事件订阅。

az eventgrid event-subscription delete --name es3 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/microsoft.storage/storageaccounts/kalsegblob

必需参数

--name -n

事件订阅的名称。

可选参数

--source-resource-id

需要删除其事件订阅的 Azure 资源的完全限定标识符。

使用情况:--source-resource-id Azure-Resource-ID For Azure 订阅:--source-resource-id /subscriptions/{SubID} 对于资源组:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 For EventGrid 主题: --source--resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 对于存储帐户:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.存储/storageaccounts/sa1 For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1。

全局参数
--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 eventgrid event-subscription delete (eventgrid 扩展)

预览

命令组“az eventgrid”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

删除事件订阅。

az eventgrid event-subscription delete --name
                                       [--source-resource-id]

示例

删除事件网格主题的事件订阅。

az eventgrid event-subscription delete --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1

删除事件网格域主题的事件订阅。

az eventgrid event-subscription delete --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/domain1/topics/topic1

删除事件网格域的事件订阅。

az eventgrid event-subscription delete --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/domain1

删除 Azure 订阅的事件订阅。

az eventgrid event-subscription delete --name es2 \
    --source-resource-id /subscriptions/{SubID}

删除资源组的事件订阅。

az eventgrid event-subscription delete --name es3 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}

删除存储帐户的事件订阅。

az eventgrid event-subscription delete --name es3 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/microsoft.storage/storageaccounts/kalsegblob

必需参数

--name -n

事件订阅的名称。

可选参数

--source-resource-id

需要删除其事件订阅的 Azure 资源的完全限定标识符。

使用情况:--source-resource-id Azure-Resource-ID For Azure 订阅:--source-resource-id /subscriptions/{SubID} 对于资源组:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 For EventGrid 主题: --source--resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 对于存储帐户:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.存储/storageaccounts/sa1 For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1。

全局参数
--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 eventgrid event-subscription list

列出事件订阅。

事件网格支持区域和全局事件订阅:区域资源(如存储帐户或事件网格主题)上的事件订阅是区域性的,而全局资源(例如 Azure 订阅或资源组)上的事件订阅是全局订阅。 因此,可以通过几种不同的方式列出事件订阅:

  1. 若要按要列出其事件订阅的资源的资源 ID 列出,请指定 --source-resource-id 参数。 没有其他参数必须指定。
  2. 若要按主题类型(例如存储帐户)列出,请指定 --topic-type 参数以及 --location(例如“westus2”)参数。 对于全局主题类型(例如“Microsoft.Resources.Subscriptions”),请将位置值指定为“global”。
  3. 若要列出区域(跨所有主题类型)中的所有事件订阅,请仅指定 --location 参数。
  4. 对于上面的 #2 和 #3,若要仅按资源组进行筛选,还可以指定 --resource-group 参数。
az eventgrid event-subscription list [--location]
                                     [--odata-query]
                                     [--resource-group]
                                     [--source-resource-id]
                                     [--topic-type-name]

示例

列出为事件网格主题创建的所有事件订阅。

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1

列出为存储帐户创建的所有事件订阅。

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/kalsegblob

列出为 Azure 订阅创建的所有事件订阅。

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}

列出为资源组创建的所有事件订阅。

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}

列出事件网格域的所有事件订阅。

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1

列出事件网格域主题的所有事件订阅。

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1/topics/topic1

列出 westus2 中所有存储事件订阅(在当前选定的 Azure 订阅下)。

az eventgrid event-subscription list --topic-type Microsoft.Storage.StorageAccounts --location westus2

列出 westus2 中所有存储事件订阅(在给定资源组下)。

az eventgrid event-subscription list --topic-type Microsoft.Storage.StorageAccounts --location westus2 --resource-group {RG}

列出所有区域或全局事件订阅(在当前选定的 Azure 订阅下)。

az eventgrid event-subscription list --location westus2
az eventgrid event-subscription list --location global

列出指定资源组下的所有区域或全局事件订阅。

az eventgrid event-subscription list --location westus2 --resource-group {RG}
az eventgrid event-subscription list --location global --resource-group {RG}

列出名称包含模式“XYZ”的事件网格域的所有事件订阅

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1 --odata-query "Contains(name, 'XYZ')"

列出事件网格域的所有事件订阅,名称为“name1”的事件订阅除外

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1 --odata-query "NOT (name eq 'name1')"

可选参数

--location -l

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

--odata-query

用于筛选列表结果的 OData 查询。 目前仅允许对 Name 属性进行筛选。 支持的操作包括:CONTAINS、eq(等于)、ne(不等于)、AND、OR 和 NOT。

--resource-group -g

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

--source-resource-id

需要列出其事件订阅的 Azure 资源的完全限定标识符。

使用情况:--source-resource-id Azure-Resource-ID For Azure 订阅:--source-resource-id /subscriptions/{SubID} 对于资源组:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 For EventGrid 主题: --source--resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 对于存储帐户:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.存储/storageaccounts/sa1 For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1。

--topic-type-name

需要列出其事件订阅的主题类型的名称。 指定此项后,还必须指定 --location。

示例 1:列出 WestUS2 --resource-group TestRG --topic-type-name Microsoft.存储 中的所有存储事件订阅。存储Accounts --location westus2 示例 2:列出 Azure 订阅上的所有事件订阅 --topic-type-name Microsoft.Resources.Subscriptions --location global。

全局参数
--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 eventgrid event-subscription list (eventgrid 扩展)

预览

命令组“az eventgrid”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

列出事件订阅。

事件网格支持区域和全局事件订阅:区域资源(如存储帐户或事件网格主题)上的事件订阅是区域性的,而全局资源(例如 Azure 订阅或资源组)上的事件订阅是全局订阅。 因此,可以通过几种不同的方式列出事件订阅:

  1. 若要按要列出其事件订阅的资源的资源 ID 列出,请指定 --source-resource-id 参数。 没有其他参数必须指定。
  2. 若要按主题类型(例如存储帐户)列出,请指定 --topic-type 参数以及 --location(例如“westus2”)参数。 对于全局主题类型(例如“Microsoft.Resources.Subscriptions”),请将位置值指定为“global”。
  3. 若要列出区域(跨所有主题类型)中的所有事件订阅,请仅指定 --location 参数。
  4. 对于上面的 #2 和 #3,若要仅按资源组进行筛选,还可以指定 --resource-group 参数。
az eventgrid event-subscription list [--location]
                                     [--odata-query]
                                     [--resource-group]
                                     [--source-resource-id]
                                     [--topic-type-name]

示例

列出为事件网格主题创建的所有事件订阅。

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1

列出为存储帐户创建的所有事件订阅。

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/kalsegblob

列出为 Azure 订阅创建的所有事件订阅。

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}

列出为资源组创建的所有事件订阅。

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}

列出事件网格域的所有事件订阅。

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1

列出事件网格域主题的所有事件订阅。

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1/topics/topic1

列出 westus2 中所有存储事件订阅(在当前选定的 Azure 订阅下)。

az eventgrid event-subscription list --topic-type Microsoft.Storage.StorageAccounts --location westus2

列出 westus2 中所有存储事件订阅(在给定资源组下)。

az eventgrid event-subscription list --topic-type Microsoft.Storage.StorageAccounts --location westus2 --resource-group {RG}

列出所有区域或全局事件订阅(在当前选定的 Azure 订阅下)。

az eventgrid event-subscription list --location westus2
az eventgrid event-subscription list --location global

列出指定资源组下的所有区域或全局事件订阅。

az eventgrid event-subscription list --location westus2 --resource-group {RG}
az eventgrid event-subscription list --location global --resource-group {RG}

列出名称包含模式“XYZ”的事件网格域的所有事件订阅

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1 --odata-query "Contains(name, 'XYZ')"

列出事件网格域的所有事件订阅,名称为“name1”的事件订阅除外

az eventgrid event-subscription list --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/domains/d1 --odata-query "NOT (name eq 'name1')"

可选参数

--location -l

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

--odata-query

用于使用 OData 语法筛选结果的查询。

--resource-group -g

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

--source-resource-id

需要列出其事件订阅的 Azure 资源的完全限定标识符。

使用情况:--source-resource-id Azure-Resource-ID For Azure 订阅:--source-resource-id /subscriptions/{SubID} 对于资源组:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 For EventGrid 主题: --source--resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 对于存储帐户:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.存储/storageaccounts/sa1 For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1。

--topic-type-name

需要列出其事件订阅的主题类型的名称。 指定此项后,还必须指定 --location。

示例 1:列出 WestUS2 --resource-group TestRG --topic-type-name Microsoft.存储 中的所有存储事件订阅。存储Accounts --location westus2 示例 2:列出 Azure 订阅上的所有事件订阅 --topic-type-name Microsoft.Resources.Subscriptions --location global。

全局参数
--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 eventgrid event-subscription show

获取事件订阅的详细信息。

az eventgrid event-subscription show --name
                                     [--include-attrib-secret {false, true}]
                                     [--include-full-endpoint-url {false, true}]
                                     [--source-resource-id]

示例

显示事件网格主题的事件订阅的详细信息。

az eventgrid event-subscription show --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/topic1

显示 Azure 订阅的事件订阅的详细信息。

az eventgrid event-subscription show --name es2 \
    --source-resource-id /subscriptions/{SubID}

显示资源组的事件订阅的详细信息。

az eventgrid event-subscription show --name es3 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1

显示存储帐户的事件订阅的详细信息。

az eventgrid event-subscription show --name es3 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/microsoft.storage/storageaccounts/kalsegblob

显示资源组的事件订阅的详细信息,包括任何静态传递属性机密。

az eventgrid event-subscription show --name es3 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 \
    --include-static-delivery-attribute-secret

必需参数

--name -n

事件订阅的名称。

可选参数

--include-attrib-secret --include-static-delivery-attribute-secret

指示是否应返回任何静态传递属性机密。 如此 如果存在标志。

接受的值: false, true
默认值: False
--include-full-endpoint-url

指定以指示是否应返回完整的终结点 URL。 如此 如果存在标志。

接受的值: false, true
默认值: False
--source-resource-id

需要显示其事件订阅的 Azure 资源的完全限定标识符。

使用情况:--source-resource-id Azure-Resource-ID For Azure 订阅:--source-resource-id /subscriptions/{SubID} 对于资源组:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 For EventGrid 主题: --source--resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 对于存储帐户:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.存储/storageaccounts/sa1 For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1。

全局参数
--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 eventgrid event-subscription show (eventgrid 扩展)

预览

命令组“az eventgrid”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

获取事件订阅的详细信息。

az eventgrid event-subscription show --name
                                     [--include-full-endpoint-url {false, true}]
                                     [--source-resource-id]

示例

显示事件网格主题的事件订阅的详细信息。

az eventgrid event-subscription show --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/topic1

显示 Azure 订阅的事件订阅的详细信息。

az eventgrid event-subscription show --name es2 \
    --source-resource-id /subscriptions/{SubID}

显示资源组的事件订阅的详细信息。

az eventgrid event-subscription show --name es3 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1

显示存储帐户的事件订阅的详细信息。

az eventgrid event-subscription show --name es3 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/microsoft.storage/storageaccounts/kalsegblob

必需参数

--name -n

事件订阅的名称。

可选参数

--include-full-endpoint-url

指定以指示是否应返回完整的终结点 URL。 如此 如果存在标志。

接受的值: false, true
默认值: False
--source-resource-id

需要显示其事件订阅的 Azure 资源的完全限定标识符。

使用情况:--source-resource-id Azure-Resource-ID For Azure 订阅:--source-resource-id /subscriptions/{SubID} 对于资源组:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 For EventGrid 主题: --source--resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 对于存储帐户:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.存储/storageaccounts/sa1 For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1。

全局参数
--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 eventgrid event-subscription update

更新事件订阅。

az eventgrid event-subscription update --name
                                       [--add]
                                       [--advanced-filter]
                                       [--deadletter-endpoint]
                                       [--deadletter-identity {systemassigned}]
                                       [--deadletter-identity-endpoint]
                                       [--delivery-attribute-mapping]
                                       [--delivery-identity {systemassigned}]
                                       [--delivery-identity-endpoint]
                                       [--delivery-identity-endpoint-type {azurefunction, eventhub, hybridconnection, servicebusqueue, servicebustopic, storagequeue, webhook}]
                                       [--enable-advanced-filtering-on-arrays {false, true}]
                                       [--endpoint]
                                       [--endpoint-type]
                                       [--force-string]
                                       [--included-event-types]
                                       [--labels]
                                       [--qttl]
                                       [--remove]
                                       [--set]
                                       [--source-resource-id]
                                       [--subject-begins-with]
                                       [--subject-ends-with]

示例

更新事件网格主题的事件订阅以指定新的终结点。

az eventgrid event-subscription update --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code

更新 Azure 订阅的事件订阅,以指定具有筛选器的新主题端。

az eventgrid event-subscription update --name es2 \
    --source-resource-id /subscriptions/{SubID} \
    --subject-ends-with .jpg

更新资源组的事件订阅,以指定新的终结点和具有筛选器的新主题端。

az eventgrid event-subscription update --name es3 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG} \
    --subject-ends-with .png \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code

更新存储帐户的事件订阅,以指定包含的事件类型的新列表。

az eventgrid event-subscription update --name es3 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/microsoft.storage/storageaccounts/kalsegblob" \
    --included-event-types Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted

更新存储帐户的事件订阅,以包含死信目标。

az eventgrid event-subscription update --name es2 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/kalsegblob" \
    --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/blobcontainer1

使用高级筛选器更新存储帐户的事件订阅。

az eventgrid event-subscription update --name es3 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/s1" \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code
    --advanced-filter data.blobType StringIn BlockBlob
    --advanced-filter data.url StringBeginsWith https://myaccount.blob.core.windows.net

更新存储帐户的事件订阅,以包含设置为 5 分钟的消息 ttl。

az eventgrid event-subscription update --name es2 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/kalsegblob" \
    --storage-queue-msg-ttl 300

使用在数组上启用高级筛选更新事件订阅

az eventgrid event-subscription update --name es2 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/kalsegblob" \
    --enable-advanced-filtering-on-arrays true

必需参数

--name -n

事件订阅的名称。

可选参数

--add

通过指定路径和键值对将对象添加到对象列表。 示例:--add property.listProperty <key=value, string or JSON string>

默认值: []
--advanced-filter

高级筛选器允许基于特定事件属性筛选事件。

用法:--advanced-filter KEY[.INNERKEY] FILTEROPERATOR 值 [VALUE ...]StringIn:--advanced-filter 数据。颜色 StringIn 蓝色红色橙色黄色 StringNotIn:--advanced-filter 数据。Color StringNotIn Blue Red Orange Yellow StringContains: --advanced-filter subject StringContains Blue Red StringNotContains: --advanced-filter subject StringNotContains Blue Red StringBeginsWith: --advanced-filter subject StringBeginsWith Blue Red StringNotBeginsWith: --advanced-filter subject StringNotBeginsWith Blue Red StringEndsWith: --advanced-filter subject StringEndsWith img png jpg StringNotEndsWith: --advanced-filter subject StringNotEndsWith img png jpg NumberIn: --advanced-filterdata.property1 NumberIn 5 10 20 NumberInRange --advanced-filter data.property1 NumberInRange 5,10 20,30 40,50 NumberNotIn: --advanced-filter data.property2 NumberNotIn 100 200 300 NumberNotInRange: --advanced-filter data.property2 NumberNotInRange 100,110 200,210 300,310 NumberLessThan: --advanced-filter data.property3 NumberLessThan 100 NumberLessThanOrEquals: --advanced-filter data.property2 NumberLessThanOrEquals 100 NumberGreaterThan: --advanced-filter data.property3NumberGreaterThan 100 NumberGreaterThanOrEquals: --advanced-filter data.property2 NumberGreaterThanOrEquals 100 BoolEquals: --advanced-filter data.property3 BoolE true IsNullOrUndefined: --advanced-filter data.property3 IsNullOrUndefined IsNotNull: --advanced-filter data.property3 IsNotNull 多个高级筛选器可以使用多个 --advanced-filter 参数来指定。

--deadletter-endpoint

Azure 存储 Blob 容器目标的 Azure 资源 ID,其中 EventGrid 应为此事件订阅删除无法传送的事件。

--deadletter-identity
预览

死信目标资源的标识类型。

接受的值: systemassigned
--deadletter-identity-endpoint

Azure 存储 blob 容器目标的 Azure 资源 ID,其中 EventGrid 应为此事件订阅死掉无法传送的事件。

--delivery-attribute-mapping

添加传递属性映射,以在传递事件时通过 HTTP 标头发送其他信息。 此属性适用于所有目标类型,存储Queue 除外。 可以使用多个 --delivery-attribute-mapping 参数来指定多个属性。

用法:--delivery-attribute-mapping attribute-name attribute-type attribute-value [attribute-is-secret] Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue false Static Attribute Mapping: --delivery-attribute-mapping somename static somevalue true Dynamic Attribute Mapping: --delivery-attribute-mapping somename dynamic somevalue Both Static and Dynamic: --delivery-attribute-mapping somename dynamic somevalue --delivery-attribute-mapping somename2 static somevalue.

--delivery-identity
预览

传递目标资源的标识类型(例如存储队列或事件中心)。

接受的值: systemassigned
--delivery-identity-endpoint
预览

具有 EventGrid 应提供匹配此事件订阅的事件的标识的终结点。 对于 Webhook 终结点类型,应为相应的 Webhook URL。 对于其他终结点类型,这应该是终结点的 Azure 资源标识符。

--delivery-identity-endpoint-type
预览

具有资源标识的目标终结点的类型。

接受的值: azurefunction, eventhub, hybridconnection, servicebusqueue, servicebustopic, storagequeue, webhook
--enable-advanced-filtering-on-arrays --enable-af-arr

允许针对值数组(而不是期望一个单一值)评估高级筛选器。

接受的值: false, true
--endpoint

EventGrid 应提供匹配此事件订阅的事件的终结点。 对于 Webhook 终结点类型,应为相应的 Webhook URL。 对于其他终结点类型,这应该是终结点的 Azure 资源标识符。 预期目标终结点已在执行任何事件网格命令之前创建并可供使用。

--endpoint-type

目标终结点的类型。

默认值: webhook
--force-string

使用“set”或“add”时,保留字符串文本,而不是尝试转换为 JSON。

默认值: False
--included-event-types

事件类型的空格分隔列表(例如 Microsoft.存储)。BlobCreated 和 Microsoft。存储。BlobDeleted)。 若要订阅所有默认事件类型,请不要为此参数指定任何值。 对于事件网格主题,事件类型是客户定义的。 对于 Azure 事件,例如存储帐户、IoT 中心等,可以使用此 CLI 命令“az eventgrid topic-type list-event-types”查询其事件类型。

--labels

要与此事件订阅关联的标签的空格分隔列表。

--qttl --storage-queue-msg-ttl

存储队列消息生存时间(以秒为单位)。

--remove

从列表中删除属性或元素。 示例: --remove property.list <indexToRemove> OR --remove propertyToRemove.

默认值: []
--set

通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=<value>

默认值: []
--source-resource-id

需要更新其事件订阅的 Azure 资源的完全限定标识符。

使用情况:--source-resource-id Azure-Resource-ID For Azure 订阅:--source-resource-id /subscriptions/{SubID} 对于资源组:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 For EventGrid 主题: --source--resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 对于存储帐户:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.存储/storageaccounts/sa1 For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1。

--subject-begins-with

一个可选字符串,用于根据前缀筛选事件订阅的事件。 不支持通配符。

--subject-ends-with

一个可选字符串,用于根据后缀筛选事件订阅的事件。 不支持通配符。

全局参数
--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 eventgrid event-subscription update (eventgrid 扩展)

预览

命令组“az eventgrid”处于预览状态,正在开发中。 参考和支持级别: https://aka.ms/CLI_refstatus

更新事件订阅。

az eventgrid event-subscription update --name
                                       [--add]
                                       [--advanced-filter]
                                       [--deadletter-endpoint]
                                       [--deadletter-identity {systemassigned}]
                                       [--deadletter-identity-endpoint]
                                       [--delivery-identity {systemassigned}]
                                       [--delivery-identity-endpoint]
                                       [--delivery-identity-endpoint-type {azurefunction, eventhub, hybridconnection, servicebusqueue, servicebustopic, storagequeue, webhook}]
                                       [--endpoint]
                                       [--endpoint-type {azurefunction, eventhub, hybridconnection, servicebusqueue, servicebustopic, storagequeue, webhook}]
                                       [--force-string]
                                       [--included-event-types]
                                       [--labels]
                                       [--remove]
                                       [--set]
                                       [--source-resource-id]
                                       [--subject-begins-with]
                                       [--subject-ends-with]

示例

更新事件网格主题的事件订阅以指定新的终结点。

az eventgrid event-subscription update --name es1 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.EventGrid/topics/topic1 \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code

更新 Azure 订阅的事件订阅,以指定具有筛选器的新主题端。

az eventgrid event-subscription update --name es2 \
    --source-resource-id /subscriptions/{SubID} \
    --subject-ends-with .jpg

更新资源组的事件订阅,以指定新的终结点和具有筛选器的新主题端。

az eventgrid event-subscription update --name es3 \
    --source-resource-id /subscriptions/{SubID}/resourceGroups/{RG} \
    --subject-ends-with .png \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code

更新存储帐户的事件订阅,以指定包含的事件类型的新列表。

az eventgrid event-subscription update --name es3 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/microsoft.storage/storageaccounts/kalsegblob" \
    --included-event-types Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted

更新存储帐户的事件订阅,以包含死信目标。

az eventgrid event-subscription update --name es2 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/kalsegblob" \
    --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/blobcontainer1

使用高级筛选器更新存储帐户的事件订阅。

az eventgrid event-subscription update --name es3 \
    --source-resource-id "/subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Storage/storageaccounts/s1" \
    --endpoint https://contoso.azurewebsites.net/api/f1?code=code
    --advanced-filter data.blobType StringIn BlockBlob
    --advanced-filter data.url StringBeginsWith https://myaccount.blob.core.windows.net

必需参数

--name -n

事件订阅的名称。

可选参数

--add

通过指定路径和键值对将对象添加到对象列表。 示例:--add property.listProperty <key=value, string or JSON string>

默认值: []
--advanced-filter

高级筛选器允许基于特定事件属性筛选事件。

用法:--advanced-filter KEY[.INNERKEY] FILTEROPERATOR 值 [VALUE ...]StringIn:--advanced-filter 数据。颜色 StringIn 蓝色红色橙色黄色 StringNotIn:--advanced-filter 数据。Color StringNotIn Blue Red Orange Yellow StringContains: --advanced-filter subject StringContains Blue Red StringBeginsWith: --advanced-filter subject StringBeginsWith Blue StringEndsWith: --advanced-filter subject StringEndsWith img png jpg NumberIn: --advanced--filter subject StringEndsWith filter data.property1 NumberIn 5 10 20 NumberNotIn: --advanced-filter data.property2 NumberNotIn 100 200 300 NumberLessThan: --advanced-filter data.property3 NumberLessThan 100 NumberLessThanOrEquals: --advanced-filterdata.property2 NumberLessThanOrEquals 100 NumberGreaterThan: --advanced-filter data.property3 NumberGreaterThan 100 NumberGreaterThanOrEquals: --advanced-filter data.property2 NumberGreaterThanOrEquals 100 BoolEquals: --advanced-filter data.property3 BoolEquals true Multiple advanced filters can specified by multiple --advanced-filter advanced filters.

--deadletter-endpoint

Azure 存储 Blob 容器目标的 Azure 资源 ID,其中 EventGrid 应为此事件订阅删除无法传送的事件。

--deadletter-identity

死信目标资源的标识类型。

接受的值: systemassigned
--deadletter-identity-endpoint

Azure 存储 blob 容器目标的 Azure 资源 ID,其中 EventGrid 应为此事件订阅死掉无法传送的事件。

--delivery-identity

传递目标资源的标识类型(例如存储队列或事件中心)。

接受的值: systemassigned
--delivery-identity-endpoint

具有 EventGrid 应提供匹配此事件订阅的事件的标识的终结点。 对于 Webhook 终结点类型,应为相应的 Webhook URL。 对于其他终结点类型,这应该是终结点的 Azure 资源标识符。

--delivery-identity-endpoint-type

具有资源标识的目标终结点的类型。

接受的值: azurefunction, eventhub, hybridconnection, servicebusqueue, servicebustopic, storagequeue, webhook
--endpoint

EventGrid 应提供匹配此事件订阅的事件的终结点。 对于 Webhook 终结点类型,应为相应的 Webhook URL。 对于其他终结点类型,这应该是终结点的 Azure 资源标识符。

--endpoint-type

目标终结点的类型。

接受的值: azurefunction, eventhub, hybridconnection, servicebusqueue, servicebustopic, storagequeue, webhook
默认值: webhook
--force-string

使用“set”或“add”时,保留字符串文本,而不是尝试转换为 JSON。

默认值: False
--included-event-types

事件类型的空格分隔列表。 示例:Microsoft。存储。BlobCreated Microsoft。存储。BlobDeleted。 若要订阅所有默认事件类型,请不要为此参数指定任何值。

--labels

要与此事件订阅关联的标签的空格分隔列表。

--remove

从列表中删除属性或元素。 示例: --remove property.list <indexToRemove> OR --remove propertyToRemove.

默认值: []
--set

通过指定要设置的属性路径和值来更新对象。 示例:--set property1.property2=<value>

默认值: []
--source-resource-id

需要更新其事件订阅的 Azure 资源的完全限定标识符。

使用情况:--source-resource-id Azure-Resource-ID For Azure 订阅:--source-resource-id /subscriptions/{SubID} 对于资源组:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1 For EventGrid 主题: --source--resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/topics/t1 对于存储帐户:--source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.存储/storageaccounts/sa1 For EventGrid domain: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1 For EventGrid domain topic: --source-resource-id /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.EventGrid/domains/d1/topics/t1。

--subject-begins-with

一个可选字符串,用于根据前缀筛选事件订阅的事件。 不支持通配符。

--subject-ends-with

一个可选字符串,用于根据后缀筛选事件订阅的事件。 不支持通配符。

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