Azure Event Grid Component
Azure Event Grid is an event routing service that can be used to build event driven applications by distributing events from various sources to subscribers.
Component key: azure-event-grid
Description
Microsoft Event Grid is used to build data pipelines, integrate applications, and create event-driven serverless solutions with a fully managed publish-subscribe messaging service.
API Documentation:
The component was built using the Microsoft Graph REST API v1.0
Connections
Microsoft Event Grid OAuth Connection
This authentication method may be used when an App requires granting admin consent to API permissions, in addition to authorizing the integration with the App's configured client credentials.
The Microsoft Event Grid component authenticates requests through the Microsoft Graph API.
Creating an App Registration
To configure OAuth 2.0 you must first create an App through Active Directory in the Microsoft Azure Portal.
- Navigate to App Registrations
- When creating the application you will be prompted to select Supported account types.
- Select Accounts in any organizational directory (Any Azure AD directory - Multitenant).
- Navigate to Redirect URI and add the Web platform. Now enter the redirect URI as
https://oauth2.prismatic.io/callback
for US based integrations.- For integrations outside the US refer to this guide to find your region’s Callback URL.
- Select Register to complete.
- In the App, navigate to Certificates & Secrets and select New client secret. Copy/save the Value for use in the connection configuration of your integration (the value will not be shown again).
- Next, navigate to the Overview section and copy the Application (client) ID
- Navigate to the API Permissions section to assign the proper permissions for the integration. Select Add Permission, select all permissions that are required for your desired integration
and save these values for later. A full list of scopes can be found on
the Microsoft Graph API documentation 1. Recommended scopes for Active Directory can be found in Microsoft Graph > Delegated permissions: 1.
Group.ReadWrite.All GroupMember.ReadWrite.All Application.ReadWrite.All User.Read.All offline_access
Configuring the Integration
Supply the following values to the OAuth 2.0 Authorization Code connection in your integration within Prismatic:
- Client ID enter the Application (client) ID
- Client Secret enter the Value provided (Do not use Secret ID)
- If you didn't select Multitenant when creating the App, you will need to replace the Authorize URL and Token URL with ones specific to your tenant.
Input | Default | Notes |
---|---|---|
Authorize URL string / Required authorizeUrl | https://login.microsoftonline.com/common/oauth2/v2.0/authorize | The OAuth 2.0 Authorization URL for your Microsoft Event Grid. |
Client ID string / Required clientId | Get this value from your App Registration in the Azure Portal | |
Client Secret password / Required clientSecret | Get this value from your App Registration in the Azure Portal | |
Scopes string / Required Hidden Field scopes | https://management.azure.com/.default offline_access | Microsoft Event Grid Scopes. |
Token URL string / Required tokenUrl | https://login.microsoftonline.com/common/oauth2/v2.0/token | The OAuth 2.0 Token URL for your Microsoft Event Grid |
Triggers
Event Grid Trigger
Handle validation and delivery of Event Grid events | key: myTrigger
Input | Notes |
---|---|
Event Topics to Listen For string / Required Value List eventTopics | The topics to listen for events on |
Actions
Create or Update Event Subscription
Asynchronously creates a new event subscription or updates an existing event subscription based on the specified scope. | key: createOrUpdateEventSubscription
Input | Default | Notes | Example |
---|---|---|---|
Body Fields code bodyFields | Extra fields to include in the body of the request. | ||
Connection connection / Required connection | |||
Debug Request boolean debug | false | Enabling this flag will log out the current request. | |
Event Delivery Schema string / Required eventDeliverySchema | The event delivery schema for the event subscription. | ||
Event Subscription Name string / Required eventSubscriptionName | The name of the event subscription to use. | myeventsubscriptionxxx | |
Resource Group Name string / Required resourceGroupName | The name of the resource group to use. | my-resource-group | |
Subscription ID string / Required subscriptionId | The ID of the subscription to use. | 00000000-0000-0000-0000-000000000000 | |
Topic string / Required topicName | The name of the topic to subscribe to. | my-topic | |
Webhook URL string / Required webhookUrl | The URL to send the event to. If not provided, the event will be sent to the current flow endpoint. | https://example.com/webhook |
Example Payload for Create or Update Event Subscription
{
"data": {
"properties": {
"destination": {
"properties": {
"endpointBaseUrl": "https://requestb.in/15ksip71"
},
"endpointType": "WebHook"
},
"filter": {
"isSubjectCaseSensitive": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"labels": [
"label1",
"label2"
],
"provisioningState": "Succeeded",
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1",
"name": "examplesubscription1",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
}
Delete Event Subscription
Delete an existing event subscription. | key: deleteEventSubscription
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | |||
Debug Request boolean debug | false | Enabling this flag will log out the current request. | |
Event Subscription Name string / Required eventSubscriptionName | The name of the event subscription to use. | myeventsubscriptionxxx | |
Resource Group Name string / Required resourceGroupName | The name of the resource group to use. | my-resource-group | |
Subscription ID string / Required subscriptionId | The ID of the subscription to use. | 00000000-0000-0000-0000-000000000000 | |
Topic string / Required topicName | The name of the topic to subscribe to. | my-topic |
Example Payload for Delete Event Subscription
{
"data": "DELETED SUCCESSFULLY"
}
Get Event Subscription
Get properties of an event subscription. | key: getEventSubscription
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | |||
Debug Request boolean debug | false | Enabling this flag will log out the current request. | |
Event Subscription Name string / Required eventSubscriptionName | The name of the event subscription to use. | myeventsubscriptionxxx | |
Resource Group Name string / Required resourceGroupName | The name of the resource group to use. | my-resource-group | |
Subscription ID string / Required subscriptionId | The ID of the subscription to use. | 00000000-0000-0000-0000-000000000000 | |
Topic string / Required topicName | The name of the topic to subscribe to. | my-topic |
Example Payload for Get Event Subscription
{
"data": {
"properties": {
"destination": {
"properties": {
"endpointBaseUrl": "https://requestb.in/15ksip71"
},
"endpointType": "WebHook"
},
"filter": {
"isSubjectCaseSensitive": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"labels": [
"label1",
"label2"
],
"provisioningState": "Succeeded",
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1",
"name": "examplesubscription1",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
}
List Event Subscriptions
List all event subscriptions that have been created for a specific topic. | key: listEventSubscriptions
Input | Default | Notes | Example |
---|---|---|---|
Filter string $filter | The query used to filter the search results using OData syntax. Filtering is permitted on the 'name' property only and with limited number of OData operations. The following is a valid filter example: $filter=contains(namE, 'PATTERN') and name ne 'PATTERN-1'. | contains(namE, 'PATTERN') and name ne 'PATTERN-1' | |
Top string $top | The number of results to return per page for the list operation. Valid range for top parameter is 1 to 100. If not specified, the default number of results to be returned is 20 items per page. | 20 | |
Connection connection / Required connection | |||
Debug Request boolean debug | false | Enabling this flag will log out the current request. | |
Fetch All boolean fetchAll | false | If true, fetch all results. If false, fetch only the first page. | |
Next Link string nextLink | The next link to fetch the next page of results. | https://management.azure.com/subscriptions/503a76a6-249f-422e-a06a-12345/resourceGroups/AzureEventGrid/providers/Microsoft.EventGrid/topics/AzureTestGrid/providers/Microsoft.EventGrid/eventSubscriptions?api-version=2022-06-15&$skiptoken=%5b%7b%22token%22%3anull%2c%22range%22%3a%7b%22min%22%3a%2205C1DF6B5557E0%22%2c%22max%22%3a%22FF%22%7d%7d%5d&$top=20 | |
Resource Group Name string / Required resourceGroupName | The name of the resource group to use. | my-resource-group | |
Subscription ID string / Required subscriptionId | The ID of the subscription to use. | 00000000-0000-0000-0000-000000000000 | |
Topic string / Required topicName | The name of the topic to subscribe to. | my-topic |
Example Payload for List Event Subscriptions
{
"data": [
{
"properties": {
"destination": {
"properties": {
"endpointBaseUrl": "https://requestb.in/15ksip71"
},
"endpointType": "WebHook"
},
"filter": {
"isSubjectCaseSensitive": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"labels": [
"label1",
"label2"
],
"provisioningState": "Succeeded",
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1",
"name": "examplesubscription1",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
]
}
Publish Events
Publishes a batch of events to an Azure Event Grid topic. | key: publishEvents
Input | Default | Notes | Example |
---|---|---|---|
Connection connection / Required connection | |||
Debug Request boolean debug | false | Enabling this flag will log out the current request. | |
Events code / Required events | The events to publish. The events must match the schema of the topic. | ||
Topic Access Key string / Required topicAccessKey | The access key of the topic. | AzVWk42YmQlshLB7o5pxJqBTBYmkS1SAEGldtYeLcWAu5gzk5YKpJQQJ99AKACYesed1SSsd1s | |
Topic Host Name string / Required topicHostName | The host name of the topic. | topic1.westus2-1.eventgrid.azure.net |
Example Payload for Publish Events
{
"data": {
"properties": {
"destination": {
"properties": {
"endpointBaseUrl": "https://requestb.in/15ksip71"
},
"endpointType": "WebHook"
},
"filter": {
"isSubjectCaseSensitive": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"labels": [
"label1",
"label2"
],
"provisioningState": "Succeeded",
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1",
"name": "examplesubscription1",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
}
Update Event Subscription
Asynchronously updates an existing event subscription. | key: updateEventSubscription
Input | Default | Notes | Example |
---|---|---|---|
Body Fields code bodyFields | Extra fields to include in the body of the request. | ||
Connection connection / Required connection | |||
Debug Request boolean debug | false | Enabling this flag will log out the current request. | |
Event Delivery Schema string eventDeliverySchema | The event delivery schema for the event subscription. | ||
Event Subscription Name string / Required eventSubscriptionName | The name of the event subscription to use. | myeventsubscriptionxxx | |
Resource Group Name string / Required resourceGroupName | The name of the resource group to use. | my-resource-group | |
Subscription ID string / Required subscriptionId | The ID of the subscription to use. | 00000000-0000-0000-0000-000000000000 | |
Topic string / Required topicName | The name of the topic to subscribe to. | my-topic | |
Webhook URL string webhookUrl | The URL to send the event to. If not provided, the event will be sent to the current flow endpoint. | https://example.com/webhook |
Example Payload for Update Event Subscription
{
"data": {
"properties": {
"destination": {
"properties": {
"endpointBaseUrl": "https://requestb.in/15ksip71"
},
"endpointType": "WebHook"
},
"filter": {
"isSubjectCaseSensitive": false,
"subjectBeginsWith": "ExamplePrefix",
"subjectEndsWith": "ExampleSuffix"
},
"labels": [
"label1",
"label2"
],
"provisioningState": "Succeeded",
"topic": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/microsoft.eventgrid/topics/exampletopic2"
},
"id": "/subscriptions/5b4b650e-28b9-4790-b3ab-ddbd88d727c4/resourceGroups/examplerg/providers/Microsoft.EventGrid/topics/exampletopic2/providers/Microsoft.EventGrid/eventSubscriptions/examplesubscription1",
"name": "examplesubscription1",
"type": "Microsoft.EventGrid/eventSubscriptions"
}
}