Microsoft.EventGrid eventSubscriptions 2018-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": "2018-01-01",
  "scope": "string",
  "properties": {
    "destination": {
      "endpointType": "string",
      "properties": {
        "endpointUrl": "string",
        "resourceId": "string"
      }
    },
    "filter": {
      "subjectBeginsWith": "string",
      "subjectEndsWith": "string",
      "includedEventTypes": [
        "string"
      ],
      "isSubjectCaseSensitive": "boolean"
    },
    "labels": [
      "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 2018-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

EventSubscriptionDestination object

Name Type Required Value
endpointType string Yes Type of the endpoint for the event subscription destination - EventHub 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.
resourceId string No For EventHub, the Azure Resource Id that represents the endpoint of an Event Hub destination 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.

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.