As per MSDN: Azure Storage Analytics performs logging and provides metrics data for a storage account. You can use this data to trace requests, analyze usage trends, and diagnose issues with your storage account.
Storage Analytics doesn’t delete any logging data and keeps writing till reaches 20 TB limit.
So it’s important to understand the limit as once it reaches the limit, storage analytics will not write anything till some free space is avail.
Also read: Download Blobs from Azure Container using PowerShell
We can handle the situation in two ways with below option.
1. Manually Delete requests
2. Set retention Policy (My preference )
Configure data retention policy for both logging and metrics data.
Storage Analytics metrics are available for the Blob, Queue, Table, and File services.
Storage Analytics logging is available for the Blob, Queue, and Table services.
For our project it was Blob storage and follow steps to do the changes.
You can set the retention policy with C# or powershell script code.
I will be sharing the powershell script to set the property.
1. Get the storage analytics configuration file.
StorageAnalytics.exe -a <account> -k <key> -t blob -get > D:\sam\blob.xml
2. Edit the xml file based on below highlighted section.
3. Now upload the updated xml file to apply the changes.
StorageAnalytics.exe -a <account> -k <key> -t blob -set D:\sam\blob.xml
Hope this will be helpful.