Delete files
  • 12 Oct 2020
  • 2 Minutes to read
  • Dark
  • PDF

Delete files

  • Dark
  • PDF

Article Summary

Azure Files offers fully managed file shares in the cloud accessible via the industry standard: Server Message Block (SMB) protocol or Network File System (NFS) protocol. Azure Files can be used to replace or supplement traditional on-premises file servers completely.

Azure File Storage has proven useful for many organizations, especially in "lifting and shifting" applications to the cloud that expect a file share to store file application or user data. These stored files in Azure file shares might not be of use after time. Hence removing unwanted content from Azure file share becomes a business need.

Deleting files in a Storage Account File Share

The files can be deleted either through inline or scheduled automated tasks based on the business requirement. Purging files can be done by specifying at least one of the following conditions.

  • File Modified time
  • File Name constraints

Files that are deleted will be permanently erased unless snapshot of the file share or backup is taken.

Delete files through scheduled automated task

If deleting the files in the file share is repetitive, then the scheduled automated task is the best choice. This automated task can be scheduled to run on a daily or hourly basis.

Delete files 1.gif

This capability is not found both in the Azure portal and in the Storage Explorer. Serverless360 fills this gap to automate the process of clearing contents from Storage Account file shares.

Deleting Files based on Modified time

Users can initially specify the time duration during automated task configuration. Now the files modified before the specified time duration will be purged.

Deleting Files based on name constraints

For purging files in the file share based on the file name, the user can specify the name conditions, and the files will be automatically purged by the Automated Task when the conditions are met.

Choose a condition from the available conditions in the drop-down and set the value to be checked. Users can even add more than one condition.

Delete files 2.gif

Include Directories to purge along with files

When this option is enabled, the configurations specified to purge files (Modified At or Before time and Name constraints) will also be applied to the file share's directories. When the Automated task runs, and when the specified conditions are met for a directory, the directory and all the files and subdirectories it contains will be deleted.

We'd love to hear your thoughts

Please visit our feedback system to suggest new Features or Enhancements. You can also take a look at our Roadmap

Was this article helpful?