Rename blobs without needing to copy them
Copying blobs in order to rename them is a heavy operation, especially when the blob is big, or when you need to change many files, such as when changing a directory name.
Our apologies for not updating this ask earlier. Renaming Blobs is on our backlog, but is unlikely to be released in the coming year. Today, you can use the “Copy Blob” API as a workaround.
Using the Azure Files service you can address Azure Storage like a network share using the SMB2.1 protocol. This enables usage of normal Windows API’s to rename files and directories. You can get started with the Files service by visiting https://docs.microsoft.com/en-us/azure/storage/storage-dotnet-how-to-use-files.
For any further questions, or to discuss your specific scenario, send us an email at email@example.com.
Christopher Warrington commented
I would like to be able to rename blobs so I can have them in a different namespace while they are being created/uploaded to. Then, after they are finalized, they can be renamed to their "published" location. Couple this with per-blob expiration and implement atomic rename-and-reset-TTL, then blob upload error recovery becomes trivial: start uploading to a temporary blob with a short TTL, when done, rename-and-reset-TTL to the final name. If anything goes wrong, the partial blob will just go away automatically.
+1, this limitation is slowing down my deployment pipeline. Please add this.
Martin Brandl commented
Until we get a clean solution that don't require to copy and delete a file, You can use my convenience cmdlet: Rename-AzureStorageBlob:
Zeke Victor commented
It's too bad this can't be prioritized. For a folder containing many, many files, a rename not only requires COPY + DELETE but must also be done on an individual file basis instead of at the folder level.
Paul Bergeron commented
In my humble opinion, this is not a "nice to have" but essential to most anyone using this api.
Lawrence Smith commented
Not only is this a forced copy/delete operation, it's not even being done server side. Doing it through Azure Storage Explorer, I can see that I'm egressing/rewriting every file back to the machine that started the folder rename. At least let it be server side!?
It seems pretty clear that there is no plan to allow Blob renaming. What would be nice is the architectural reason why.
Mayank Patel commented
We tried the nextwork share idea but you can not rename the folder instead it copy the contents of folder to new folder. Same behaviour as Azure blob. Any idea when this functionality will be avaialble. It has been four years since original request was made.
you can try "KrojamSoft: BatchRenameFiles Tool". i've used it so many times for this familiar work..
Azure Files services workaround is definitely not what we asked :(. We want a fast and cost effective solution to rename blobs. As someone said, this is an extremely basic feature when it comes to storage.
I understand there are very interesting features being actively developed, but I think such a basic feature should receive a bit more attention (almost 4 years since it was suggested and it is still not planned).
I hope we can see this planned for early 2018 at least ;)
I don't understand why renaming/moving blobs wasn't included in Azure Storage from day 1 - there's already a HTTP verb for moving entities (from WebDAV): MOVE and COPY, it should be trivial to implement.
azure restore did not let me chose the name of my restored VHD. Now I can't generalize the image because the Azure generalize command doesn't like the name that Azure chose while restoring my virtual machine. The fact that Azure thinks it is best to chose names for me is ridiculous. I am an administrator and shouldn't be forced to have UID's in the names of my Azure entities.
Similar need as the nuget team, I have some files staged in on directory and I need to move them to the final one without a download/upload op
Yishai Galatzer commented
This is a really useful feature for us (The NuGet team), we have one main scenario. We want to avoid having to copy large packages over http from a preliminary upload location to the final visible location
This is relevant for those of us trying to do automation with IaaS resources. For example, using powershell to restore Azure Backup VM to a storage account results in blobs with random name. Also, provisioning a VM from a custom image results in random vhd file names.