Create an Offsite Copy of a Fileset in Azure


Hello Folks,

During our latest round of Azure Camps a question keeps coming back when we get to the Azure Storage management section.

“Can I use it to store other type of Data?  or just VHDs?”

So I decided to give it a try.  To do so I will create a Storage Account, then a container, and I will upload my family picture library.  Just so I can tell my wife that our precious memories are protected “In the Cloud”.

But first, I recommend the following MVA modules as primer for this Azure conversation.

Create the Storage Account

1- I used the Azure portal, to create a locally redundant storage account in the region the closest to me.

image

2- I created a container called “picture” and made sure to set it to Private Access.

 

image

Get The Storage Account Key

To copy any data in the storage account you must have the key.

you can find the key in the Storage are of the portal by clicking the “Manage Access Keys” in the action bar at the bottom

image

And then clicking the copy icon for the key you want to use.

image

(You’ll understand if I don’t share my keys….)

Save that somewhere.   You’ll need it in a bit.

Download and install AzCopy

Next step was to Download the latest version of AzCopy.

1- Run the installation. By default, the AzCopy installation creates a folder named AzCopy under %ProgramFiles(x86)%\Microsoft SDKs\Azure\

image

I added the AzCopy installation location to my system path

2- from the Desktop, right-click the start button and from the Menu clicked System.

3- Clicked Advanced System Settings link in the left column In the System

4- In the System Properties window click the Environment Variables button under the Advanced tab and in System Variables added the appropriate path for my system architecture (x86 or x64) in my case %ProgramFiles(x86)%\Microsoft SDKs\Windows Azure\azcopy

image

Copy the File Structure

Before we copy the files we need to get the URL for the storage endpoint.

image

We will use the AzCopy we just installed to copy the data.  The The basic syntax for AzCopy commands is:

AzCopy <source> <destination> [filepattern] [options]so for me it would be:AzCopy C:\Users\pierrer\Pictures

https://pictbackup.blob.core.windows.net/pictures

/destkey: <key from Portal>

and the result is as follows:

image

or viewed from the management portal

image

here we go I have copied the content of a local directory directly in a Storage Account container.

I hope this was useful.

Feel free to send us comments and let us know what scenarios you want us to explore for you.

Cheers!

Signature

Pierre Roman, MCITP, ITIL | IT Pro Advisor
Twitter | Facebook | LinkedIn

Comments (0)

Skip to main content