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. - 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:
- 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 | Notes | Example |
|---|---|---|
| Authorize URL | The OAuth 2.0 Authorization URL for your Microsoft Event Grid. | https://login.microsoftonline.com/common/oauth2/v2.0/authorize |
| Client ID | Get this value from your App Registration in the Azure Portal | |
| Client Secret | Get this value from your App Registration in the Azure Portal | |
| Scopes | Microsoft Event Grid Scopes. | https://management.azure.com/.default offline_access |
| Token URL | The OAuth 2.0 Token URL for your Microsoft Event Grid | https://login.microsoftonline.com/common/oauth2/v2.0/token |
Triggers
Event Grid Trigger
Handle validation and delivery of Event Grid events | key: myTrigger
| Input | Notes | Example |
|---|---|---|
| Event Topics to Listen For | 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 | Notes | Example |
|---|---|---|
| Body Fields | Extra fields to include in the body of the request. | |
| Connection | ||
| Debug Request | Enabling this flag will log out the current request. | false |
| Event Delivery Schema | The event delivery schema for the event subscription. | |
| Event Subscription Name | The name of the event subscription to use. | myeventsubscriptionxxx |
| Resource Group Name | The name of the resource group to use. | my-resource-group |
| Subscription ID | The ID of the subscription to use. | 00000000-0000-0000-0000-000000000000 |
| Topic | The name of the topic to subscribe to. | my-topic |
| Webhook URL | The URL to send the event to. If not provided, the event will be sent to the current flow endpoint. | https://example.com/webhook |
{
"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 | Notes | Example |
|---|---|---|
| Connection | ||
| Debug Request | Enabling this flag will log out the current request. | false |
| Event Subscription Name | The name of the event subscription to use. | myeventsubscriptionxxx |
| Resource Group Name | The name of the resource group to use. | my-resource-group |
| Subscription ID | The ID of the subscription to use. | 00000000-0000-0000-0000-000000000000 |
| Topic | The name of the topic to subscribe to. | my-topic |
{
"data": "DELETED SUCCESSFULLY"
}
Get Event Subscription
Get properties of an event subscription. | key: getEventSubscription
| Input | Notes | Example |
|---|---|---|
| Connection | ||
| Debug Request | Enabling this flag will log out the current request. | false |
| Event Subscription Name | The name of the event subscription to use. | myeventsubscriptionxxx |
| Resource Group Name | The name of the resource group to use. | my-resource-group |
| Subscription ID | The ID of the subscription to use. | 00000000-0000-0000-0000-000000000000 |
| Topic | The name of the topic to subscribe to. | my-topic |
{
"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 | Notes | Example |
|---|---|---|
| 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 | 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 | ||
| Debug Request | Enabling this flag will log out the current request. | false |
| Fetch All | If true, fetch all results. If false, fetch only the first page. | false |
| Next Link | 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 | The name of the resource group to use. | my-resource-group |
| Subscription ID | The ID of the subscription to use. | 00000000-0000-0000-0000-000000000000 |
| Topic | The name of the topic to subscribe to. | my-topic |
{
"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 | Notes | Example |
|---|---|---|
| Connection | ||
| Debug Request | Enabling this flag will log out the current request. | false |
| Events | The events to publish. The events must match the schema of the topic. | |
| Topic Access Key | The access key of the topic. | AzVWk42YmQlshLB7o5pxJqBTBYmkS1SAEGldtYeLcWAu5gzk5YKpJQQJ99AKACYesed1SSsd1s |
| Topic Host Name | The host name of the topic. | topic1.westus2-1.eventgrid.azure.net |
{
"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 | Notes | Example |
|---|---|---|
| Body Fields | Extra fields to include in the body of the request. | |
| Connection | ||
| Debug Request | Enabling this flag will log out the current request. | false |
| Event Delivery Schema | The event delivery schema for the event subscription. | |
| Event Subscription Name | The name of the event subscription to use. | myeventsubscriptionxxx |
| Resource Group Name | The name of the resource group to use. | my-resource-group |
| Subscription ID | The ID of the subscription to use. | 00000000-0000-0000-0000-000000000000 |
| Topic | The name of the topic to subscribe to. | my-topic |
| Webhook URL | The URL to send the event to. If not provided, the event will be sent to the current flow endpoint. | https://example.com/webhook |
{
"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"
}
}