Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upload zip file to azure blob then unzip it there [closed]

I have lot of zip files, which will have few folders and 50+ files in it. How can I upload those zip files to azure blob then unzip it there.

Unzipping the file in server and uploading files in it one by one to azure blob will be a cumbersome process.

Does azure has any easy way to achieve this or is there any workaround?

I'm implementing this in PHP.

like image 471
Mathankumar Avatar asked Apr 03 '17 06:04

Mathankumar


People also ask

Can we unzip file in Azure blob storage?

In addition, you can't directly extract the file to the Azure file share, so for that, you first need to download the archive, extract it locally and then upload it to the desired destination. And if you would like to do any other manipulation with the extracted files you can do that as well.


2 Answers

Simple answer is Azure Blob Storage will not do the unzipping for you. This is something you would need to do on your own. How you do it is up to you.

One possibility is (like you mentioned) that you upload zip files on your server, unzip them there and then upload individual files.

Another possibility is to do this unzipping through a background process if you are concerned about the processing happening on the web server. In this approach, you will simply upload the zip files in blob storage. Then through some background process (could be WebJobs, Functions, Worker Roles, or Virtual Machines), you would download these zip files, unzip them and then re-upload these individual files.

To trigger the background process on demand, once the zip file is uploaded you could simply write a message in a queue telling background process to download the zip file and start unzipping process.

like image 169
Gaurav Mantri Avatar answered Sep 18 '22 08:09

Gaurav Mantri


As you prob. already found all over the internet, it's no possible to run workloads INSIDE of the storage servers... but: You can write a azure function to FileWatch your storage account, and unzip files for you, then upload them

like image 21
EvertonMc Avatar answered Sep 19 '22 08:09

EvertonMc