Partager via


HOW TO UPLOAD FILES AND FOLDERS TO WINDOWS AZURE?

1. First of all make sure that you have done the steps in this blog post.

2. Create a vhd on the disk management on your local computer and copy whatever files you need to upload on windows azure to the vhd after attaching it to your local computer.

3. Open Azure Power Shell Command prompt with elevated permission and make sure your are pointing towards your subscription by running the following command:

get-azuresubscription

it will return your subscription information.

4. Run the following command to upload the vhd to Windows Azure

Add-AzureVhd -Destination <BlobStorageURL>/<YourImagesFolder>/<VHDName> -LocalFilePath <PathToVHDFile>

Replace <BlobStorageURL>/<YourImagesFolder> with the Azure storage account that you want to store the vhd on.

Replace <VHDNAME> with the name you want to display on Windows Azure.

Replace <PathToVHDFile> with the local path of the vhd on your computer.

5. The command will look like this

Add-AzureVhd -Destination “https://blobname.blob.core.windows.net/vhds/azureday.vhd” -LocalFilePath “c:\azureday.vhd”

the command will start calculating and detecting the empty disk blocks , later on it will start the uploading process which will depend on your bandwidth.

The upload process supports the continuation of the failed uploads , you don’t have to start the upload process from the beginning.

6. After the upload process is completed, you will find the vhd under the storage account container you have specified in your vhd-Destination, check the screenshot below.

azurescreenshot

7. Navigate on Windows Azure management portal to Virtual machine pane on the left pane and click on Disks on the right pane, check screenshot below.

Untitled

8. Click on the create button on the lower toolbar, check the screenshot below.

Untitled2

9. Click Ok to create the disk from the VHD.

10. Navigate on Windows Azure management portal to the VM you want to copy the files to and click attach in the lower toolbar,see screenshot.

azurescreenshot2

11. Click on Attach disk and navigate to the storage account/container where you have stored the vhd in step 6.

12. Click Ok to attach the disk to the virtual machine.

13. After the disk is attached successfully, connect to the virtual machine and navigate to the computer management –> Disk management, check attached screenshot.

Untitled3

14. Once you open the disk management, the disk initialization will pop up for you to initialize the disk, continue following the screen instruction to initialize the disk without changing anything.

15. Give the disk drive a letter to be able to access it from the Virtual machine.

Enjoy :)