Skip to content

Listing specific files to transfer

John Rusk [MSFT] edited this page Jun 7, 2019 · 12 revisions

You can create a list of specific files to transfer, and then tell AzCopy to transfer only those exact files. As at version 10.1.2, this flag remains undocumented (except for this wiki page) and it does not appear in the in-app command line help. It is however, regularly used, since it's used by Azure Storage Explorer to pass file lists to its embedded copy of AzCopy.

To use this feature, create a JSON file that lists the files to be transferred. The format of the JSON file should look like this:

{
   "Files":[
      "File_1.pdf",
      "subdirA/File_2.pdf"
   ]
}

(For subdirectories, its supported and easiest in JSON to use / on all platforms, even Windows).

Then, invoke AzCopy like this for uploads:

AzCopy copy d:\sourceDir "http://urlToDestination" --list-of-files fullPathToYourJsonFile

And it will transfer the files d:\sourceDir\File_1.pdf and d:\sourceDir\subdirA\File_2.pdf

For downloads, the process is similar - the names in the json file are appended to the source container/virtual directory to produce the full URLs of the files to download.

Clone this wiki locally