Monday, 15 August 2016

Azure: Using Azure AzCopy

When attempting to upload files to a storage account in Azure, if you upload using the portal no Check-MD5 value appears to be generated. In order to have a value generated you need to use the AzCopy tool.

Once you have this installed, open a command prompt and run the tool (default installation location will be C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy\AzCopy.exe)

To upload a single file to a location, use the following command;
AzCopy /Source:A:\Folder\On\My\Computer /Dest:https://storageaccount.file.core.windows.net/filescontainer/folder /DestKey:Storage-Account-Access-Key /Pattern:FileName.ext
Replace the bold text with your parameters

/Source: needs to be the folder location only - do not include the file name or the command will fail. The file name is specified in /Pattern:

Update:

Alternatively, if you have several files to upload to a single location and so want to copy the entire contents of a folder, you can run the command below. This copies all content in a directory including structure;
AzCopy /Source:A:\Folder\On\My\Computer /Dest:https://storageaccount.file.core.windows.net/filescontainer/folder /DestKey:Storage-Account-Access-Key /S

No comments:

Post a Comment