10 thoughts on “Move Files Between Azure File Share Tiers”

Leave a comment...

  1. I have tested this script – I am getting an issue that this script is only moving files from the base folder. The script is not moving files from folders or subfolders.
    Can you give me a script in which I can move directories/subdirectories as well in cold storage?

  2. Hello Muhammad, thanks for testing this script and providing feedback!
    Yes, the limitation that you mentioned is in the API side of Azure Files and not in this script.
    Today, the list directories and files operation returns a list of files or directories under the specified share or directory.
    It lists the contents ONLY for a single level of the directory hierarchy.
    Hopefully, Microsoft will address this limitation in the next version of this API.
    I’ll update this article as soon as I have any news.

  3. Great writing Charbel!!
    Just like many others, I’m indeed waiting for an integrated solution from Microsoft. Till then I’ll use your solution. Thank you so much!
    Cheers, Marco

  4. I tested it out with a 1 day access setting and it doesn’t appear to do anything. There are no errors or warnings.

  5. Hello Joe, thanks for reporting this issue!
    Please note that I updated the script to leverage Azure PowerShell 7.2 runbooks in Azure Automation without using Azure Container Instances (ACI) and AzCopy anymore. This improves performance and reduces costs.
    Get a copy of the new script from above, then try again.
    Please make sure to select the correct runtime PowerShell version. This automation tool will use the PowerShell Az modules targeting the 7.2 runtime version and NOT 5.1.
    I tested it and it works as expected with 1 day access.
    Hope it helps!

  6. Hello Charbel,

    Thanks for sharing this solution, I have been looking for similar one to achieve our requirement. Unfortunately, when I was testing this script instead of returning last accessed timestamp which was giving me back with last modified timestamp. For which I was going through with Microsoft article and identified the below article which have mentioned about supported metadata, I would like to check with you is there any other way to get the last accessed time stamp.

    https://learn.microsoft.com/en-us/azure/storage/files/storage-files-migration-overview#supported-metadata

    Also, I would like to have your suggestion on our requirement. We have a huge volume of data in Azure file share on different storage accounts, basically we are trying to identify the data which was last accessed before 6 months and move those data from Hot to Cool tier.

    Your response would be much appreciated.

    Thanks.

  7. Hello, Ganesh; thank you for the comment and for sharing your use case.
    Today, Azure Files does not currently track the last access time.
    Unfortunately, there is no other way to get the last accessed time stamp. Hopefully, things will change in the not-too-distant future.
    I will update the guide once the last access time is tracked.

Let us know what you think, or ask a question...