An Azure Function can be used as an event handler for Event Grid events.
This document explains how to deploy Azure functions triggered by Event Grid events in GeneXus.
Summary
First, read HowTo: Create a GeneXus Procedure to be deployed as an Azure or AWS Function.
To deploy the function, use the deployment tool. See HowTo: Deploy as Azure Functions.
When using the deployment tool, the Azure functions use the Event Grid trigger.
The Trigger type property in the deployment unit should be "Event Grid" for this kind of function.
Then select the Event Schema used when the Event Grid was defined.
You can select one of these two values:
The schema selection depends on the schema used by your Event Grid definition.
First, Register the Event Grid resource provider.
Next, define an Event Grid Custom Topic or System Topic.
Afterwards, you have to configure a subscription for your Azure Function. Specify Azure Function as the endpoint type. Next, specify the function app and the function that will handle events.
Check the Azure documentation here.
The Function App must be defined for NET 8.
The GeneXus procedure will have a signature as explained in HowTo: Create a GeneXus Procedure to be deployed as an Azure or AWS Function.
In this case, the EventMessage SDT will contain the following in each field:
- EventMessageId: Cloud Event Id or Event Grid Schema Id (depending on the schema used).
- EventMessageSourceType: Type of event related to the originating occurrence.
- EventMessageVersion: "" in the case of Cloud Event. Schema version of the data object in the case of Event Grid Schema.
- EventMessageDate: Time in UTC that the event was generated.
- EventMessageData: A Json string containing the event payload.
- EventMessageProperties: Properties of the event, including:
- Subject and Topic: In the case of Event Grid Schema.
- Subject and Source: In the case of Cloud Event Schema.
Generators: .NET
This functionality is available since GeneXus 18 Upgrade 8.
Azure Functions
Monitor Event Grid message delivery
Enable diagnostic logs for Event Grid
Event Grid message delivery and retry