Azure-storage-azcopy: blobs copied from local directory recursively contain local parent directory name in their paths

Created on 7 Dec 2019  路  2Comments  路  Source: Azure/azure-storage-azcopy

Which version of the AzCopy was used?

azcopy version 10.3.2

Note: The version is visible when running AzCopy without any argument

Which platform are you using? (ex: Windows, Mac, Linux)

Linux

What command did you run?

cd my-dir-name
azcopy copy --recursive=true . 'https://storage-account.blob.core.windows.net/container-name/?<SAS>'
Note: Please remove the SAS to avoid exposing your credentials. If you cannot remember the exact command, please retrieve it from the beginning of the log file.

What problem was encountered?

The files uploaded onto blob container all have a prefix "my-dir-name", which is the parent directory name on the local disk.
I don't want the directory name to be the prefix of the blobs and it seems there is no extra options to achieve that.

How can we reproduce the problem in the simplest way?

mkdir dir
echo 'content' > file.txt
azcopy copy --recursive=true . 'https://storage-account.blob.core.windows.net/container-name/?<SAS>'

Have you found a mitigation/solution?

No.

Most helpful comment

It works the same way as Bash and PowerShell: append /* to the source and it will copy just the _contents _of the source, not the name of the source.

In your case, that would be
AzCopy copy ./* http://... --recursive

All 2 comments

It works the same way as Bash and PowerShell: append /* to the source and it will copy just the _contents _of the source, not the name of the source.

In your case, that would be
AzCopy copy ./* http://... --recursive

@JohnRusk Thank you very much. It worked like a charm.

Was this page helpful?
0 / 5 - 0 ratings