How to upload a folder to Blob storage?

I have a working role that I use to output data from Blob Storage OnStart. I am currently testing this by uploading a test.txt file and then uploading it to a local directory. This is working fine.

Now I want to upload the folder to the blob repository. This folder contains the script package, as well as several executable files that cause batch script calls.

What is the recommended way to do this? I think the zip folder and downloading the * .zip file would be easy ... but then, as soon as I download it locally for the working role to process, how would I unzip it without any third-party libraries?

If there are better options, I am open to any suggestions. Thanks for the help here - this community has provided tremendous help for me when I build up :)

+5
source share
2 answers

You can use two approaches: single-file (for example, zip) or multi-file (with each file in its own blob). Here I take it upon myself, then the unpacking note:

Single zip file

This is a very simple way to maintain a grouped set of files, such as installing apache or a set of static resources. Uploading to local storage from blob is extremely simple. And the zip file can handle any level of nested directories.

Downside: to update a single file you need to create a new zip; there is no way to simply upload one changed asset.

single drops

, , . , , ( ), - .. , . , CDN, .

: . Blob \container\blob. , . , ListBlobs() .

Eclipse vbs script, . Visual Studio ( script) - 7zip, , zip blob ( ) 7zip.

, , . (, tomcat), zip . , , . ... tomcat ( ).

+2

AZCOPY . .

Cd "C:\Program Files (x86)\Microsoft SDKs\Azure\AzCopy"

.\AzCopy /Source:C:\Users\folderName\ `
/Dest:https://storageAccountName.blob.core.windows.net/storageContainerName `
/DestKey:yourStorageAccountKey /S
+1

All Articles