SDE
SDE

Reputation: 31

Azcopy copy within the same container to different directory

I am trying to copy some files from one folder to another within the same storage account and container but getting the below error:

Command:

azcopy copy "https://store_name.dfs.core.windows.net/xyz/sample.db/folder_name/folder_id=10/*" "https://store_name.dfs.core.windows.net/xyz/sample_copy.db/folder_name/folder_id=10/" --recursive

Error:

INFO: The parameters you supplied were Source: 'https://store_name.dfs.core.windows.net/xyz/sample.db/folder_name/folder_id=10/*' of type BlobFS, and Destination: 'https://store_name.dfs.core.windows.net/xyz/sample_copy.db/folder_name/folder_id=10/' of type BlobFS
INFO: Based on the parameters supplied, a valid source-destination combination could not automatically be found. Please check the parameters you supplied.

Notice that only the folder name after the container xyz is different. Both source and destination folders exist.

I have tried adding the parameter --from-to BlobFSBlobFS but it still doesn't work. I can see that it allows to copy from Azure Blob -> Azure Blob in the azcopy documentation but not sure why this doesn't work.

Any help is appreciated.

Upvotes: 0

Views: 760

Answers (1)

Venkatesan
Venkatesan

Reputation: 10465

I tried in my environment and got the below results:

In my environment, I'm using Azcopy version 10.13.0 to copy files from one folder to another folder within the same storage account(Standard account).

In my storage account ,first folder structure:

test/sample.db/folder_name/folder_id=10  #with some files

enter image description here

Second folder structure:

 test/sample_copy.db/folder_name/folder_id=10   #with one file

enter image description here

Command:

azcopy copy "https://venkat123.dfs.core.windows.net/test/sample.db/folder_name/folder_id=10/*?sv=2022-11-02&ss=bfqt&srt=co&sp=rwdlacupiytfx&se=2023-08-12T12:51:58Z&st=2023-08-12T04:51:58Z&spr=https&sig=xxxxxxx" "https://venkat123.dfs.core.windows.net/test/sample_copy.db/folder_name/folder_id=10/?sv=2022-11-02&ss=bfqt&srt=co&sp=rwdlacupiytfx&se=2023-08-12T12:51:58Z&st=2023-08-12T04:51:58Z&spr=https&sig=xxxxx" --recursive=true

The above command storage endpoint + sas token copied successfully from one folder to another folder.

Output:

INFO: Switching to use blob endpoint on source account.
INFO: Switching to use blob endpoint on destination account.
INFO: Scanning...
INFO: azcopy: A newer version 10.20.0 is available to download

INFO: Any empty folders will be processed, because source and destination both support folders

Job xxxxxx has started
Log file is located at: /home/venkatesan/.azcopy/xxxxx.log

100.0 %, 3 Done, 0 Failed, 2 Pending, 0 Skipped, 5 Total, 2-sec Throughput (Mb/s): 0.0497


Job xxxxxxx summary
Elapsed Time (Minutes): 0.0667
Number of File Transfers: 5
Number of Folder Property Transfers: 0
Total Number of Transfers: 5
Number of Transfers Completed: 5
Number of Transfers Failed: 0
Number of Transfers Skipped: 0
TotalBytesTransferred: 12429
Final Job Status: Completed

enter image description here

Portal: enter image description here

Reference:

Copy blobs between Azure storage accounts with AzCopy v10 | Microsoft Learn

Upvotes: 0

Related Questions