Microsoft.EventGrid topics

Template format

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

{
  "name": "string",
  "type": "Microsoft.EventGrid/topics",
  "apiVersion": "2020-06-01",
  "location": "string",
  "tags": {},
  "properties": {
    "privateEndpointConnections": [
      {
        "properties": {
          "privateEndpoint": {
            "id": "string"
          },
          "groupIds": [
            "string"
          ],
          "privateLinkServiceConnectionState": {
            "status": "string",
            "description": "string",
            "actionsRequired": "string"
          }
        }
      }
    ],
    "inputSchema": "string",
    "inputSchemaMapping": {
      "inputSchemaMappingType": "string",
      "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"
        }
      }
    },
    "publicNetworkAccess": "string",
    "inboundIpRules": [
      {
        "ipMask": "string",
        "action": "Allow"
      }
    ]
  },
  "resources": []
}

Property values

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

Microsoft.EventGrid/topics object

Name Type Required Value
name string Yes Name of the topic
type enum Yes Microsoft.EventGrid/topics
apiVersion enum Yes 2020-06-01
location string Yes Location of the resource.
tags object No Tags of the resource.
properties object Yes Properties of the topic. - TopicProperties object
resources array No privateEndpointConnections

TopicProperties object

Name Type Required Value
privateEndpointConnections array No PrivateEndpointConnection object
inputSchema enum No This determines the format that Event Grid should expect for incoming events published to the topic. - EventGridSchema, CustomEventSchema, CloudEventSchemaV1_0
inputSchemaMapping object No This enables publishing using custom event schemas. An InputSchemaMapping can be specified to map various properties of a source schema to various required properties of the EventGridEvent schema. - InputSchemaMapping object
publicNetworkAccess enum No This determines if traffic is allowed over public network. By default it is enabled.
You can further restrict to specific IPs by configuring . - Enabled or Disabled
inboundIpRules array No This can be used to restrict traffic from specific IPs instead of all IPs. Note: These are considered only if PublicNetworkAccess is enabled. - InboundIpRule object

PrivateEndpointConnection object

Name Type Required Value
properties object No Properties of the PrivateEndpointConnection. - PrivateEndpointConnectionProperties object

InputSchemaMapping object

Name Type Required Value
inputSchemaMappingType string Yes Type of the custom mapping - Json
properties object No This can be used to map properties of a source schema (or default values, for certain supported properties) to properties of the EventGridEvent schema. - InputSchemaMappingProperties object

InputSchemaMappingProperties object

Name Type Required Value
dataVersion object No 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 object
eventTime object No 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 object
eventType object No 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 object
id object No 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 object
subject object No 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 object
topic object No 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 object

JsonFieldWithDefault object

Name Type Required Value
defaultValue string No 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.
sourceField string No Name of a field in the input event schema that's to be used as the source of a mapping.

JsonField object

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

InboundIpRule object

Name Type Required Value
ipMask string No IP Address in CIDR notation e.g., 10.0.0.0/8.
action enum No Action to perform based on the match or no match of the IpMask. - Allow

PrivateEndpointConnectionProperties object

Name Type Required Value
privateEndpoint object No The Private Endpoint resource for this Connection. - PrivateEndpoint object
groupIds array No GroupIds from the private link service resource. - string
privateLinkServiceConnectionState object No Details about the state of the connection. - ConnectionState object

PrivateEndpoint object

Name Type Required Value
id string No The ARM identifier for Private Endpoint.

ConnectionState object

Name Type Required Value
status enum No Status of the connection. - Pending, Approved, Rejected, Disconnected
description string No Description of the connection state.
actionsRequired string No Actions required (if any).

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.