-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Add --follow-symlinks option to 'az storage blob upload-batch' #30907
Copy link
Copy link
Closed
Labels
Auto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamStorageaz storageaz storagecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Milestone
Metadata
Metadata
Labels
Auto-AssignAuto assign by botAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamStorageaz storageaz storagecustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Related command
az storage blob upload-batchIs your feature request related to a problem? Please describe.
The command skips over symlinks to directories. If I'm trying to copy a large directory structure to the cloud, I end up having to write my own directory handling structure to detect and traverse symlinked directories. It seems like a bulk upload command should be able to handle this.
Describe the solution you'd like
The command should detect if a symlink is to a directory and if so, copy the underlying directory. I don't need the original linked structure to be retained, and if a file or directory is referenced more than once it can just be copied to each path (so creating a new directory with the same name as the symlink).
original structure:
stored structure:
My use case only requires symlinks to directories to be handled, but something similar could be done with symlinked files, where the content of the linked file is stored under the name of the symlink.
Describe alternatives you've considered
I have implemented my own symlink handler to work around this. I call the command on a directory to upload everything in the base directory, then scan for symlinks which are directories and traverse them one by one. In each directory I do the same steps recursively (call the command again, look for symlink dirs again, etc).
Additional context
A related change was added in Azure/azure-storage-azcopy#1303 for the azcopy command, with the argument --follow-symlinks.
AWS copy command implements this feature (check out --follow-symlinks arg here). I am trying to switch an automated build system from AWS to Azure and was hoping
az storage blob upload-batchwould be a drop-in replacement foraws s3 copy --recursive(I do a bulk copy of built artifacts to cloud storage after the build completes).