Create an Offsite Copy of a Fileset in Azure
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.
- Microsoft Azure IaaS Deep Dive Jump Start
- Get Started with Windows Azure Today Jump Start
- Windows Azure for IT Pros Jump Start
- Windows Azure Security Overview
- Windows Azure Storage - Design and Implementation Jump Start
Create the Storage Account
1- I used the Azure portal, to create a locally redundant storage account in the region the closest to me.
2- I created a container called “picture” and made sure to set it to Private Access.
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
And then clicking the copy icon for the key you want to use.
(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
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
Copy the File Structure
Before we copy the files we need to get the URL for the storage endpoint.
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
/destkey: <key from Portal>
and the result is as follows:
or viewed from the management portal
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.