Microsoft.EventGrid eventSubscriptions
The eventSubscriptions resource type is an extension resource, which means you can apply it to another resource.
Use the scope property on this resource to set the scope for this resource.
- For Bicep, see Set scope on extension resources in Bicep.
- For JSON, see Set scope on extension resources in ARM templates.
Valid deployment scopes for the eventSubscriptions resource are:
- Subscription
- Resource Group
Template format
To create a Microsoft.EventGrid/eventSubscriptions resource, add the following Bicep or JSON to your template.
resource symbolicname 'Microsoft.EventGrid/eventSubscriptions@2021-12-01' = {
name: 'string'
scope: resourceSymbolicName
properties: {
deadLetterDestination: {
endpointType: 'string'
// For remaining properties, see DeadLetterDestination objects
}
deadLetterWithResourceIdentity: {
deadLetterDestination: {
endpointType: 'string'
// For remaining properties, see DeadLetterDestination objects
}
identity: {
type: 'string'
userAssignedIdentity: 'string'
}
}
deliveryWithResourceIdentity: {
destination: {
endpointType: 'string'
// For remaining properties, see EventSubscriptionDestination objects
}
identity: {
type: 'string'
userAssignedIdentity: 'string'
}
}
destination: {
endpointType: 'string'
// For remaining properties, see EventSubscriptionDestination objects
}
eventDeliverySchema: 'string'
expirationTimeUtc: 'string'
filter: {
advancedFilters: [
{
key: 'string'
operatorType: 'string'
// For remaining properties, see AdvancedFilter objects
}
]
enableAdvancedFilteringOnArrays: bool
includedEventTypes: [
'string'
]
isSubjectCaseSensitive: bool
subjectBeginsWith: 'string'
subjectEndsWith: 'string'
}
labels: [
'string'
]
retryPolicy: {
eventTimeToLiveInMinutes: int
maxDeliveryAttempts: int
}
}
}
DeadLetterDestination objects
Set the endpointType property to specify the type of object.
For StorageBlob, use:
endpointType: 'StorageBlob'
properties: {
blobContainerName: 'string'
resourceId: 'string'
}
EventSubscriptionDestination objects
Set the endpointType property to specify the type of object.
For AzureFunction, use:
endpointType: 'AzureFunction'
properties: {
deliveryAttributeMappings: [
{
name: 'string'
type: 'string'
// For remaining properties, see DeliveryAttributeMapping objects
}
]
maxEventsPerBatch: int
preferredBatchSizeInKilobytes: int
resourceId: 'string'
}
For EventHub, use:
endpointType: 'EventHub'
properties: {
deliveryAttributeMappings: [
{
name: 'string'
type: 'string'
// For remaining properties, see DeliveryAttributeMapping objects
}
]
resourceId: 'string'
}
For HybridConnection, use:
endpointType: 'HybridConnection'
properties: {
deliveryAttributeMappings: [
{
name: 'string'
type: 'string'
// For remaining properties, see DeliveryAttributeMapping objects
}
]
resourceId: 'string'
}
For ServiceBusQueue, use:
endpointType: 'ServiceBusQueue'
properties: {
deliveryAttributeMappings: [
{
name: 'string'
type: 'string'
// For remaining properties, see DeliveryAttributeMapping objects
}
]
resourceId: 'string'
}
For ServiceBusTopic, use:
endpointType: 'ServiceBusTopic'
properties: {
deliveryAttributeMappings: [
{
name: 'string'
type: 'string'
// For remaining properties, see DeliveryAttributeMapping objects
}
]
resourceId: 'string'
}
For StorageQueue, use:
endpointType: 'StorageQueue'
properties: {
queueMessageTimeToLiveInSeconds: int
queueName: 'string'
resourceId: 'string'
}
For WebHook, use:
endpointType: 'WebHook'
properties: {
azureActiveDirectoryApplicationIdOrUri: 'string'
azureActiveDirectoryTenantId: 'string'
deliveryAttributeMappings: [
{
name: 'string'
type: 'string'
// For remaining properties, see DeliveryAttributeMapping objects
}
]
endpointUrl: 'string'
maxEventsPerBatch: int
preferredBatchSizeInKilobytes: int
}
DeliveryAttributeMapping objects
Set the type property to specify the type of object.
For Dynamic, use:
For Static, use:
AdvancedFilter objects
Set the operatorType property to specify the type of object.
For BoolEquals, use:
For IsNotNull, use:
For IsNullOrUndefined, use:
For NumberGreaterThan, use:
For NumberGreaterThanOrEquals, use:
For NumberIn, use:
For NumberInRange, use:
For NumberLessThan, use:
For NumberLessThanOrEquals, use:
For NumberNotIn, use:
For NumberNotInRange, use:
For StringBeginsWith, use:
For StringContains, use:
For StringEndsWith, use:
For StringIn, use:
For StringNotBeginsWith, use:
For StringNotContains, use:
For StringNotEndsWith, use:
For StringNotIn, use:
Property values
eventSubscriptions
Name | Description | Value |
---|---|---|
type | The resource type For Bicep, set this value in the resource declaration. |
'Microsoft.EventGrid/eventSubscriptions' |
apiVersion | The resource api version For Bicep, set this value in the resource declaration. |
'2021-12-01' |
name | The resource name | string (required) Character limit: 3-64 Valid characters: Alphanumerics and hyphens. |
scope | Use when creating an extension resource at a scope that is different than the deployment scope. | Target resource For Bicep, set this property to the symbolic name of the resource to apply the extension resource. For JSON, set the value to the full name of the resource to apply the extension resource to. |
properties | Properties of the Event Subscription. | EventSubscriptionProperties |
EventSubscriptionProperties
Name | Description | Value |
---|---|---|
deadLetterDestination | Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class. | DeadLetterDestination |
deadLetterWithResourceIdentity | Information about the deadletter destination with resource identity. | DeadLetterWithResourceIdentity |
deliveryWithResourceIdentity | Information about the delivery for an event subscription with resource identity. | DeliveryWithResourceIdentity |
destination | Information about the destination for an event subscription. | EventSubscriptionDestination |
eventDeliverySchema | The event delivery schema for the event subscription. | 'CloudEventSchemaV1_0' 'CustomInputSchema' 'EventGridSchema' |
expirationTimeUtc | Expiration time of the event subscription. | string |
filter | Filter for the Event Subscription. | EventSubscriptionFilter |
labels | List of user defined labels. | string[] |
retryPolicy | Information about the retry policy for an event subscription. | RetryPolicy |
DeadLetterDestination
Name | Description | Value |
---|---|---|
endpointType | Set the object type | StorageBlob |
StorageBlobDeadLetterDestination
Name | Description | Value |
---|---|---|
endpointType | Type of the endpoint for the dead letter destination | 'StorageBlob' |
properties | Properties of the storage blob based dead letter destination. | StorageBlobDeadLetterDestinationProperties |
StorageBlobDeadLetterDestinationProperties
Name | Description | Value |
---|---|---|
blobContainerName | The name of the Storage blob container that is the destination of the deadletter events | string |
resourceId | The Azure Resource ID of the storage account that is the destination of the deadletter events | string |
DeadLetterWithResourceIdentity
Name | Description | Value |
---|---|---|
deadLetterDestination | Information about the dead letter destination for an event subscription. To configure a deadletter destination, do not directly instantiate an object of this class. Instead, instantiate an object of a derived class. Currently, StorageBlobDeadLetterDestination is the only class that derives from this class. | DeadLetterDestination |
identity | The identity information with the event subscription. | EventSubscriptionIdentity |
EventSubscriptionIdentity
Name | Description | Value |
---|---|---|
type | The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove any identity. | 'SystemAssigned' 'UserAssigned' |
userAssignedIdentity | The user identity associated with the resource. | string |
DeliveryWithResourceIdentity
Name | Description | Value |
---|---|---|
destination | Information about the destination for an event subscription. | EventSubscriptionDestination |
identity | The identity information with the event subscription. | EventSubscriptionIdentity |
EventSubscriptionDestination
Name | Description | Value |
---|---|---|
endpointType | Set the object type | AzureFunction EventHub HybridConnection ServiceBusQueue ServiceBusTopic StorageQueue WebHook |
AzureFunctionEventSubscriptionDestination
Name | Description | Value |
---|---|---|
endpointType | Type of the endpoint for the event subscription destination. | 'AzureFunction' |
properties | The properties that represent the Azure Function destination of an event subscription. | AzureFunctionEventSubscriptionDestinationProperties |
AzureFunctionEventSubscriptionDestinationProperties
Name | Description | Value |
---|---|---|
deliveryAttributeMappings | Delivery attribute details. | DeliveryAttributeMapping[] |
maxEventsPerBatch | Maximum number of events per batch. | int |
preferredBatchSizeInKilobytes | Preferred batch size in Kilobytes. | int |
resourceId | The Azure Resource Id that represents the endpoint of the Azure Function destination of an event subscription. | string |
DeliveryAttributeMapping
Name | Description | Value |
---|---|---|
name | Name of the delivery attribute or header. | string |
type | Set the object type | Dynamic Static |
DynamicDeliveryAttributeMapping
Name | Description | Value |
---|---|---|
type | Type of the delivery attribute or header name. | 'Dynamic' |
properties | Properties of dynamic delivery attribute mapping. | DynamicDeliveryAttributeMappingProperties |
DynamicDeliveryAttributeMappingProperties
Name | Description | Value |
---|---|---|
sourceField | JSON path in the event which contains attribute value. | string |
StaticDeliveryAttributeMapping
Name | Description | Value |
---|---|---|
type | Type of the delivery attribute or header name. | 'Static' |
properties | Properties of static delivery attribute mapping. | StaticDeliveryAttributeMappingProperties |
StaticDeliveryAttributeMappingProperties
Name | Description | Value |
---|---|---|
isSecret | Boolean flag to tell if the attribute contains sensitive information . | bool |
value | Value of the delivery attribute. | string |
EventHubEventSubscriptionDestination
Name | Description | Value |
---|---|---|
endpointType | Type of the endpoint for the event subscription destination. | 'EventHub' |
properties | The properties for a event hub destination. | EventHubEventSubscriptionDestinationProperties |
EventHubEventSubscriptionDestinationProperties
Name | Description | Value |
---|---|---|
deliveryAttributeMappings | Delivery attribute details. | DeliveryAttributeMapping[] |
resourceId | The Azure Resource Id that represents the endpoint of an Event Hub destination of an event subscription. | string |
HybridConnectionEventSubscriptionDestination
Name | Description | Value |
---|---|---|
endpointType | Type of the endpoint for the event subscription destination. | 'HybridConnection' |
properties | The properties for a hybrid connection destination. | HybridConnectionEventSubscriptionDestinationProperties |
HybridConnectionEventSubscriptionDestinationProperties
Name | Description | Value |
---|---|---|
deliveryAttributeMappings | Delivery attribute details. | DeliveryAttributeMapping[] |
resourceId | The Azure Resource ID of an hybrid connection that is the destination of an event subscription. | string |
ServiceBusQueueEventSubscriptionDestination
Name | Description | Value |
---|---|---|
endpointType | Type of the endpoint for the event subscription destination. | 'ServiceBusQueue' |
properties | The properties that represent the Service Bus destination of an event subscription. | ServiceBusQueueEventSubscriptionDestinationProperties |
ServiceBusQueueEventSubscriptionDestinationProperties
Name | Description | Value |
---|---|---|
deliveryAttributeMappings | Delivery attribute details. | DeliveryAttributeMapping[] |
resourceId | The Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription. | string |
ServiceBusTopicEventSubscriptionDestination
Name | Description | Value |
---|---|---|
endpointType | Type of the endpoint for the event subscription destination. | 'ServiceBusTopic' |
properties | The properties that represent the Service Bus Topic destination of an event subscription. | ServiceBusTopicEventSubscriptionDestinationProperties |
ServiceBusTopicEventSubscriptionDestinationProperties
Name | Description | Value |
---|---|---|
deliveryAttributeMappings | Delivery attribute details. | DeliveryAttributeMapping[] |
resourceId | The Azure Resource Id that represents the endpoint of the Service Bus Topic destination of an event subscription. | string |
StorageQueueEventSubscriptionDestination
Name | Description | Value |
---|---|---|
endpointType | Type of the endpoint for the event subscription destination. | 'StorageQueue' |
properties | The properties for a storage queue destination. | StorageQueueEventSubscriptionDestinationProperties |
StorageQueueEventSubscriptionDestinationProperties
Name | Description | Value |
---|---|---|
queueMessageTimeToLiveInSeconds | Storage queue message time to live in seconds. | int |
queueName | The name of the Storage queue under a storage account that is the destination of an event subscription. | string |
resourceId | The Azure Resource ID of the storage account that contains the queue that is the destination of an event subscription. | string |
WebHookEventSubscriptionDestination
Name | Description | Value |
---|---|---|
endpointType | Type of the endpoint for the event subscription destination. | 'WebHook' |
properties | Information about the webhook destination properties for an event subscription. | WebHookEventSubscriptionDestinationProperties |
WebHookEventSubscriptionDestinationProperties
Name | Description | Value |
---|---|---|
azureActiveDirectoryApplicationIdOrUri | The Azure Active Directory Application ID or URI to get the access token that will be included as the bearer token in delivery requests. | string |
azureActiveDirectoryTenantId | The Azure Active Directory Tenant ID to get the access token that will be included as the bearer token in delivery requests. | string |
deliveryAttributeMappings | Delivery attribute details. | DeliveryAttributeMapping[] |
endpointUrl | The URL that represents the endpoint of the destination of an event subscription. | string |
maxEventsPerBatch | Maximum number of events per batch. | int |
preferredBatchSizeInKilobytes | Preferred batch size in Kilobytes. | int |
EventSubscriptionFilter
Name | Description | Value |
---|---|---|
advancedFilters | An array of advanced filters that are used for filtering event subscriptions. | AdvancedFilter[] |
enableAdvancedFilteringOnArrays | Allows advanced filters to be evaluated against an array of values instead of expecting a singular value. | bool |
includedEventTypes | A list of applicable event types that need to be part of the event subscription. If it is desired to subscribe to all default event types, set the IncludedEventTypes to null. | string[] |
isSubjectCaseSensitive | Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter should be compared in a case sensitive manner. |
bool |
subjectBeginsWith | An optional string to filter events for an event subscription based on a resource path prefix. The format of this depends on the publisher of the events. Wildcard characters are not supported in this path. |
string |
subjectEndsWith | An optional string to filter events for an event subscription based on a resource path suffix. Wildcard characters are not supported in this path. |
string |
AdvancedFilter
Name | Description | Value |
---|---|---|
key | The field/property in the event based on which you want to filter. | string |
operatorType | Set the object type | BoolEquals IsNotNull IsNullOrUndefined NumberGreaterThan NumberGreaterThanOrEquals NumberIn NumberInRange NumberLessThan NumberLessThanOrEquals NumberNotIn NumberNotInRange StringBeginsWith StringContains StringEndsWith StringIn StringNotBeginsWith StringNotContains StringNotEndsWith StringNotIn |
BoolEqualsAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'BoolEquals' |
value | The boolean filter value. | bool |
IsNotNullAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'IsNotNull' |
IsNullOrUndefinedAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'IsNullOrUndefined' |
NumberGreaterThanAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'NumberGreaterThan' |
value | The filter value. | int |
NumberGreaterThanOrEqualsAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'NumberGreaterThanOrEquals' |
value | The filter value. | int |
NumberInAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'NumberIn' |
values | The set of filter values. | int[] |
NumberInRangeAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'NumberInRange' |
values | The set of filter values. | int[][] |
NumberLessThanAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'NumberLessThan' |
value | The filter value. | int |
NumberLessThanOrEqualsAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'NumberLessThanOrEquals' |
value | The filter value. | int |
NumberNotInAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'NumberNotIn' |
values | The set of filter values. | int[] |
NumberNotInRangeAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'NumberNotInRange' |
values | The set of filter values. | int[][] |
StringBeginsWithAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'StringBeginsWith' |
values | The set of filter values. | string[] |
StringContainsAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'StringContains' |
values | The set of filter values. | string[] |
StringEndsWithAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'StringEndsWith' |
values | The set of filter values. | string[] |
StringInAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'StringIn' |
values | The set of filter values. | string[] |
StringNotBeginsWithAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'StringNotBeginsWith' |
values | The set of filter values. | string[] |
StringNotContainsAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'StringNotContains' |
values | The set of filter values. | string[] |
StringNotEndsWithAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'StringNotEndsWith' |
values | The set of filter values. | string[] |
StringNotInAdvancedFilter
Name | Description | Value |
---|---|---|
operatorType | The operator type used for filtering, e.g., NumberIn, StringContains, BoolEquals and others. | 'StringNotIn' |
values | The set of filter values. | string[] |
RetryPolicy
Name | Description | Value |
---|---|---|
eventTimeToLiveInMinutes | Time To Live (in minutes) for events. | int |
maxDeliveryAttempts | Maximum number of delivery retry attempts for events. | int |
Quickstart templates
The following quickstart templates deploy this resource type.
Template | Description |
---|---|
Create Azure Event Grid Custom Topic and Subscription |
Creates an Azure Event Grid custom topic and a webhook subscription. Template originally authored by John Downs. |
Custom Azure Event Grid Topic/Subscription with CloudEvents |
Creates a custom Azure Event Grid topic, a webhook subscription having CloudEvents schema, and a Logic App as an event handler. Template originally authored by Justin Yoo. |
Create Event Grid custom topic and event hub handler. |
Creates an Azure Event Grid custom topic and event hub to handle the events. |
Create Event Grid subscription for resource events |
Creates Event Grid subscription to either resource group or Azure subscription. |
Create Azure Event Grid Custom Topic and Subscription |
Creates an Azure Event Grid custom topic and a service bus queue subscription. Template originally authored by Markus Meyer. |
Create Azure Event Grid Custom Topic and Subscription |
Creates an Azure Event Grid custom topic and a service bus topic subscription. Template originally authored by Markus Meyer. |