Storage account information

John 1 Reputation point
2021-03-25T13:47:08.2+00:00

I require information on all of our storage accounts, currently we have over 300 and have reached our quota in weu. I need to find out which storage accounts are not being used, and what data if any is held within these storage accounts. Ideally when they were last used, for instacen maybe not accessed in the last 90 days. I don't wish to manually go through these as that's time consuming. We also don't have logging available so am unable to utilise the monitoring aspect of things. Is there a script available that I could use? Many Thanks John

Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,687 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. shiva patpi 13,131 Reputation points Microsoft Employee
    2021-03-25T22:59:24.757+00:00

    Hello @John ,
    Thanks for your query !
    Can you try out the script mentioned here in the article

    Below piece of code validates and removes based upon the last modified date of the container

    Below code goes one level deep i.e. along with container it also checks for the last modified date of the blob.

    Based upon your requirements you can use either of those.

    Before you run the code , I would suggest to comment the command "Remove-AzStorageAccount" and just do a write-host $StorageAccountName,$LastModified just for review and do a sample test from your end.

    Couple of best practices:
    Before you remove the storage account , try to enable "Soft Delete" feature set it for X number of days. So this way your data can be retained for those number of days
    Also , you can recover the storage account if you feel the account was deleted unexpectedly . Use the article below
    https://learn.microsoft.com/en-us/azure/storage/common/storage-account-recover#:~:text=To%20recover%20a%20deleted%20storage%20account%20from%20within,the%20Recover%20button%20to%20restore%20the%20account.

    Happy Scripting and all the very best !

    If the above answers helps you out , kindly don't forget to Upvote and Accept the Answer

    0 comments No comments