Microsoft.EventGrid eventSubscriptions 2019-01-01

Template format

To create a Microsoft.EventGrid/eventSubscriptions resource, add the following JSON to the resources section of your template.

{
  "name": "string",
  "type": "Microsoft.EventGrid/eventSubscriptions",
  "apiVersion": "2019-01-01",
  "scope": "string",
  "properties": {
    "destination": {
      "endpointType": "string",
      "properties": {
        "endpointUrl": "string",
        "queueName": "string",
        "resourceId": "string"
      }
    },
    "filter": {
      "subjectBeginsWith": "string",
      "subjectEndsWith": "string",
      "includedEventTypes": [
        "string"
      ],
      "isSubjectCaseSensitive": "boolean"
    },
    "labels": [
      "string"
    ],
    "retryPolicy": {
      "maxDeliveryAttempts": "integer",
      "eventTimeToLiveInMinutes": "integer"
    },
    "deadLetterDestination": {
      "endpointType": "string",
      "properties": {
        "blobContainerName": "string",
        "resourceId": "string"
      }
    }
  }
}

Property values

The following tables describe the values you need to set in the schema.

Microsoft.EventGrid/eventSubscriptions object

Name Type Required Value
name string Yes Name of the event subscription. Event subscription names must be between 3 and 64 characters in length and should use alphanumeric letters only.
type enum Yes Microsoft.EventGrid/eventSubscriptions
apiVersion enum Yes 2019-01-01
scope string No Use when specifying a scope that is different than the deployment scope. See Setting scope for extension resources in ARM templates.
properties object Yes Properties of the event subscription - EventSubscriptionProperties object

EventSubscriptionProperties object

Name Type Required Value
destination object No Information about the destination where events have to be delivered for the event subscription. - EventSubscriptionDestination object
filter object No Information about the filter for the event subscription. - EventSubscriptionFilter object
labels array No List of user defined labels. - string
retryPolicy object No The retry policy for events. This can be used to configure maximum number of delivery attempts and time to live for events. - RetryPolicy object
deadLetterDestination object No The DeadLetter destination of the event subscription. - DeadLetterDestination object

EventSubscriptionDestination object

Name Type Required Value
endpointType string Yes Type of the endpoint for the event subscription destination - EventHub, HybridConnection, StorageQueue or WebHook
properties object Yes Properties for the type of endpoint - endpointProperties object

endpointProperties object

Name Type Required Value
endpointUrl string No For WebHook, the URL that represents the endpoint of the destination of an event subscription.
queueName string No For StorageQueue, the name of the Storage queue under a storage account that is the destination of an event subscription.
resourceId string No For EventHub, HybridConnection or StorageQueue, the Azure Resource Id that represents the endpoint resource of an event subscription.

EventSubscriptionFilter object

Name Type Required Value
subjectBeginsWith string No 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.
subjectEndsWith string No An optional string to filter events for an event subscription based on a resource path suffix. Wildcard characters are not supported in this path.
includedEventTypes array No A list of applicable event types that need to be part of the event subscription. If it is desired to subscribe to all event types, the string "all" needs to be specified as an element in this list. - string
isSubjectCaseSensitive boolean No Specifies if the SubjectBeginsWith and SubjectEndsWith properties of the filter should be compared in a case sensitive manner.

RetryPolicy object

Name Type Required Value
maxDeliveryAttempts integer No Maximum number of delivery retry attempts for events.
eventTimeToLiveInMinutes integer No Time To Live (in minutes) for events.

DeadLetterDestination object

Name Type Required Value
endpointType string Yes Type of the endpoint for the dead letter destination. - StorageBlob
properties object Yes Properties for the storage account for dead letter events. - deadletterStorageProperties object

deadletterStorageProperties object

Name Type Required Value
blobContainerName string Yes The name of the Storage blob container that is the destination of the deadletter events.
resourceId string Yes The Azure Resource ID of the storage account that is the destination of the deadletter events

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.