microsoft / AzureStorageExplorer

Easily manage the contents of your storage account with Azure Storage Explorer. Upload, download, and manage blobs, files, queues, tables, and Cosmos DB entities. Gain easy access to manage your virtual machine disks. Work with either Azure Resource Manager or classic storage accounts, plus manage and configure cross-origin resource sharing (CORS) rules.
Creative Commons Attribution 4.0 International
377 stars 87 forks source link

Rename ovewrite #3811

Open dtheodor opened 3 years ago

dtheodor commented 3 years ago

As stated in the ADLS Gen2 REST API, a create/rename operation can overwrite the existing file.

Create or rename a file or directory. By default, the destination is overwritten[...]

As far as I can tell, this is impossible to do with the storage explorer. Getting a Failed to rename '<file>'. An object with the new name already exists. Same error for files and directories. Running version 1.16.0.

MRayermannMSFT commented 3 years ago

@dtheodor is there a reason you can't just first delete the destination and then perform the rename? We'd like to stay on the safe side of things and not have renames be able to do overwrites.

dtheodor commented 3 years ago

Yes, the reason is that I want the overwrite to happen atomically. I am overwriting a directory, and my application depends on the directory always being there, I cannot afford it to be missing. An application-based workaround is practically impossible.

On further investigation this deficiency is also present in the REST API: although it advertises destination overwrite, it fails to do that with a similar error on 'legacy' mode, and it always moves the directory inside the already existing one on 'posix' mode. Maybe this is an issue that needs to be raised with the "server" team, but I have no way to contact them. These issues https://github.com/microsoft/AzureStorageExplorer/issues/1071 https://github.com/microsoft/AzureStorageExplorer/issues/2308 are related to this behavior.

MRayermannMSFT commented 3 years ago

@dtheodor

We can raise the issue with the platform team, and you can try raising this issue with Azure support, but it does sound like based on what you're saying that this request isn't possible right now.

You might need to rearchitect your application until the platform team can improve the API. =/