Microsoft Defender XDR
General

Configure Event Hub

In brief

The article clarifies resource provider registration, app and service principal creation, client-secret handling, namespace settings, resource ID retrieval, and event hub choices.

What Defender admins need to know

Administrators configuring a new integration should save the client secret before leaving the page because it is displayed only once.

Summaries are generated from the documentation change itself.

Documentation change

The comparison below shows only the changed extract. Use the full-page view for complete context.

ms.collection:

  • m365-security
  • tier2 ms.custom: admindeeplinkDEFENDER, msecd-doc-authoring-10141016 ms.topic: how-to ms.date: 06/16/07/02/2026 appliesto:
  • Microsoft Defender XDR ai-usage: ai-assisted

Learn how to configure Azure Event Hubs so that your event hub namespace can ingest events from Microsoft Defender XDR. This article walks you through registering the required resource provider, creating a Microsoft Entra app registration, setting up an Event Hubs namespace with the correct permissions, and configuring Microsoft Defender XDR to stream event data to your event hubs.

Set up the required Resource Provider in the Event Hubs subscription

Register the required resource provider in theyour Azure subscription where you plan to deployfor Event Hubs.

  1. Sign in to the Azure portal.
  2. Select Subscriptions > { Select the subscription the event hubs will be deployed to } > Resource providers.
  3. Verify whether theCheck that Microsoft.Insights Provider is registered. Otherwise,If not, register it.

:::image type="content" source="media/configure-event-hub/f893db7a7b1f7aa520e8b9257cc72562.png" alt-text="The list of service providers page in the Microsoft Azure portal" lightbox="media/configure-event-hub/f893db7a7b1f7aa520e8b9257cc72562.png":::

Set up Microsoft Entra App Registration

A service principal is the identity your app uses to access Azure resources. When you create an app registration, Azure automatically creates a service principal for it.

  1. Create a new registration (which inherently creates a service principal) in Microsoft Entra ID > App registrations > New registration. This step also creates a service principal.

  2. Fill out the form with just the Name (noName. No Redirect URI is required).required.

    :::image type="content" source="media/configure-event-hub/336bc84e6be23900c43232b4ef0c253c.png" alt-text="The application name display section in the Microsoft Azure portal" lightbox="media/configure-event-hub/336bc84e6be23900c43232b4ef0c253c.png":::

  3. Create a secret by clicking on Certificates & secrets > New client secret:

:::image type="content" source="media/configure-event-hub/d2ef88d3d2310d2c60c294b569cdf02e.png" alt-text="The Client secret section in the Microsoft Azure portal" lightbox="media/configure-event-hub/d2ef88d3d2310d2c60c294b569cdf02e.png":::

Microsoft Graph APIs use this client secret to authenticate your app registration.

Set up Event Hubs namespace

  1. Create an Event Hubs Namespace:

    Go to Event Hub > Add. Select the pricing tier, throughput units, and Auto-Inflate settings for your expected load. Auto-Inflate requires standard pricing. For more information, see Pricing - Event Hubs | Microsoft Azure.

:::image type="content" source="media/configure-event-hub/ebc4ca37c342ad1da75c4aee4018e51a.png" alt-text="The event hubs section in the Microsoft Azure portal" lightbox="media/configure-event-hub/ebc4ca37c342ad1da75c4aee4018e51a.png":::

  1. Get the Resource ID for this namespace. Go to your Event Hubs namespace page > Properties. Copy the Resource ID value and save it for the Microsoft 365 configuration.

    :::image type="content" source="media/configure-event-hub/759498162a4e93cbf17c4130d704d164.png" alt-text="The event hubs properties section in the Microsoft Azure portal" lightbox="media/configure-event-hub/759498162a4e93cbf17c4130d704d164.png":::

Set up Event Hubs

You can send all selected event types to a single event hub or create a separate event hub for each event type. Choose the option that fits your needs.

Option 1:

You can create Event Hubs within your Namespace and all the Event Types (Tables) you select to export are written into this one Event Hub.

:::image type="content" source="media/configure-event-hub/005c1f6c10c34420d387f594987f9ffe.png" alt-text="An event hubs section in the Microsoft Azure portal" lightbox="media/configure-event-hub/005c1f6c10c34420d387f594987f9ffe.png":::

If you choose Option 2, don't manually create event hubs. Instead, skip to Configure Microsoft Defender XDR to export email tables to Event Hubs to set up the export in the Defender portal. Microsoft Defender XDR creates the event hubs for you.

::To create event hubs in your namespace, select Event Hub > + Event Hub.

A higher partition count allows more throughput. Increase this value based on your expected load. Use the default values for Message Retention (1) and Capture (Off).

:::image type="content" source="media/configure-event-hub/d2ef88d3d2310d2c60c294b569cdf02e.1db04b8ec02a6298d7cc70419ac6e6a9.png" alt-text="The Client secretAn event hubs creation section in the Microsoft Azure portal" lightbox="media/configure-event-hub/d2ef88d3d2310d2c60c294b569cdf02e.1db04b8ec02a6298d7cc70419ac6e6a9.png":::

