Table of contents

Official Content

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

Deployment steps

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.

Deployment Settings

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.

image_202312301744_1_png

Infrastructure setup

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.

image_2023123004839_1_png

Requirements

The Function App must be defined for NET 8.

image_2023123004714_1_png

Function Inputs

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.

Scope

Generators: .NET

Availability

This functionality is available since GeneXus 18 Upgrade 8.

See Also

Azure Functions
Monitor Event Grid message delivery
Enable diagnostic logs for Event Grid
Event Grid message delivery and retry

Last update: February 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant