1. Using azure-native eventgrid with purview

    TypeScript

    To integrate Azure Event Grid with Azure Purview using the azure-native provider, you'll need to perform a few key tasks:

    1. Create an instance of Azure Purview, which is a unified data governance service that helps you manage and govern your on-premises, multi-cloud, and software-as-a-service (SaaS) data.

    2. Create an Azure Event Grid Topic or Domain. This will be the source of your events. A Topic is used to categorize the events you're sending, while a Domain can contain multiple Topics.

    3. Create an Azure Event Grid Subscription. This will tell Event Grid where to send the events—namely to your Purview account.

    4. Configure Purview to receive events, such as by setting up a Kafka configuration if using a Kafka topic.

    Here's how you can use Pulumi to create these resources. The following program sets up an Event Grid Topic and a Purview Account, and then subscribes the Purview Account to the Event Grid Topic.

    import * as pulumi from "@pulumi/pulumi"; import * as azure_native from "@pulumi/azure-native"; // Create a Resource Group if you don't have one already const resourceGroup = new azure_native.resources.ResourceGroup("resourceGroup", { resourceGroupName: "event-grid-purview-rg", location: "West US", // Choose the appropriate Azure region }); // Create an Azure Purview Account const purviewAccount = new azure_native.purview.Account("purviewAccount", { accountName: "mypurviewaccount", // Replace with your desired account name resourceGroupName: resourceGroup.name, location: resourceGroup.location, identity: { type: "SystemAssigned", // System-assigned managed identity }, sku: { name: "Standard", capacity: 4, // Adjust as needed for your workload }, }); // Create an Event Grid Topic const eventGridTopic = new azure_native.eventgrid.Topic("eventGridTopic", { topicName: "mypurviewtopic", // Replace with your desired topic name resourceGroupName: resourceGroup.name, location: resourceGroup.location, inputSchema: azure_native.eventgrid.InputSchema.EventGridSchema, }); // Create an Event Grid Subscription that forwards events to Purview const eventGridSubscription = new azure_native.eventgrid.EventSubscription("eventGridSubscription", { scope: eventGridTopic.id, destination: { endpointType: "EventSubscriptionDestination", properties: { endpointType: azure_native.eventgrid.EndpointType.AzureFunction, azureFunctionDestination: { resourceGroup: resourceGroup.name, maxEventsPerBatch: 1, preferredBatchSizeInKiloByte: 64, // FunctionAppResourceId should be the Azure Resource ID of your Azure Function functionAppResourceId: "/subscriptions/your-subscription-id/resourceGroups/your-rg/providers/Microsoft.Web/sites/your-function-app-name/functions/your-function-name", }, }, }, filter: { includedEventTypes: ["Microsoft.EventGrid.AllEvents"], // Customize your filter as needed }, }); // Export the primary endpoint of the Event Grid Topic export const endpoint = eventGridTopic.endpoint;

    This program sets up the cloud resources you'll need to integrate Azure Event Grid with Purview. It performs the following actions:

    • It creates a new Resource Group to keep the resources.
    • It then provisions a new Azure Purview Account inside that Resource Group with a System-assigned managed identity.
    • Next, it creates a new Event Grid Topic, which is where you can send your events to.
    • Afterwards, it sets up an Event Subscription on the Event Grid Topic, configuring the destination as an Azure Function where you might have customization or additional handling before forwarding it to Purview.
    • At the end of the program, it exports the endpoint of the Event Grid Topic so you can send events to it.

    You would replace FunctionAppResourceId with the actual Resource ID of your Azure Function or any other event handler that you wish to use. The event handler should forward events to your Purview account, possibly after some form of processing if needed.

    Keep in mind that to actually process these events within Purview, you may need additional configurations depending on the data events that you're receiving and how you want to process them within Purview. This may involve setting up custom event handlers or Azure Functions for more complex integrations.

    Remember to replace placeholders (like "your-subscription-id", "your-rg", etc.) with your actual Azure resource identifiers and update the location as needed to match your target deployment region.