This client secret value is used by Microsoft Graph APIs to authenticate the Microsoft Entra app registration you created.

Set up Event Hubs namespace

  1. Create an Event Hubs Namespace:

    Go to Event Hub > Add and select the pricing tier, throughput units and Auto-Inflate (requires standard pricing and under features) appropriate for the load you're expecting. For more information, see Pricing - Event Hubs | Microsoft Azure.

:::image type="content" source="media/configure-event-hub/ebc4ca37c342ad1da75c4aee4018e51a.png" alt-text="The event hubs section in the Microsoft Azure portal" lightbox="media/configure-event-hub/ebc4ca37c342ad1da75c4aee4018e51a.png":::

  1. You need the Resource ID of this Event Hubs Namespace. Go to your Azure Event Hubs namespace page > Properties. Copy the text under Resource ID and record it for use during the Microsoft 365 Configuration.

    :::image type="content" source="media/configure-event-hub/759498162a4e93cbf17c4130d704d164.png" alt-text="The event hubs properties section in the Microsoft Azure portal" lightbox="media/configure-event-hub/759498162a4e93cbf17c4130d704d164.png":::

Set up Event Hubs

Option 1:

You can create Event Hubs within your Namespace and all the Event Types (Tables) you select to export are written into this one Event Hub.

:::image type="content" source="media/configure-event-hub/005c1f6c10c34420d387f594987f9ffe.png" alt-text="An event hubs section in the Microsoft Azure portal" lightbox="media/configure-event-hub/005c1f6c10c34420d387f594987f9ffe.png":::

If you choose Option 2 (one event hub per event type), skip the manual event hub creation steps below and go directly to the "Configure Microsoft Defender XDR to send email tables" section, where you configure the export settings in the Defender portal.

Create Event Hubs within your Namespace by selecting Event Hub > + Event Hub.

The Partition Count allows for more throughput via parallelism, so it's recommended to increase this number based on the load you're expecting. Default Message Retention and Capture values of 1 and Off are recommended.

:::image type="content" source="media/configure-event-hub/1db04b8ec02a6298d7cc70419ac6e6a9.png" alt-text="An event hubs creation section in the Microsoft Azure portal" lightbox="media/configure-event-hub/1db04b8ec02a6298d7cc70419ac6e6a9.png":::

Configure Microsoft Defender XDR to sendexport email tables to Event Hubs

After your Event Hubs namespace and event hubs are set up, configure Microsoft Defender XDR to export event data through Event Hubs.

Set up Microsoft Defender XDR to send Emailemail tables to Splunk viathrough Event Hubs

Use the following steps to configure Microsoft Defender XDR to export email tables to Splunk through Event Hubs.

  1. Sign in to Microsoft Defender XDR with anBefore you begin, make sure your account that meets allhas the following role requirements:roles:

    • Contributor role (or higher) at the Event Hubs Namespace Resourceresource level or higher for the Event Hubs thatevent hubs you're be exporting to. An exportWithout this role, an error occurs when you try to save the settings without this permission.export settings.

    • Security Admin Role role on the tenant tied to Microsoft Defender XDR and Azure.

    1. Sign in to Microsoft Defender XDR.

      :: :::image type="content" source="media/configure-event-hub/55d5b1c21dd58692fb12a6c1c35bd4fa.png" alt-text="The Settings page of the Microsoft Defender portal" lightbox="media/configure-event-hub/55d5b1c21dd58692fb12a6c1c35bd4fa.png":::

    2. Click on Raw Data Export > +Add.

      Use the Event Hubs namespace Resource ID,ID you recorded in Set up Event Hubs namespace, the event hub name, and the client secret values you recorded in the earlier setup steps.from Set up Microsoft Entra App Registration.

      Name: This value is local and should be whatever works in your environment.

      Forward events to event hub: Select this checkbox.

      Event-Hub Resource ID: Enter the Event Hubs namespace Resource ID you recorded during the namespace setup steps.in Set up Event Hubs namespace.

      Event-Hub name: If you created an Event Hubs insideevent hub in your Event Hubs Namespace,namespace during Set up Event Hubs, paste the Event Hubsthat event hub name you previously recorded.here.

      If you choose to let Microsoft Defender XDR create Event Hubs per Event Types (Tables) for you, leave the Event-Hub name field empty.

    3. Make sure to click Submit.

    Verify that the events are being exportedevent export to the Event Hubs

    You can verify that events are being sent to the Event Hubs by running a basic Advanced Hunting query. The query uses the EmailEvents, EmailAttachmentInfo, EmailUrlInfo, and EmailPostDeliveryEvents Advanced Hunting tables to confirm that email-related data is flowing through the export pipeline. Select Hunting > Advanced Hunting > Query and enter the following query:query. This query uses full outer joins to correlate email events with attachment, URL, and post-delivery details by NetworkMessageId, giving you a count of all email activity in the last hour:

    EmailEvents