Stream Logs to Azure Event Grid

Azure Event Grid is a serverless event bus that lets you send event data from any source to any destination. Using Event Grid, you can create event-driven workflows to send your Auth0 tenant logs to targets, such as Azure Functions, Event Hubs, Sentinel, and Logic Apps. To learn more, read Microsoft's Concepts in Azure Event Grid.

To learn about the event type codes that Auth0 supports, read Log Event Type Codes.

To send Auth0 events to Azure, you will need to:

  1. Enable the Event Grid resource provider.

  2. Configure the Auth0 event stream.

  3. Configure an event handler, which is the app or service to which the event will be sent.

  4. Test the configuration.

Enable Azure Event Grid resource provider

If you haven’t previously used Event Grid, register the Event Grid resource provider. If you've used Event Grid before, skip to the next section.

  1. Log in to your Azure portal.

  2. Select Subscriptions.

  3. Select the subscription you’re using for Event Grid.

  4. From the left menu, under Settings, select Resource providers.

  5. Locate Microsoft.EventGrid, and select Register.

  6. Refresh to make sure the status changes to Registered.

Configure the Auth0 event stream

  1. Go to Dashboard > Monitoring > Streams and click Create Stream.

    Dashboard Monitoring Streams

  2. Select Azure Event Grid and enter a unique name for your new stream.

    Dashboard Monitoring Streams Create Azure Event Grid Stream
  3. Click Create.

  4. Configure the event source by providing your Subscription ID, Azure Region, and Resource Group. The region you select must match the region in which your Azure Event Grid resides.

    Dashboard Monitoring Streams Azure Event Grid Settings Tab

  5. Click Save. Auth0 provides an Event Source Name. Copy and save it.

Configure the event handler in Azure

Activate your Auth0 Partner Topic in Azure

Activating the Auth0 topic in Azure allows events to flow from Auth0 to Azure.

  1. Log in to the Azure Portal.

  2. Search for Partner Topics, and click Event Grid Partner Topics under services.

  3. Click on the topic that matches the stream you created in the Auth0 Dashboard.

  4. Confirm that Source matches your Auth0 account.

  5. Click Activate.

Subscribe to your Partner Topic

Subscribe to your Event Grid Partner Topic to tell Event Grid which events to send to your event handler.

  1. On the Event Grid Partner Topic Overview page, click + Event Subscription.

  2. Enter a name for the event subscription.

  3. Select your desired Azure service or WebHook for the Endpoint type.

  4. Follow the instructions for the particular service.

  5. Click Create.

Set up event handler

Go to your Azure subscription, and spin up a service that is supported as an event handler. For a full list of supported event handlers, see Microsoft's Event Handlers in Azure Event Grid.

Test configuration

As soon as Auth0 writes the next tenant log, you should see a copy of the log Auth0 has written in JSON format at the target you defined. To learn more, read Check Log Stream Health.

Delivery attempts and retries

Auth0 events are delivered to your server via a streaming mechanism that sends each event as it is triggered. If your server is unable to receive the event, Auth0 will retry delivering it up to 3 times. If still unsuccessful, Auth0 will log the failure, and you will see the failure in the Health tab for your log stream.

Learn more