none
Upload files to Azure Blob Storage with AzCopy RRS feed

  • Question

  • Hi.

    I followed this guide http://thewindowsupdate.com/2019/05/30/how-to-upload-files-to-azure-blob-storage-using-powershell-and-azcopy/ to upload files to Azure blob storage.

    It looks like it's crashing on the last line of code when it tries to copy the files. Could anyone assist with the steps to troubleshoot this ?

    .\azcopy : [2019/09/13 16:06:46][ERROR] The syntax of the command is incorrect. Error parsing the argument "copy": parameter name is required.
    At line:30 char:1
    + .\azcopy  copy $localPath $containerSASURI
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: ([2019/09/13 16:...me is required.:String) [], RemoteException
        + FullyQualifiedErrorId : NativeCommandError

    Thanks 

    Friday, September 13, 2019 8:12 PM

Answers

All replies

  • Hi, 

    can you take a look to this document: https://docs.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-cli#data-transfer-with-azcopy and this one too "https://docs.microsoft.com/en-us/previous-versions/azure/storage/storage-use-azcopy" , try to use both syntax, maybe it is just the version you are using that is different from the one on the post.

    azcopy /source:$localPath /dest:$containerSASURI /S
    /S: is the recursive option.


    Best Regards,

    Mouad.


    Friday, September 13, 2019 9:29 PM
  • Just checking in to see if the above answer helped. If this answers your query, do click “Mark as Answer” and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.
    Monday, September 16, 2019 5:48 AM
    Moderator
  • I was using AzCopy 8.1.0-netcore, will try with AzCopy 10.2.1
    Monday, September 16, 2019 12:31 PM
  • @net_tech Sure! Try the suggestion mentioned through Azcopy or also you can use the Azure Storage explorer to upload file to Azure Blob storage.

    You could add parameters /source and /dest, this should be $Result = .\AzCopy.exe /source:$SourceFolder /dest:$DestURL /BlobType:block /destkey:$StorageAccountKey /Y

    If the issue still persists, please share the screen shot of the error message. 

    Hope this helps! 

    Kindly let us know if the above helps or you need further assistance on this issue. 

    ------------------------------------------------------------------------------------------

    Do click on "Mark as Answer" and Upvote on the post that helps you, this can be beneficial to other community members.


    Monday, September 16, 2019 12:45 PM
    Moderator
  • All good with AzCopy 10.2.1. 

    By the way the guide shows to use –recursive, however the version of AzCopy I am using requires two dashes before the flag. Not sure if there is a typo in the guide or there was a change in the AzCopy but I had to use AzCopy source destination --recursive 


    • Edited by net_tech Monday, September 16, 2019 12:48 PM
    Monday, September 16, 2019 12:47 PM
  • Just checking in to see if the above answer helped. If this answers your query, do click “Mark as Answer” and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.
    Wednesday, September 18, 2019 6:48 AM
    Moderator
  • The problem went away after I switched to AzCopy 10.2.1
    Wednesday, September 18, 2019 10:54 AM
  • Glad to here that issue got fixed if the above answer helped. If this answers your query, do click “Mark as Answer” and Up-Vote for the same, which might be beneficial to other community members reading this thread. And, if you have any further query do let us know.

    Wednesday, September 18, 2019 11:02 AM
    Moderator

  • .\azcopy : [2019/09/13 16:06:46][ERROR] The syntax of the command is incorrect. Error parsing the argument "copy": parameter name is required.
    At line:30 char:1
    + .\azcopy  copy $localPath $containerSASURI
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: ([2019/09/13 16:...me is required.:String) [], RemoteException
        + FullyQualifiedErrorId : NativeCommandError

    Thanks 

    since syntax parser interpreted copy as parameter, then you should look at the version of the azcopy that the path point to, maybe you have both and one of them is the last on the paths.

    Best Regards. 

    Wednesday, September 18, 2019 6:39 PM