Search code examples
azureazcopy

Microsoft Azure Storage AzCopy : error parsing the argument "copy"


I'm trying to dowload some data from a blob for which I have a SaS key with AzCopy.

My code :

azcopy copy "my/path/testMindee/fileData.txt" "https...blob.core.windows.net/90138?sv=mykey&sp=rl"

The error : The syntax of the command is incorrect. Error parsing the argument "copy" : parameter is required. A screenshot of my code


I've tried after that :

My code :

azcopy cp "https...blob.core.windows.net/90138/DBxxx/file.csv?sv=mykey&sp=rl" "my/path/testMindee/fileData.txt" --recursive

The error : The syntax of the command is incorrect. Error parsing the argument "copy" : parameter is required.

My second try

Both still give me the error : The syntax of the command is incorrect. Error parsing the argument "cp": parameter name is required.

Thank you in advance


Solution

  • In you image you have code like this:

    azcopy copy "path/to/local/file" "path/to/storageacc/blob"
    

    The error message says: "Error parsing the argument copy". Basically you need to do azcopy cp instead of azcopy copy

    You want to downlaod a file from a storageaccount with a sas token

    I'm trying to get some data from a blob for which I have a SaS key with AzCopy

    From the ms azcopy copy documentation:

    Download a single file by using a SAS token:

    azcopy cp "https://[account].blob.core.windows.net/[container]/[path/to/blob]?[SAS]" "/path/to/file.txt"
    

    In case you want to uplaod a file

    azcopy cp "/path/to/file.txt"> "https://[account].blob.core.windows.net/[container]/[path/to/blob]?[SAS]"
    

    So when you want to download from a storage account you need to put the remote location first and the path where the fiel shoudl be stored second. Also the azcopy command is followed by cp not copy.

    Kind regards