Tutorial: Archive Azure AD logs to an Azure storage account
In this tutorial, you learn how to set up Azure Monitor diagnostics settings to route Azure Active Directory (Azure AD) logs to an Azure storage account.
To use this feature, you need:
- An Azure subscription with an Azure storage account. If you don't have an Azure subscription, you can sign up for a free trial.
- An Azure AD tenant.
- A user who's a global administrator or security administrator for the Azure AD tenant.
Archive logs to an Azure storage account
Sign in to the Azure portal.
Select Azure Active Directory > Activity > Audit logs.
Select Export Settings.
In the Diagnostics settings pane, do either of the following:
To change existing settings, select Edit setting.
To add new settings, select Add diagnostics setting.
You can have up to three settings.
Enter a friendly name for the setting to remind you of its purpose (for example, Send to Azure storage account).
Select the Archive to a storage account check box, and then select Storage account.
Select the Azure subscription and storage account that you want to route the logs to.
Select OK to exit the configuration.
Do either or both of the following:
- To send audit logs to the storage account, select the AuditLogs check box.
- To send sign-in logs to the storage account, select the SignInLogs check box.
Use the slider to set the retention of your log data. By default, this value is 0, which means that logs are retained in the storage account indefinitely. If you set a different value, events older than the number of days selected are automatically cleaned up.
Select Save to save the setting.
After about 15 minutes, verify that the logs are pushed to your storage account. Go to the Azure portal, select Storage accounts, select the storage account that you used earlier, and then select Blobs. For Audit logs, select insights-log-audit. For Sign-in logs, select insights-logs-signin.