Microsoft.EventGrid eventSubscriptions 2019-06-01

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.

Valid deployment scopes for the eventSubscriptions resource are:

  • Subscription
  • Resource Group

For a list of changed properties in each API version, see change log.

Template format

To create a Microsoft.EventGrid/eventSubscriptions resource, add the following Bicep or JSON to your template.

resource symbolicname 'Microsoft.EventGrid/eventSubscriptions@2019-06-01' = {
  name: 'string'
  scope: resourceSymbolicName
  properties: {
    deadLetterDestination: {
      endpointType: 'string'
      // For remaining properties, see DeadLetterDestination objects
    }
    destination: {
      endpointType: 'string'
      // For remaining properties, see EventSubscriptionDestination objects
    }
    expirationTimeUtc: 'string'
    filter: {
      advancedFilters: [
        {
          key: 'string'
          operatorType: 'string'
          // For remaining properties, see AdvancedFilter objects
        }
      ]
      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 EventHub, use:

  endpointType: 'EventHub'
  properties: {
    resourceId: 'string'
  }

For HybridConnection, use:

  endpointType: 'HybridConnection'
  properties: {
    resourceId: 'string'
  }

For ServiceBusQueue, use:

  endpointType: 'ServiceBusQueue'
  properties: {
    resourceId: 'string'
  }

For StorageQueue, use:

  endpointType: 'StorageQueue'
  properties: {
    queueName: 'string'
    resourceId: 'string'
  }

For WebHook, use:

  endpointType: 'WebHook'
  properties: {
    endpointUrl: 'string'
  }

AdvancedFilter objects

Set the operatorType property to specify the type of object.

For BoolEquals, use:

  operatorType: 'BoolEquals'
  value: bool

For NumberGreaterThan, use:

  operatorType: 'NumberGreaterThan'
  value: int

For NumberGreaterThanOrEquals, use:

  operatorType: 'NumberGreaterThanOrEquals'
  value: int

For NumberIn, use:

  operatorType: 'NumberIn'
  values: [
    int
  ]

For NumberLessThan, use:

  operatorType: 'NumberLessThan'
  value: int

For NumberLessThanOrEquals, use:

  operatorType: 'NumberLessThanOrEquals'
  value: int

For NumberNotIn, use:

  operatorType: 'NumberNotIn'
  values: [
    int
  ]

For StringBeginsWith, use:

  operatorType: 'StringBeginsWith'
  values: [
    'string'
  ]

For StringContains, use:

  operatorType: 'StringContains'
  values: [
    'string'
  ]

For StringEndsWith, use:

  operatorType: 'StringEndsWith'
  values: [
    'string'
  ]

For StringIn, use:

  operatorType: 'StringIn'
  values: [
    'string'
  ]

For StringNotIn, use:

  operatorType: 'StringNotIn'
  values: [
    'string'
  ]

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.
'2019-06-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 The DeadLetter destination of the event subscription. DeadLetterDestination
destination Information about the destination where events have to be delivered for the event subscription. EventSubscriptionDestination
expirationTimeUtc Expiration time of the event subscription. string
filter Information about the filter for the event subscription. EventSubscriptionFilter
labels List of user defined labels. string[]
retryPolicy The retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. 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 The properties of the Storage Blob based deadletter 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

EventSubscriptionDestination

Name Description Value
endpointType Set the object type EventHub
HybridConnection
ServiceBusQueue
StorageQueue
WebHook

EventHubEventSubscriptionDestination

Name Description Value
endpointType Type of the endpoint for the event subscription destination 'EventHub'
properties Event Hub Properties of the event subscription destination EventHubEventSubscriptionDestinationProperties

EventHubEventSubscriptionDestinationProperties

Name Description Value
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 Hybrid connection Properties of the event subscription destination HybridConnectionEventSubscriptionDestinationProperties

HybridConnectionEventSubscriptionDestinationProperties

Name Description Value
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 Service Bus Properties of the event subscription destination ServiceBusQueueEventSubscriptionDestinationProperties

ServiceBusQueueEventSubscriptionDestinationProperties

Name Description Value
resourceId The Azure Resource Id that represents the endpoint of the Service Bus destination of an event subscription. string

StorageQueueEventSubscriptionDestination

Name Description Value
endpointType Type of the endpoint for the event subscription destination 'StorageQueue'
properties Storage Queue Properties of the event subscription destination StorageQueueEventSubscriptionDestinationProperties

StorageQueueEventSubscriptionDestinationProperties

Name Description Value
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 WebHook Properties of the event subscription destination WebHookEventSubscriptionDestinationProperties

WebHookEventSubscriptionDestinationProperties

Name Description Value
endpointUrl The URL that represents the endpoint of the destination of an event subscription. string

EventSubscriptionFilter

Name Description Value
advancedFilters An array of advanced filters that are used for filtering event subscriptions. AdvancedFilter[]
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
NumberGreaterThan
NumberGreaterThanOrEquals
NumberIn
NumberLessThan
NumberLessThanOrEquals
NumberNotIn
StringBeginsWith
StringContains
StringEndsWith
StringIn
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

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[]

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[]

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[]

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

Deploy to Azure
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

Deploy to Azure
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.

Deploy to Azure
Creates an Azure Event Grid custom topic and event hub to handle the events.
Create Event Grid subscription for resource events

Deploy to Azure
Creates Event Grid subscription to either resource group or Azure subscription.
Create Azure Event Grid Custom Topic and Subscription

Deploy to Azure
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

Deploy to Azure
Creates an Azure Event Grid custom topic and a service bus topic subscription. Template originally authored by Markus Meyer.