azure-cli icon indicating copy to clipboard operation
azure-cli copied to clipboard

Unable to move blob to virtual directory with `az storage fs file move`

Open williamoconnorme opened this issue 2 years ago • 3 comments

Describe the bug

When attempting to move a blob file within the same container to a new virtual path, an error is returned regarding its parent directory not existing. Blobs can only be moved to the root of the container

Command toe reproduce: az storage fs file move --file-system "myContainer" --path "myfile.json" --new-path "myContainer/myFolder/myfile.json

Related command

az storage fs file move

Errors

The parent directory of the destination path does not exist. ErrorCode:RenameDestinationParentPathNotFound

Issue script & Debug output

az storage fs file move --file-system "myContainer" --path "myfile.json" --new-path "myContainer/myFolder/myfile.json

Expected behavior

File should be moved/renamed with virtual path prefixed.

Environment Summary

{ "azure-cli": "2.53.1", "azure-cli-core": "2.53.1", "azure-cli-telemetry": "1.1.0", "extensions": { "aks-preview": "0.5.161", "azure-devops": "0.25.0", "interactive": "0.5.3", "storage-preview": "0.8.3" } }

Additional context

The documentation for az storage blob move states that az storage fs file move should be used as the former command is deprecated however there is not parity in functionality when moving a blob from one path to another virtual directory.

https://learn.microsoft.com/en-us/cli/azure/storage/blob?view=azure-cli-latest#az-storage-blob-move

williamoconnorme avatar Nov 08 '23 19:11 williamoconnorme

Thank you for opening this issue, we will look into it.

yonzhan avatar Nov 08 '23 19:11 yonzhan

I think the default behavior would not create a new directory . Can you first run az storage fs directory create --account-name storageaccountname --file-system containername -n myFolder image

calvinhzy avatar Nov 22 '23 08:11 calvinhzy

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!