How to grant RW permissions for a folder in Windows Azure?

I am deploying an MVC 3.0 web application for Windows Azure. I have an action method that takes a file uploaded by a user and saves it in a folder in my web application.

How can I grant RW permissions for this folder for the current process? I read about running tasks and had a basic understanding, but I would not know

  • How to grant permission yourself, and
  • Which running process (user) should I grant permission to?

Many thanks for the help.

EDIT

In addition to @David's answer below, I found this link extremely useful:

https://www.windowsazure.com/en-us/develop/net/how-to-guides/blob-storage/

+4
source share
1 answer

For local storage, I would not catch the granting of permissions to access various directories. Instead, take advantage of the storage resources available specifically for your running virtual machines. For a given instance size, you have local storage available to you from 20 GB to almost 2 TB (detailed size information here ). To take advantage of this space, you must create local storage resources in your project: enter image description here

Then in the code, take the drive letter for this storage:

var storageRoot = RoleEnvironment.GetLocalResource("moreStorage").RootPath; 

Now you can use this storage. And ... none of this requires any launch or permission tasks.

Now for the caveat: this is a repository local to each running instance, and not shared between instances. In addition, it is not durable - if the disk fails, the data disappears.

For permanent and long-term storage of files, Blob Storage is a much better choice because it is durable (replicated three times in the data center and geo-replicated to another data center) and is external to your role instances, accessible from any instance (or any application, including your local applications).

Since the blob storage is organized by the container and drops in the container, it’s quite simple to organize your drops (and store almost anything in this blob, up to 200 GB each). In addition, it is trivial to upload / download files to / from blocks, either to file streams or to local files (in the storage resources you have allocated, as shown above).

+6
source

Source: https://habr.com/ru/post/1414651/


All Articles