az eventgrid system-topic event-subscription
Note
This command group has commands that are defined in both Azure CLI and at least one extension. Install each extension to benefit from its extended capabilities. Learn more about extensions.
Manage event subscriptions of system topic.
Commands
Name | Description | Type | Status |
---|---|---|---|
az eventgrid system-topic event-subscription create |
Create a new event subscription for a system topic. |
Core | GA |
az eventgrid system-topic event-subscription create (eventgrid extension) |
Create a new event subscription for a system topic. |
Extension | Preview |
az eventgrid system-topic event-subscription delete |
Delete an event subscription of a system topic. |
Core | GA |
az eventgrid system-topic event-subscription delete (eventgrid extension) |
Delete an event subscription of a system topic. |
Extension | Preview |
az eventgrid system-topic event-subscription list |
List event subscriptions of a specific system topic. |
Core | GA |
az eventgrid system-topic event-subscription list (eventgrid extension) |
List event subscriptions of a specific system topic. |
Extension | Preview |
az eventgrid system-topic event-subscription show |
Get the details of an event subscription of a system topic. |
Core | GA |
az eventgrid system-topic event-subscription show (eventgrid extension) |
Get the details of an event subscription of a system topic. |
Extension | Preview |
az eventgrid system-topic event-subscription update |
Update an event subscription of a system topic. |
Core | GA |
az eventgrid system-topic event-subscription update (eventgrid extension) |
Update an event subscription of a system topic. |
Extension | Preview |
az eventgrid system-topic event-subscription create
Create a new event subscription for a system topic.
az eventgrid system-topic event-subscription create --name
--resource-group
--system-topic-name
[--aad-tenant-id]
[--advanced-filter]
[--azure-active-directory-application-id-or-uri]
[--deadletter-endpoint]
[--delivery-attribute-mapping]
[--enable-advanced-filtering-on-arrays {false, true}]
[--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]
[--qttl]
[--subject-begins-with]
[--subject-case-sensitive {false, true}]
[--subject-ends-with]
Examples
Create a new event subscription for an Event Grid system topic, using default filters.
az eventgrid system-topic event-subscription create --name es1 \
-g rg1 --system-topic-name systemtopic1 \
--endpoint https://contoso.azurewebsites.net/api/f1?code=code
Create a new event subscription for an Event Grid system topic, with a filter specifying a subject prefix.
az eventgrid system-topic event-subscription create --name es4 \
-g rg1 --system-topic-name systemtopic1 \
--endpoint https://contoso.azurewebsites.net/api/f1?code=code \
--subject-begins-with mysubject_prefix
Create a new event subscription for an Event Grid system topic, using default filters, and CloudEvent V 1.0 as the delivery schema.
az eventgrid system-topic event-subscription create -n es2 \
-g rg1 --system-topic-name systemtopic1 \
--endpoint https://contoso.azurewebsites.net/api/f1?code=code \
--event-delivery-schema cloudeventschemav1_0
Create a new event subscription for an Event Grid system topic, with a deadletter destination and custom retry policy of maximum 10 delivery attempts and an Event TTL of 2 hours (whichever happens earlier) and expiration date.
az eventgrid system-topic event-subscription create --name es2 \
-g rg1 --system-topic-name systemtopic1 \
--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 --expiration-date "2022-10-31"
Create a new event subscription for an Event Grid system topic, using Azure Active Directory enabled Webhook as a destination .
az eventgrid system-topic event-subscription create --name es1 \
-g rg1 --system-topic-name systemtopic1 \
--endpoint https://contoso.azurewebsites.net/api/f1?code=code
--azure-active-directory-tenant-id azureactivedirectorytenantid
--azure-active-directory-application-id-or-uri azureactivedirectoryapplicationidoruri
Create a new event subscription for an Event Grid system topic, using Azure Function as destination.
az eventgrid system-topic event-subscription create -n es1 \
-g rg1 --system-topic-name systemtopic1 \
--endpoint /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Web/sites/{functionappname}/functions/{functionname} --endpoint-type azurefunction
Create a new event subscription for an Event Grid system topic using Storage Queue as destination with a ttl of 5 mins
az eventgrid system-topic event-subscription create -n es1 \
-g rg1 --system-topic-name systemtopic1 \
--endpoint-type storagequeue \
--endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/queueservices/default/queues/q1 \
--storage-queue-msg-ttl 300
Create a new event subscription for an Event Grid system topic and enable advanced filtering on arrays
az eventgrid system-topic event-subscription create -n es1 \
-g rg1 --system-topic-name systemtopic1 \
--endpoint /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Web/sites/{functionappname}/functions/{functionname} --endpoint-type azurefunction \
--enable-advanced-filtering-on-arrays true
Required Parameters
Name of the event subscription.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the system topic.
Optional Parameters
The Azure Active Directory Tenant Id to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination.
An advanced filter enables filtering of events based on a specific event property.
Usage: --advanced-filter KEY[.INNERKEY] FILTEROPERATOR VALUE [VALUE ...]
StringIn: --advanced-filter data.Color StringIn Blue Red Orange Yellow
StringNotIn: --advanced-filter data.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-filter data.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.property3 NumberGreaterThan 100
NumberGreaterThanOrEquals: --advanced-filter data.property2 NumberGreaterThanOrEquals 100
BoolEquals: --advanced-filter data.property3 BoolEquals true
IsNullOrUndefined: --advanced-filter data.property3 IsNullOrUndefined
IsNotNull: --advanced-filter data.property3 IsNotNull
Multiple advanced filters can be specified by using more than one --advanced-filter
argument.
The Azure Active Directory Application Id or Uri to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination.
The Azure resource ID of an Azure Storage blob container destination where EventGrid should deadletter undeliverable events for this event subscription.
Example: --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/containerName.
Add delivery attribute mapping to send additional information via HTTP headers when delivering events. This attribute is valid for all destination types except StorageQueue. Multiple attributes can be specified by using more than one --delivery-attribute-mapping
argument.
Usage: --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.
Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.
Endpoint where EventGrid should deliver events matching this event subscription. For webhook endpoint type, this should be the corresponding webhook URL. For other endpoint types, this should be the Azure resource identifier of the endpoint. It is expected that the destination endpoint to be already created and available for use before executing any Event Grid command.
The type of the destination endpoint.
The schema in which events should be delivered for this event subscription. By default, events will be delivered in the same schema in which they are published (based on the corresponding topic's input schema).
Event time to live (in minutes). Must be a number between 1 and 1440.
Date or datetime (in UTC, e.g. '2018-11-30T11:59:59+00:00' or '2018-11-30') after which the event subscription would expire. By default, there is no expiration for the event subscription.
A space-separated list of event types (e.g., Microsoft.Storage.BlobCreated and Microsoft.Storage.BlobDeleted). In order to subscribe to all default event types, do not specify any value for this argument. For event grid topics, event types are customer defined. For Azure events, e.g., Storage Accounts, IoT Hub, etc., you can query their event types using this CLI command 'az eventgrid topic-type list-event-types'.
A space-separated list of labels to associate with this event subscription.
Maximum number of delivery attempts. Must be a number between 1 and 30.
Maximum number of events in a batch. Must be a number between 1 and 5000.
Preferred batch size in kilobytes. Must be a number between 1 and 1024.
Storage queue message time to live in seconds.
An optional string to filter events for an event subscription based on a prefix. Wildcard characters are not supported.
Specify to indicate whether the subject fields should be compared in a case sensitive manner. True if flag present.
An optional string to filter events for an event subscription based on a suffix. Wildcard characters are not supported.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az eventgrid system-topic event-subscription create (eventgrid extension)
Command group 'az eventgrid' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Create a new event subscription for a system topic.
az eventgrid system-topic event-subscription create --name
--resource-group
--system-topic-name
[--advanced-filter]
[--azure-active-directory-application-id-or-uri]
[--azure-active-directory-tenant-id]
[--deadletter-endpoint]
[--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]
[--subject-begins-with]
[--subject-case-sensitive {false, true}]
[--subject-ends-with]
Examples
Create a new event subscription for an Event Grid system topic, using default filters.
az eventgrid system-topic event-subscription create --name es1 \
-g rg1 --system-topic-name systemtopic1 \
--endpoint https://contoso.azurewebsites.net/api/f1?code=code
Create a new event subscription for an Event Grid system topic, with a filter specifying a subject prefix.
az eventgrid system-topic event-subscription create --name es4 \
-g rg1 --system-topic-name systemtopic1 \
--endpoint https://contoso.azurewebsites.net/api/f1?code=code \
--subject-begins-with mysubject_prefix
Create a new event subscription for an Event Grid system topic, using default filters, and CloudEvent V 1.0 as the delivery schema.
az eventgrid system-topic event-subscription create -n es2 \
-g rg1 --system-topic-name systemtopic1 \
--endpoint https://contoso.azurewebsites.net/api/f1?code=code \
--event-delivery-schema cloudeventschemav1_0
Create a new event subscription for an Event Grid system topic, with a deadletter destination and custom retry policy of maximum 10 delivery attempts and an Event TTL of 2 hours (whichever happens earlier) and expiration date.
az eventgrid system-topic event-subscription create --name es2 \
-g rg1 --system-topic-name systemtopic1 \
--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 --expiration-date "2022-10-31"
Create a new event subscription for an Event Grid system topic, using Azure Active Directory enabled Webhook as a destination .
az eventgrid system-topic event-subscription create --name es1 \
-g rg1 --system-topic-name systemtopic1 \
--endpoint https://contoso.azurewebsites.net/api/f1?code=code
--azure-active-directory-tenant-id azureactivedirectorytenantid
--azure-active-directory-application-id-or-uri azureactivedirectoryapplicationidoruri
Create a new event subscription for an Event Grid system topic, using Azure Function as destination.
az eventgrid system-topic event-subscription create -n es1 \
-g rg1 --system-topic-name systemtopic1 \
--endpoint /subscriptions/{SubID}/resourceGroups/{RG}/providers/Microsoft.Web/sites/{functionappname}/functions/{functionname} --endpoint-type azurefunction
Required Parameters
Name of the event subscription.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the system topic.
Optional Parameters
An advanced filter enables filtering of events based on a specific event property.
Usage: --advanced-filter KEY[.INNERKEY] FILTEROPERATOR VALUE [VALUE ...]
StringIn: --advanced-filter data.Color StringIn Blue Red Orange Yellow
StringNotIn: --advanced-filter data.Color StringNotIn Blue Red Orange Yellow
StringContains: --advanced-filter subject StringContains Blue Red
StringBeginsWith: --advanced-filter subject StringBeginsWith Blue Red
StringEndsWith: --advanced-filter subject StringEndsWith img png jpg
NumberIn: --advanced-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-filter data.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 be specified by using more than one --advanced-filter
argument.
The Azure Active Directory Application Id or Uri to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination.
The Azure Active Directory Tenant Id to get the access token that will be included as the bearer token in delivery requests. Applicable only for webhook as a destination.
The Azure resource ID of an Azure Storage blob container destination where EventGrid should deadletter undeliverable events for this event subscription.
Example: --deadletter-endpoint /subscriptions/{SubID}/resourceGroups/rg1/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/containerName.
Endpoint where EventGrid should deliver events matching this event subscription. For webhook endpoint type, this should be the corresponding webhook URL. For other endpoint types, this should be the Azure resource identifier of the endpoint.
The type of the destination endpoint.
The schema in which events should be delivered for this event subscription. By default, events will be delivered in the same schema in which they are published (based on the corresponding topic's input schema).
Event time to live (in minutes). Must be a number between 1 and 1440.
Date or datetime (in UTC, e.g. '2018-11-30T11:59:59+00:00' or '2018-11-30') after which the event subscription would expire. By default, there is no expiration for the event subscription.
A space-separated list of event types. Example: Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted. To subscribe to all default event types, do not specify any value for this argument.
A space-separated list of labels to associate with this event subscription.
Maximum number of delivery attempts. Must be a number between 1 and 30.
Maximum number of events in a batch. Must be a number between 1 and 5000.
Preferred batch size in kilobytes. Must be a number between 1 and 1024.
An optional string to filter events for an event subscription based on a prefix. Wildcard characters are not supported.
Specify to indicate whether the subject fields should be compared in a case sensitive manner. True if flag present.
An optional string to filter events for an event subscription based on a suffix. Wildcard characters are not supported.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az eventgrid system-topic event-subscription delete
Delete an event subscription of a system topic.
az eventgrid system-topic event-subscription delete --name
--resource-group
--system-topic-name
[--yes]
Examples
Delete an event subscription for an Event Grid system topic.
az eventgrid system-topic event-subscription delete --name es1 \
-g rg1 --system-topic-name systemtopic1 \
Required Parameters
Name of the event subscription.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the system topic.
Optional Parameters
Do not prompt for confirmation.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az eventgrid system-topic event-subscription delete (eventgrid extension)
Command group 'az eventgrid' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Delete an event subscription of a system topic.
az eventgrid system-topic event-subscription delete --name
--resource-group
--system-topic-name
Examples
Delete an event subscription for an Event Grid system topic.
az eventgrid system-topic event-subscription delete --name es1 \
-g rg1 --system-topic-name systemtopic1 \
Required Parameters
Name of the event subscription.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the system topic.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az eventgrid system-topic event-subscription list
List event subscriptions of a specific system topic.
az eventgrid system-topic event-subscription list --resource-group
--system-topic-name
[--odata-query]
Examples
List all event subscriptions created for an Event Grid system topic.
az eventgrid system-topic event-subscription list -g rg1 --system-topic-name systemtopic1
Required Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the system topic.
Optional Parameters
The OData query used for filtering the list results. Filtering is currently allowed on the Name property only. The supported operations include: CONTAINS, eq (for equal), ne (for not equal), AND, OR and NOT.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az eventgrid system-topic event-subscription list (eventgrid extension)
Command group 'az eventgrid' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
List event subscriptions of a specific system topic.
az eventgrid system-topic event-subscription list --resource-group
--system-topic-name
[--odata-query]
Examples
List all event subscriptions created for an Event Grid system topic.
az eventgrid system-topic event-subscription list -g rg1 --system-topic-name systemtopic1
Required Parameters
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the system topic.
Optional Parameters
The query used to filter the results using OData syntax.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az eventgrid system-topic event-subscription show
Get the details of an event subscription of a system topic.
az eventgrid system-topic event-subscription show --name
--resource-group
--system-topic-name
[--include-attrib-secret {false, true}]
[--include-full-endpoint-url {false, true}]
Examples
Show the details of an event subscription for an Event Grid system topic.
az eventgrid system-topic event-subscription show --name es1 \
-g rg1 --system-topic-name systemtopic1
Show the details of an event subscription for an Event Grid system topic include any static delivery attribute secrets.
az eventgrid system-topic event-subscription show --name es1 \
-g rg1 --system-topic-name systemtopic1 --include-attrib-secret
Required Parameters
Name of the event subscription.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the system topic.
Optional Parameters
Indicate whether any static delivery attribute secrets should be returned. True if flag present.
Specify to indicate whether the full endpoint URL should be returned. True if flag present.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az eventgrid system-topic event-subscription show (eventgrid extension)
Command group 'az eventgrid' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Get the details of an event subscription of a system topic.
az eventgrid system-topic event-subscription show --name
--resource-group
--system-topic-name
[--include-full-endpoint-url {false, true}]
Examples
Show the details of an event subscription for an Event Grid system topic.
az eventgrid system-topic event-subscription show --name es1 \
-g rg1 --system-topic-name systemtopic1
Required Parameters
Name of the event subscription.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the system topic.
Optional Parameters
Specify to indicate whether the full endpoint URL should be returned. True if flag present.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az eventgrid system-topic event-subscription update
Update an event subscription of a system topic.
az eventgrid system-topic event-subscription update --name
--resource-group
--system-topic-name
[--advanced-filter]
[--deadletter-endpoint]
[--delivery-attribute-mapping]
[--enable-advanced-filtering-on-arrays {false, true}]
[--endpoint]
[--endpoint-type {azurefunction, eventhub, hybridconnection, servicebusqueue, servicebustopic, storagequeue, webhook}]
[--included-event-types]
[--labels]
[--qttl]
[--subject-begins-with]
[--subject-ends-with]
Examples
Update an event subscription for an Event Grid system topic to specify a new endpoint.
az eventgrid system-topic event-subscription update --name es1 \
-g rg1 --system-topic-name systemtopic1 --endpoint https://contoso.azurewebsites.net/api/f1?code=code
Update an event subscription for an Event Grid system topic to specify a new subject-ends-with filter.
az eventgrid system-topic event-subscription update --name es2 \
-g rg1 --system-topic-name systemtopic1 \
--subject-ends-with .jpg
Update an event subscription for an Event Grid system topic to specify a new endpoint and a new subject-ends-with filter a new list of included event types.
az eventgrid system-topic event-subscription update --name es3 \
-g rg1 --system-topic-name systemtopic1 \
--subject-ends-with .png \
--endpoint https://contoso.azurewebsites.net/api/f1?code=code
--included-event-types Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted
Update an event subscription for an Azure Event Grid system topic, to include a deadletter destination.
az eventgrid system-topic event-subscription update --name es2 \
-g rg1 --system-topic-name systemtopic1 \
--deadletter-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/blobcontainer1
Update an event subscription for an Azure Event Grid system topic, using advanced filters.
az eventgrid system-topic event-subscription update --name es3 \
-g rg1 --system-topic-name systemtopic1 \
--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
Update an event subscription for an Event Grid system topic with Storage Queue as destination with ttl of 5 mins
az eventgrid system-topic event-subscription update -n es1 \
-g rg1 --system-topic-name systemtopic1 \
--storage-queue-msg-ttl 300
Update an event subscription for an Event Grid system topic with advanced filtering on arrays enabled
az eventgrid system-topic event-subscription update -n es1 \
-g rg1 --system-topic-name systemtopic1 \
--enable-advanced-filtering-on-arrays true
Required Parameters
Name of the event subscription.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the system topic.
Optional Parameters
An advanced filter enables filtering of events based on a specific event property.
Usage: --advanced-filter KEY[.INNERKEY] FILTEROPERATOR VALUE [VALUE ...]
StringIn: --advanced-filter data.Color StringIn Blue Red Orange Yellow
StringNotIn: --advanced-filter data.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-filter data.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.property3 NumberGreaterThan 100
NumberGreaterThanOrEquals: --advanced-filter data.property2 NumberGreaterThanOrEquals 100
BoolEquals: --advanced-filter data.property3 BoolEquals true
IsNullOrUndefined: --advanced-filter data.property3 IsNullOrUndefined
IsNotNull: --advanced-filter data.property3 IsNotNull
Multiple advanced filters can be specified by using more than one --advanced-filter
argument.
The Azure resource ID of an Azure Storage blob container destination where EventGrid should deadletter undeliverable events for this event subscription.
Add delivery attribute mapping to send additional information via HTTP headers when delivering events. This attribute is valid for all destination types except StorageQueue. Multiple attributes can be specified by using more than one --delivery-attribute-mapping
argument.
Usage: --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.
Allows advanced filters to be evaluated against an array of values instead of expecting a singular value.
Endpoint where EventGrid should deliver events matching this event subscription. For webhook endpoint type, this should be the corresponding webhook URL. For other endpoint types, this should be the Azure resource identifier of the endpoint. It is expected that the destination endpoint to be already created and available for use before executing any Event Grid command.
The type of the destination endpoint.
A space-separated list of event types (e.g., Microsoft.Storage.BlobCreated and Microsoft.Storage.BlobDeleted). In order to subscribe to all default event types, do not specify any value for this argument. For event grid topics, event types are customer defined. For Azure events, e.g., Storage Accounts, IoT Hub, etc., you can query their event types using this CLI command 'az eventgrid topic-type list-event-types'.
A space-separated list of labels to associate with this event subscription.
Storage queue message time to live in seconds.
An optional string to filter events for an event subscription based on a prefix. Wildcard characters are not supported.
An optional string to filter events for an event subscription based on a suffix. Wildcard characters are not supported.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
az eventgrid system-topic event-subscription update (eventgrid extension)
Command group 'az eventgrid' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus
Update an event subscription of a system topic.
az eventgrid system-topic event-subscription update --name
--resource-group
--system-topic-name
[--advanced-filter]
[--deadletter-endpoint]
[--endpoint]
[--endpoint-type {azurefunction, eventhub, hybridconnection, servicebusqueue, servicebustopic, storagequeue, webhook}]
[--included-event-types]
[--labels]
[--subject-begins-with]
[--subject-ends-with]
Examples
Update an event subscription for an Event Grid system topic to specify a new endpoint.
az eventgrid system-topic event-subscription update --name es1 \
-g rg1 --system-topic-name systemtopic1 --endpoint https://contoso.azurewebsites.net/api/f1?code=code
Update an event subscription for an Event Grid system topic to specify a new subject-ends-with filter.
az eventgrid system-topic event-subscription update --name es2 \
-g rg1 --system-topic-name systemtopic1 \
--subject-ends-with .jpg
Update an event subscription for an Event Grid system topic to specify a new endpoint and a new subject-ends-with filter a new list of included event types.
az eventgrid system-topic event-subscription update --name es3 \
-g rg1 --system-topic-name systemtopic1 \
--subject-ends-with .png \
--endpoint https://contoso.azurewebsites.net/api/f1?code=code
--included-event-types Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted
Update an event subscription for an Azure Event Grid system topic, to include a deadletter destination.
az eventgrid system-topic event-subscription update --name es2 \
-g rg1 --system-topic-name systemtopic1 \
--deadletter-endpoint /subscriptions/{SubID}/resourceGroups/TestRG/providers/Microsoft.Storage/storageAccounts/sa1/blobServices/default/containers/blobcontainer1
Update an event subscription for an Azure Event Grid system topic, using advanced filters.
az eventgrid system-topic event-subscription update --name es3 \
-g rg1 --system-topic-name systemtopic1 \
--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
Required Parameters
Name of the event subscription.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Name of the system topic.
Optional Parameters
An advanced filter enables filtering of events based on a specific event property.
Usage: --advanced-filter KEY[.INNERKEY] FILTEROPERATOR VALUE [VALUE ...]
StringIn: --advanced-filter data.Color StringIn Blue Red Orange Yellow
StringNotIn: --advanced-filter data.Color StringNotIn Blue Red Orange Yellow
StringContains: --advanced-filter subject StringContains Blue Red
StringBeginsWith: --advanced-filter subject StringBeginsWith Blue Red
StringEndsWith: --advanced-filter subject StringEndsWith img png jpg
NumberIn: --advanced-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-filter data.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 be specified by using more than one --advanced-filter
argument.
The Azure resource ID of an Azure Storage blob container destination where EventGrid should deadletter undeliverable events for this event subscription.
Endpoint where EventGrid should deliver events matching this event subscription. For webhook endpoint type, this should be the corresponding webhook URL. For other endpoint types, this should be the Azure resource identifier of the endpoint.
The type of the destination endpoint.
A space-separated list of event types. Example: Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted. To subscribe to all default event types, do not specify any value for this argument.
A space-separated list of labels to associate with this event subscription.
An optional string to filter events for an event subscription based on a prefix. Wildcard characters are not supported.
An optional string to filter events for an event subscription based on a suffix. Wildcard characters are not supported.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Azure CLI