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:
Enable the Event Grid resource provider.
Configure the Auth0 event stream.
Configure an event handler, which is the app or service to which the event will be sent.
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.
Log in to your Azure portal.
Select the subscription you’re using for Event Grid.
From the left menu, under Settings, select Resource providers.
Microsoft.EventGrid, and select Register.
Refresh to make sure the status changes to
Configure the Auth0 event stream
Go to Dashboard > Monitoring > Streams and click Create Stream.
Select Azure Event Grid and enter a unique name for your new stream.
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.
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.
Log in to the Azure Portal.
Partner Topics, and click Event Grid Partner Topics under services.
Click on the topic that matches the stream you created in the Auth0 Dashboard.
Confirm that Source matches your Auth0 account.
Subscribe to your Partner Topic
Subscribe to your Event Grid Partner Topic to tell Event Grid which events to send to your event handler.
On the Event Grid Partner Topic Overview page, click + Event Subscription.
Enter a name for the event subscription.
Select your desired Azure service or WebHook for the Endpoint type.
Follow the instructions for the particular service.
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.
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.