Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to save/extract files on Azure Web Sites?

I have web application for running unit tests for our data and I want to deploy it as Azure Web Site.
The problem is in this app I'm downloading quite large zip files, extracting them (~50MB, 500 files inside) and doing some tests over these files.
Where should I save these large files on Azure Web Sites and where hould I extract them? On localhost I've been using "Path.GetTempPath()", but Azure Web Site is reporting that there is no space in this folder, even though my Azure Site has 1000MB total and about 990MB free.
Is there any way how to use these 1000MB for my file operations?
In case this is not possible, should I use the Azure Blob Storage for the extracted files?

like image 388
Martin Suchan Avatar asked Dec 16 '13 16:12

Martin Suchan


People also ask

How do I access my Azure storage on the web app?

In the Azure portal, go into your storage account to grant your web app access. Select Access control (IAM) in the left pane, and then select Role assignments. You'll see a list of who has access to the storage account.

How do I unzip a file in Azure app?

To upload a file and also unzip it there are two options. You can upload the file using the method above by dragging the file in. Then in the command window run the unzip command. Alternatively you can drag the zip file onto the right hand side of the screen.

How do you store files in Azure Blob vs file storage difference?

In summary, the difference between the two storage services is that Azure Blob Storage is a store for objects capable of storing large amounts of unstructured data. On the other hand, Azure File Storage is a distributed, cloud-based file system.


1 Answers

In case of Web Sites and when your storage requirements fit withing the constraints of provided local storage - you certainly can use local storage.

However Path.GetTempPath() is not your best choice for Azure Web Site. I would say you shall put all the files in a folder which is part of your web app root folder, i.e. Server.MapPath("~/tmp/"). Make sure to first check for folder existence, etc. There you can utilize all the storage you have.

As for Blob - you have to unzip each file separately and upload it separately to a blob. And when you have to work with the files, you have to download them again. I don't believe this is real solution, as long as you have enough local storage you can utilize.

like image 58
astaykov Avatar answered Sep 28 '22 05:09

astaykov