Reputation: 34689
Using AzCopy.exe, I am able to copy over an entire container successfully. However, I cannot figure out how to copy over a blob where the name includes a folder structure. I have tried the following:
.\AzCopy.exe /Source:https://sourceaccount.blob.core.windows.net/container /Dest:https://destaccount.blob.core.windows.net/container /SourceKey:sourceKey== /DestKey:destKey== /S /Pattern:CorruptZips/2013/6
While also changing the /Pattern: to things like:
And everything just says that there are zero records copied. Can this be done or is it just for container/file copying? Thank you.
Upvotes: 2
Views: 8224
Reputation: 1462
Took me a few tries to get this. Here is the key:
If the specified source is a blob container or virtual directory, then wildcards are not applied.
In other words, you can't wildcard copy files nested in a folder structure in a container. You have two options:
Example:
C:\Users\myuser>azcopy /Source:https://source.blob.core.windows.net/system /Dest:https://dest.blob.core.windows.net/system /SourceKey:abc /DestKey:xyz /S /V /Pattern:"Microsoft.Compute/Images/vmimage/myimage.vhd"
EDIT: Oops, my answer was worded incorrectly!
Upvotes: 0
Reputation: 24138
@naspinski, there is the other tool named Azure Data Factory
which can help copying a folder from a blob storage account to another one. Please refer to the article Move data to and from Azure Blob using Azure Data Factory to know it and follow the steps below to do.
Copy Data
button as below to move to the powercopytool
interface, and follow the tips to copy the folder step by step.Upvotes: 3
Reputation: 6467
Please specify the command without /S:
AzCopy /Source:https://myaccount.blob.core.windows.net/mycontainer1 /Dest:https://myaccount.blob.core.windows.net/mycontainer2 /SourceKey:key /DestKey:key /Pattern:abc.txt
You can find the information from "Copy single blob within Storage account" in http://aka.ms/azcopy .
Upvotes: -1