Azcopy from a SAS url giving errors

Romonov picture Romonov · Aug 25, 2015 · Viewed 8.9k times · Source

I am trying to copy from a SAS url location to a destination storage account. I tried the following commands but it getting few errors:

AzCopy.exe /Source:http://wwwwww.blob.core.windows.net/vhd1/?sv=2014-02-14&sr=c&sig=xxxxxxxxxxxxxxxxx&st=2015-08-05T04%3A00%3A00Z&se=2015-09-01T04%3A00%3A00Z&sp=rl /Dest:https://yyyyyyyy.blob.core.windows.net/vhds /Destkey:zzzzzzzzzzzzzzzzzzz filename1.vhd /Y

The syntax of the command is incorrect. Invalid SAS token in parameter "Source". 'sr' is not recognized as an internal or external command, operable program or batch file. 'sig' is not recognized as an internal or external command, operable program or batch file. 'st' is not recognized as an internal or external command, operable program or batch file. 'se' is not recognized as an internal or external command, operable program or batch file. 'sp' is not recognized as an internal or external command, operable program or batch file.

AzCopy.exe /Source:http://wwwwwwww.blob.core.windows.net/vhd1 /Dest:https://xxxxxxxxxx.blob.core.windows.net/vhds /SourceSAS:?sv=2014-02-14&sr=c&sig=yyyyyyyyyy&sp=rl /Destkey:zzzzzzzzz filename1.vhd /Y

The syntax of the command is incorrect. Invalid SAS token in parameter "SourceSAS". 'sr' is not recognized as an internal or external command, operable program or batch file. 'sig' is not recognized as an internal or external command, operable program or batch file. 'st' is not recognized as an internal or external command, operable program or batch file. 'se' is not recognized as an internal or external command, operable program or batch file. 'sp' is not recognized as an internal or external command, operable program or batch file.

I am wondering what could be the reason for these errors.

Thanks

Answer

Zhaoxing Lu picture Zhaoxing Lu · Aug 25, 2015

Please surround your whole source argument with quotes, since it contains special characters to command prompt.

AzCopy.exe /Source:"http://wwwwww.blob.core.windows.net/vhd1/?sv=2014-02-14&sr=c&sig=xxxxxxxxxxxxxxxxx&st=2015-08-05T04%3A00%3A00Z&se=2015-09-01T04%3A00%3A00Z&sp=rl" /Dest:https://yyyyyyyy.blob.core.windows.net/vhds /Destkey:zzzzzzzzzzzzzzzzzzz CSR316.vhd /Y