Microsoft.EventGrid topics 2018-05-01-preview

The topics resource type can be deployed to: Resource groups.

To learn about resource group deployments, see Bicep or ARM template.

Template format

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

resource symbolicname 'Microsoft.EventGrid/topics@2018-05-01-preview' = {
  name: 'string'
  location: 'string'
  tags: {
    tagName1: 'tagValue1'
    tagName2: 'tagValue2'
  }
  properties: {
    inputSchema: 'string'
    inputSchemaMapping: {
      inputSchemaMappingType: 'string'
      // For remaining properties, see InputSchemaMapping objects
    }
  }
}

InputSchemaMapping objects

Set the inputSchemaMappingType property to specify the type of object.

For Json, use:

  inputSchemaMappingType: 'Json'
  properties: {
    dataVersion: {
      defaultValue: 'string'
      sourceField: 'string'
    }
    eventTime: {
      sourceField: 'string'
    }
    eventType: {
      defaultValue: 'string'
      sourceField: 'string'
    }
    id: {
      sourceField: 'string'
    }
    subject: {
      defaultValue: 'string'
      sourceField: 'string'
    }
    topic: {
      sourceField: 'string'
    }
  }

Property values

topics

Name Description Value
type The resource type

For Bicep, set this value in the resource declaration.
'Microsoft.EventGrid/topics'
apiVersion The resource api version

For Bicep, set this value in the resource declaration.
'2018-05-01-preview'
name The resource name string (required)
location Location of the resource string (required)
tags Tags of the resource Dictionary of tag names and values. See Tags in templates
properties Properties of the Topic TopicProperties

TopicProperties

Name Description Value
inputSchema This determines the format that Event Grid should expect for incoming events published to the topic. 'CloudEventV01Schema'
'CustomEventSchema'
'EventGridSchema'
inputSchemaMapping By default, Event Grid expects events to be in the Event Grid event schema. Specifying an input schema mapping enables publishing to Event Grid using a custom input schema. Currently, the only supported type of InputSchemaMapping is 'JsonInputSchemaMapping'. InputSchemaMapping

InputSchemaMapping

Name Description Value
inputSchemaMappingType Set the object type Json

JsonInputSchemaMapping

Name Description Value
inputSchemaMappingType Type of the custom mapping 'Json'
properties This can be used to map properties of a source schema (or default values, for certain supported properties) to properties of the EventGridEvent schema. JsonInputSchemaMappingProperties

JsonInputSchemaMappingProperties

Name Description Value
dataVersion This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'subject','eventType' and 'dataVersion' properties. This represents a field in the input event schema along with a default value to be used, and at least one of these two properties should be provided. JsonFieldWithDefault
eventTime This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'id','topic' and 'eventTime' properties. This represents a field in the input event schema. JsonField
eventType This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'subject','eventType' and 'dataVersion' properties. This represents a field in the input event schema along with a default value to be used, and at least one of these two properties should be provided. JsonFieldWithDefault
id This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'id','topic' and 'eventTime' properties. This represents a field in the input event schema. JsonField
subject This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'subject','eventType' and 'dataVersion' properties. This represents a field in the input event schema along with a default value to be used, and at least one of these two properties should be provided. JsonFieldWithDefault
topic This is used to express the source of an input schema mapping for a single target field in the Event Grid Event schema. This is currently used in the mappings for the 'id','topic' and 'eventTime' properties. This represents a field in the input event schema. JsonField

JsonFieldWithDefault

Name Description Value
defaultValue The default value to be used for mapping when a SourceField is not provided or if there's no property with the specified name in the published JSON event payload. string
sourceField Name of a field in the input event schema that's to be used as the source of a mapping. string

JsonField

Name Description Value
sourceField Name of a field in the input event schema that's to be used as the source of a mapping. string

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 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.