Create an Event Grid data connection for Azure Data Explorer

In this article, you learn how to ingest blobs from your storage account into Azure Data Explorer using an Event Grid data connection. You'll create an Event Grid data connection that sets an Azure Event Grid subscription. The Event Grid subscription routes events from your storage account to Azure Data Explorer via an Azure Event Hubs.

For general information about ingesting into Azure Data Explorer from Event Grid, see Connect to Event Grid.

Note

To achieve the best performance with the Event Grid connection, set the rawSizeBytes ingestion property via the blob metadata. For more information, see ingestion properties.

Prerequisites

Create an Event Grid data connection

In this section, you'll establish a connection between Event Grid and your Azure Data Explorer table.

  1. Under the cluster you created, select Databases > TestDatabase.

    Screenshot of the Databases page, showing a database.

  2. Select Data ingestion > Add data connection.

    Screenshot of the Data ingestion page, showing the add data connection option.

  3. Under Basics, select the connection type: Blob storage and then fill out the form with the following information:

    Screenshot of the Data Connection Basics tab, showing the options for the Blob storage connection type.

    Setting Suggested value Field description
    Data connection name test-grid-connection The name of the connection that you want to create in Azure Data Explorer.
    Storage account subscription Your subscription ID The subscription ID where your storage account is.
    Storage account gridteststorage1 The name of the storage account that you created previously.
    Event type Blob created or Blob renamed The type of event that triggers ingestion. Blob renamed is supported only for ADLSv2 storage. To rename a blob, navigate to the blob in Azure portal, right-click on the blob and select Rename. Supported types are: Microsoft.Storage.BlobCreated or Microsoft.Storage.BlobRenamed.
    Resources creation Automatic Define whether you want Azure Data Explorer to create an Event Grid Subscription, an Event Hubs namespace, and an Event Hubs for you. To create resources manually, see Manually create resources for Event Grid ingestion
  4. Select Filter settings if you want to track specific subjects. Set the filters for the notifications as follows:

    • Prefix field is the literal prefix of the subject. As the pattern applied is startswith, it can span multiple containers, folders, or blobs. No wildcards are allowed.
      • To define a filter on the blob container, the field must be set as follows: /blobServices/default/containers/[container prefix].
      • To define a filter on a blob prefix (or a folder in Azure Data Lake Gen2), the field must be set as follows: /blobServices/default/containers/[container name]/blobs/[folder/blob prefix].
    • Suffix field is the literal suffix of the blob. No wildcards are allowed.
    • Case-Sensitive field indicates whether the prefix and suffix filters are case-sensitive
    • For more information about filtering events, see Blob storage events.

    Screenshot of the Filter settings form, showing the filter parameters.

  5. Select Next: Ingest properties.

  6. Fill out the form with the following information. Table and mapping names are case-sensitive:

    Screenshot of the Data Connection Ingest properties tab, showing the target table properties.

    Ingest properties:

    Setting Suggested value Field description
    Allow routing the data to other databases (Multi database data connection) Don't allow Turn on this option if you want to override the default target database associated with the data connection. For more information about database routing, see Events routing.
    Table name TestTable The table you created in TestDatabase.
    Data format JSON Supported formats are Avro, CSV, JSON, MULTILINE JSON, ORC, PARQUET, PSV, SCSV, SOHSV, TSV, TXT, TSVE, APACHEAVRO, RAW, and W3CLOG. Supported compression options are Zip and Gzip.
    Mapping TestMapping The mapping you created in TestDatabase, which maps incoming data to the column names and data types of TestTable. If not specified, an identity data mapping derived from the table's schema is used.
    Advanced settings My data has headers Ignores headers. Supported for *SV type files.

    Note

    You don't have to specify all Default routing settings. Partial settings are also accepted.

  7. Select Next: Review + create

  8. Under *Review + create.

  9. Review the resources that were auto created for you and select Create.

    Screenshot of the Data Connection Review and create tab, showing a summary of the selected data connection settings.

  10. Wait until the deployment is completed. If your deployment failed, select Operation details next to the failed stage to get more information for the failure reason. Select Redeploy to try to deploy the resources again. You can alter the parameters before deployment.

    Screenshot of Deploy Event Grid overview page, showing a failed deployment.

Remove an Event Grid data connection

To remove the Event Grid connection from the Azure portal, do the following:

  1. Go to your cluster. From the left menu, select Databases. Then, select the database that contains the target table.
  2. From the left menu, select Data connections. Then, select the checkbox next to the relevant Event Grid data connection.
  3. From the top menu bar, select Delete.

Next steps