Search code examples
azureazcopy

azcopy failed to perform copy command due to error: cannot use directory as source without --recursive or a trailing wildcard (/*)


Trying to copy a .vhd between two different storage accounts using SAS. Getting error. Can someone give me a hand please? thank you much

azcopy cp 'https://mystorage.blob.core.windows.net/images/MyDisk.vhd?sv=2019-12-12&ss=bfqt&srt=c&sp=rlx&se=2021-03-12T12:49:12Z&st=2021-02-14T04:49:12Z&spr=https&sig=oahRM1xDHkjgtEo5OjUv64vSPIjI%2BvyqVmdGN9demJc%3D' 'https://1sddq9uificcrb0t.blob.core.windows.net/vhds/MyDisk.vhd?sv=2019-12-12&ss=bfqt&srt=sco&sp=rwdlacupx&se=2021-03-13T01:02:49Z&st=2021-02-14T17:02:49Z&spr=https&sig=BXBocHkS%2FofwkhgdsvYccPEh0EA6Fpcu0LZd19%2FGwqw%3D'

Returning this error:

INFO: Scanning...

failed to perform copy command due to error: cannot use directory as source without --recursive or a trailing wildcard (/*)

Solution

  • It seems that you copy the VHD file of the disk to another storage account. You could try the command like this without .vhd suffix.

    azcopy cp 'https://mystorage.blob.core.windows.net/images/abcd?sv=2019-12-12&ss=bfqt&srt=c&sp=rlx&se=2021-03-12T12:49:12Z&st=2021-02-14T04:49:12Z&spr=https&sig=oahRM1xDHkjgtEo5OjUv64vSPIjI%2BvyqVmdGN9demJc%3D' 'https://1sddq9uificcrb0t.blob.core.windows.net/vhds/abcd?sv=2019-12-12&ss=bfqt&srt=sco&sp=rwdlacupx&se=2021-03-13T01:02:49Z&st=2021-02-14T17:02:49Z&spr=https&sig=BXBocHkS%2FofwkhgdsvYccPEh0EA6Fpcu0LZd19%2FGwqw%3D'
    

    enter image description here

    Or you can append the --recursive at the end of your command.