Export Logs to Azure Blob Storage

The Auth0 Logs to Azure Blob Storage extension consists of a scheduled job that exports your Auth0 logs to the Azure service that stores unstructured object data, such as text or binary data, in the cloud as objects/blobs. This document will guide you through the process of setting up this integration.

To learn more, see Azure Blob Storage in Microsoft documentation.

This document will guide you through the process of setting up this integration.

Retrieve required information from Azure Portal

First, you must get the account name, account key, and container name from Azure Portal.

  1. Log in to your Azure portal account.

  2. From the left menu, click Storage accounts and select your storage account (or create a new one with Kind set to Storage). For this example, we created a storage account called azureauth0logs. This is the storage account name; make note of this value because you will need it in the next section.

    Dashboard - Extensions - Azure - Storage Account Name
  3. Click your storage account name. The Overview tab opens.

  4. From the Blob Service section, click Containers. Find your storage container (or create a new one). For this example, we created a container called auth0. This is the storage container name; make note of this value because you will need it in the next section.

    Dashboard - Extensions - Azure - Storage Account Name
  5. From the Settings section, click Access keys. Copy either storage account key value; you will need it in the next section.

    Dashboard - Extensions - Azure - Storage Account Key

Configure the extension

To install and configure this extension:

  1. Navigate to Auth0 Dashboard > Extensions, and select Auth0 Logs to Azure Blob Storage. The Install Extension window opens.

    Dashboard - Extensions - Azure - Extension Mgmt Azure
  2. Set the following configuration parameters, and select Install:

  • Schedule: The frequency with which logs should be exported. The schedule can be customized even further after creation.

  • BATCH_SIZE: The number of logs to be sent per batch. Maximum is 100. Logs are batched before sending, and multiple batches are sent each time the extension runs.

  • Storage_Account_Name: The name of the Azure storage account to which you want the extension to export logs. Enter the storage account name value you retrieved in the previous section.

  • Storage_Account_Key: The access key associated with your storage account. Enter the access key value you retrieved in the previous section.

  • Storage_Container_Name: The name of the specific container within the storage account you would like to use. Enter the storage container name value you retrieved in the previous section.

The integration between Auth0 and Azure Blob Storage is now in place!

Batch size

When setting your BATCH_SIZE, please keep the following information in mind.

During each time frame/window (defined by your chosen Schedule), outstanding logs will be batched into groups and sent. The size of each group is determined by the BATCH_SIZE value.

In other words, during each window, NUM_BATCHES batches of logs will be sent based on the following logic:

IF (NUM_LOGS modulo 100 == 0): NUM_BATCHES = (NUM_LOGS / BATCH_SIZE) ELSE: NUM_BATCHES = (NUM_LOGS / BATCH_SIZE) + 1

In the ELSE case, the last batch will have < 100 logs.

View results

The integration you just set up created a scheduled job that is responsible for exporting the logs. To view this scheduled job:

  1. Navigate to Auth0 Dashboard > Extensions, and select Installed Extensions.

  2. Select Auth0 Logs to Azure Blob Storage. The job you just created appears. You can modify its state by toggling the State switch, see when the next run is due, and see the result of the last execution.

    Dashboard - Extensions - Azure - View Cron Jobs

You can view more details by clicking on the job you created. On this page, you can view details for each execution, reschedule the job, access realtime logs, and more.

Dashboard - Extensions - Azure - View Cron Details

That's it; you are done! Your Auth0 Logs are now pushed to Azure and stored as objects at your storage account. You can view them by navigating to your Microsoft Azure Portal.