I am confused about how azcopy interprets the blobs
My source URL has files under "staging" "folder".
My destination is supposed to receive these files under "staging/outputtestfinal"
However, azcopy is copying the blobs under "staging/outputtestfinal/staging"
Why the second staging in my destination ?
I tried to *** https://myurlsource/staging/* but then the output is staging/outputtestfinal/staging/*
So a folder as "*" as created.. Really ? How I do a simple thing like this ?
azcopy copy "https://myurlsource/staging/" "https://myurldestin.blob.core.windows.net/staging/outputtestfinal/" --include-pattern '*.json' --recursive=true



When you use
azcopyto copy from one blob storage location to another, it will try to retain the folder structure relative to the source URL provided. This is why you are observing that behavior.If your source URL is
https://myurlsource/staging/, and you have a blob in there namedfile1.json, and you are copying it tohttps://myurldestin.blob.core.windows.net/staging/outputtestfinal/, the destination path becomeshttps://myurldestin.blob.core.windows.net/staging/outputtestfinal/staging/file1.json.To avoid this, you can try the following:
Use wildcard
*without trailing slash:This tells
azcopyto consider only the blobs directly under thestagingvirtual directory but not the directory itself.