Migrate from diagnostic settings storage retention to Azure Storage lifecycle management
The Diagnostic Settings Storage Retention feature is being deprecated. To configure retention for logs and metrics use Azure Storage Lifecycle Management.
This guide walks you through migrating from using Azure diagnostic settings storage retention to using Azure Storage lifecycle management for retention.
- March 31, 2023 – The Diagnostic Settings Storage Retention feature will no longer be available to configure new retention rules for log data. If you have configured retention settings, you'll still be able to see and change them.
- September 30, 2023 – You will no longer be able to use the API or Azure portal to configure retention setting unless you're changing them to 0. Existing retention rules will still be respected.
- September 30, 2025 – All retention functionality for the Diagnostic Settings Storage Retention feature will be disabled across all environments.
An existing diagnostic setting logging to a storage account.
To migrate your diagnostics settings retention rules, follow the steps below:
Go to the Diagnostic Settings page for your logging resource and locate the diagnostic setting you wish to migrate
Set the retention for your logged categories to 0
Navigate to the storage account you're logging to
Under Data management, select Lifecycle Management to view or change lifecycle management policies
Select List View, and select Add a rule
Enter a Rule name
Under Rule Scope, select Limit blobs with filters
Under Blob Type, select Append Blobs and Base blobs under Blob subtype.
Set your retention time, then select Next
On the Filters tab, under Blob prefix set path or prefix to the container or logs you want the retention rule to apply to.
For example, for all Function App logs, you could use the container insights-logs-functionapplogs to set the retention for all Function App logs. To set the rule for a specific subscription, resource group, and function app name, use insights-logs-functionapplogs/resourceId=/SUBSCRIPTIONS/<your subscription Id>/RESOURCEGROUPS/<your resource group>/PROVIDERS/MICROSOFT.WEB/SITES/<your function app name>.
Select Add to save the rule.