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.
For a full list of the event type codes that Auth0 supports, see Log Event Type Codes.
Steps
To send Auth0 events to Azure, you will need to:
Enable the Event Grid resource provider
Set up an event source (in this case, this is Auth0)
Set up an event handler, which is the app or service to which the event will be sent
Test the integration
To learn more, see Microsoft's Concepts in Azure Event Grid.
Enable Event Grid resource provider
If you haven’t previously used Event Grid, you will need to 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 Subscriptions.
Select the subscription you’re using for Event Grid.
From the left menu, under Settings, select Resource providers.
Locate
Microsoft.EventGrid
, and select Register.Refresh to make sure the status changes to
Registered
.
Set up Auth0 as event source
Use the Auth0 Dashboard to set up Auth0 for use as an event source.
Log in to the Auth0 Dashboard.
Navigate to Logs > Streams.
Click + Create Stream.
Select Azure Event Grid, and enter a unique name for your new stream.
Provide the following settings for your Event Grid stream:
Setting Description Name A unique display name to distinguish this integration from other integrations. Azure Subscription ID The unique alphanumeric string that identifies your Azure subscription. Azure Region The region in which your Azure subscription is hosted. Resource Group name The name of the Azure resource group, which allows you to manage all Azure assets within one subscription. Click Save.
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.
Search for
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.
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.
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.
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 integration
To verify that the integration is working as expected:
Log in to the Auth0 Dashboard.
Navigate to Logs > Streams.
Click on your Event Grid log stream.
Click the Health tab. The stream should be active. As long as you don't see any errors, the stream is working.
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.