Enable capturing of events streaming through Azure Event Hubs

Azure Event Hubs Capture enables you to automatically deliver the streaming data in Event Hubs to an Azure Blob storage account of your choice.

Important

Event Hubs doesn't support capturing events in a premium storage account.

Enable Capture when you create an event hub

If you don't have an Event Hubs namespace to work with, create a standard tier namespace by following steps from the article: Create an Event Hubs namespace. Make sure that you select Standard for the pricing tier. The basic tier doesn't support the Capture feature.

To create an event hub within the namespace, follow these steps:

  1. On the Overview page for your namespace, select + Event hub on the command bar.

    Screenshot of the selection of Add event hub button on the command bar.

  2. On the Create event hub page, type a name for your event hub, then select Next: Capture at the bottom of the page.

    Screenshot of the Create event hub page.

  3. On the Capture tab, select On for Capture.

  4. Drag the slider to set the Time window in minutes. The default time window is 5 minutes. The minimum value is 1 and the maximum is 15.

  5. Drag the slider to set the Size window (MB). The default value is 300 MB. The minimum value is 10 MB and the maximum value is 500 MB.

  6. Specify whether you want Event Hubs to emit empty files when no events occur during the Capture time window.

See one of the following sections based on the type of storage you want to use to store captured files.

Capture data to Azure Storage

  1. For Capture Provider, select Azure Storage Account (default).

  2. For Azure Storage Container, click the Select the container link.

    Screenshot that shows the Create event hub page with the Select container link.

  3. On the Storage accounts page, select the storage account that you want to use to capture data.

  4. On the Containers page, select the container where you want to store captured files, and then click Select.

    Because Event Hubs Capture uses service-to-service authentication with storage, you don't need to specify a storage connection string. The resource picker selects the resource URI for your storage account automatically. If you use Azure Resource Manager, you must supply this URI explicitly as a string.

  5. Now, on the Create event hub page, confirm that the selected container shows up.

  6. For Capture file name format, specify format for the captured file names.

  7. Select Review + create at the bottom of the page.

  8. On the Review + create page, review settings, and select Create to create the event hub.

    Note

    If public access is disabled on the storage account, allow trusted services, which include Azure Event Hubs, to access the storage account. For details and step-by-step instructions, see this article.

Capture data to Azure Data Lake Storage Gen 2

Follow Create a storage account article to create an Azure Storage account. Set Hierarchical namespace to Enabled on the Advanced tab to make it an Azure Data Lake Storage Gen 2 account. The Azure Storage account must be in the same subscription as the event hub.

  1. Select Azure Storage as the capture provider. To use Azure Data Lake Storage Gen2, you select Azure Storage.

  2. For Azure Storage Container, click the Select the container link.

    Screenshot that shows the Create event hub page with the Select container link.

  3. Select the Azure Data Lake Storage Gen 2 account from the list.

    Screenshot showing the selection of Data Lake Storage Gen 2 account.

  4. Select the container (file system in Data Lake Storage Gen 2), and then click Select at the bottom of the page.

    Screenshot that shows the Containers page.

  5. For Capture file name format, specify format for the captured file names.

  6. Select Review + create at the bottom of the page.

    Screenshot that shows the Create event hub page with all the fields specified.

  7. On the Review + create page, review settings, and select Create to create the event hub.

    Note

    The container you create in an Azure Data Lake Storage Gen 2 using this user interface (UI) is shown under File systems in Storage Explorer. Similarly, the file system you create in a Data Lake Storage Gen 2 account shows up as a container in this UI.

Next steps