I thought that this would be very easy job to do, but as I have researched, I found nothing on how to rename a file or directory in Azure Storage.
I don't want to do a copy/delete (the size of files/directories is very large), I just want to change the name of a given file/directory programmatically through C#.
Edit: I'm talking about CloudFile/CloudFileDirectory objects.
Can someone help me?
To rename a file or a folder, simply select the file or folder and either click the “Rename” button from the top button bar or invoke the context menu and choose “Rename…” option. You can then specify the new name for the file or folder in the popup window that opens up.
Azure File Storage and Blob Storage offer the same level of redundancy, but Azure Blob Storage is cheaper than File Storage. Azure File Storage provides the folder for the data storage, while Azure Blob Storage does not provide the folder. They give a flat structure for data storage.
Blob Storage supports Azure Data Lake Storage Gen2, Microsoft's enterprise big data analytics solution for the cloud. Azure Data Lake Storage Gen2 offers a hierarchical file system as well as the advantages of Blob Storage, including: Low-cost, tiered storage.
Answers. You would need to create a new storage account, copy content of the existing storage account, and delete it afterwards.
You talk about Azure Files. Similar to Azure Blob Storage, there is no rename / move feature thus you have to copy the file (e. g. using StartCopyAsync
) and then delete it using the CloudFile.DeleteAsync
method.
I wrote a blog article about how to Rename Azure Storage Blob using PowerShell (same probably applies to Azure Files)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With