Dinesh Kumar
Dinesh Kumar

Reputation: 117

AZcopy (V10) How to copy data inside a folder in a storage account to another container in another storage account

Let us say, this path https://xxxx.blob.core.windows.net/container1/folder1 has some folders and files.

So I need to move these folders and files to the path https://yyyy.blob.core.windows.net/container2

Need to do this using Azcopy v10.

When Im trying this using azcopy v10, the files and folders are getting copied to below path https://yyyy.blob.core.windows.net/container2/folder1/

folder1 has been created unexpectedly. I need to copy the data inside that folder1 folder to the container2.

AzCommand used was : .\azcopy cp "https://xxx.blob.core.windows.net/0075696/0075696/[SASkey]" "https://yyyy.blob.core.windows.net/0075696/[SASKey]" --recursive=true

Upvotes: 4

Views: 7886

Answers (2)

Alocyte
Alocyte

Reputation: 323

Default option: --as-subdir True by default. Places folder sources as subdirectories under the destination. (default true)

Set this to false - will put Folder1 content in Container2 without creating a subdirectory.

Microsoft documentation

Upvotes: 1

NotFound
NotFound

Reputation: 6102

Instead of specifying the folder as the source you need to specify the content of that folder.

https://myblobs.blob.core.windows.net/container1/?sp=... //copies the folder with content
https://myblobs.blob.core.windows.net/container1/*?sp=... //copies only the content

Upvotes: 6

Related Questions