none
Does Azure storage do this?

    Question

  • Hi there,

    I am developing an asp.net application running in azure. this app will need to allow our users to upload blocks of files. The files are trainings, which are like mini-websites in themselves. Azure offers, Blob, Table and file options for storage as far as I can see. Can someone tell me which of these will do the following:

    1. Allow the files to be accessed to the public (unauthenticated users) by web browser

    2. Allow for subdirectories/folders - (the authoring tool used publishes content in this way.)

    3. Allow for easy uploading of these files and folders by authenticated users(Cloudberry explorer, mapped drive, something else?)

    Thanks in advance!

    Cory


    Monday, October 24, 2016 5:40 PM

Answers

  • Cory

    1. Allow the files to be accessed to the public (unauthenticated users) by web browser

    this currently is available with Azure blobs - https://azure.microsoft.com/en-us/documentation/articles/storage-manage-access-to-resources/

    2. Allow for subdirectories/folders - (the authoring tool used publishes content in this way.)

    You can emulate this with Azure blobs (it's natively available with Azure Files) - http://www.codeproject.com/Articles/597939/ModelingplusaplusDirectoryplusStructureplusonplusA

    3. Allow for easy uploading of these files and folders by authenticated users(Cloudberry explorer, mapped drive, something else?)

    You can provide restricted access to an Azure storage account by using SAS https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-shared-access-signature-part-1/

    hth
    Marcin

    Monday, October 24, 2016 6:04 PM
  • Hi Cory,

    1. Set up the container for the files, and set the access level to "Blob", which means people can access the blobs anonymously with a URL. That's read access only. (You can do this in the portal.)

    2. The container is the top "directory". Blob storage doesn't support directories per se, but you can put forward slashes in the name of the blob, and most storage explorers will treat it as a directory and display it as such. For example, /animals/cats/kittens.jpg would appear to be in the animals container, and in the cats folder under that container.

    3. You can create an SAS and pass it to the customer to allow them to upload a file, but you have to have a mechanism to do that; they can't just paste it into the browser.

    Most of the storage explorers have you put in the storage account name and key, so I don't know how you would use them to allow your customer to upload a blob without giving them the credentials (which is all around a bad idea).

    What we generally recommend is that you set up a service you can call to get an SAS URL and call that from your ASP.NET application, and use the REST API to upload the blobs. You can also use C# and the storage client library. If you do that, we recommend you not store the storage account name and key in your app, but call somewhere else to get it. Otherwise, if your app is hacked, they have the keys to the storage kingdom (so to speak).

    For file shares, you can use an Azure File Share and attach it as a share to a computer. For more information about that, you should check out this article: https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-files/

    Best of luck,

    Robin


    Sr. Content Developer at Microsoft

    Tuesday, October 25, 2016 6:36 PM

All replies

  • Cory

    1. Allow the files to be accessed to the public (unauthenticated users) by web browser

    this currently is available with Azure blobs - https://azure.microsoft.com/en-us/documentation/articles/storage-manage-access-to-resources/

    2. Allow for subdirectories/folders - (the authoring tool used publishes content in this way.)

    You can emulate this with Azure blobs (it's natively available with Azure Files) - http://www.codeproject.com/Articles/597939/ModelingplusaplusDirectoryplusStructureplusonplusA

    3. Allow for easy uploading of these files and folders by authenticated users(Cloudberry explorer, mapped drive, something else?)

    You can provide restricted access to an Azure storage account by using SAS https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-shared-access-signature-part-1/

    hth
    Marcin

    Monday, October 24, 2016 6:04 PM
  • Thanks Marcin!

    Is there a single option that meets all three requirements?

    Thank you,

    Cory

    Tuesday, October 25, 2016 2:59 PM
  • Hi Cory,

    1. Set up the container for the files, and set the access level to "Blob", which means people can access the blobs anonymously with a URL. That's read access only. (You can do this in the portal.)

    2. The container is the top "directory". Blob storage doesn't support directories per se, but you can put forward slashes in the name of the blob, and most storage explorers will treat it as a directory and display it as such. For example, /animals/cats/kittens.jpg would appear to be in the animals container, and in the cats folder under that container.

    3. You can create an SAS and pass it to the customer to allow them to upload a file, but you have to have a mechanism to do that; they can't just paste it into the browser.

    Most of the storage explorers have you put in the storage account name and key, so I don't know how you would use them to allow your customer to upload a blob without giving them the credentials (which is all around a bad idea).

    What we generally recommend is that you set up a service you can call to get an SAS URL and call that from your ASP.NET application, and use the REST API to upload the blobs. You can also use C# and the storage client library. If you do that, we recommend you not store the storage account name and key in your app, but call somewhere else to get it. Otherwise, if your app is hacked, they have the keys to the storage kingdom (so to speak).

    For file shares, you can use an Azure File Share and attach it as a share to a computer. For more information about that, you should check out this article: https://azure.microsoft.com/en-us/documentation/articles/storage-dotnet-how-to-use-files/

    Best of luck,

    Robin


    Sr. Content Developer at Microsoft

    Tuesday, October 25, 2016 6:36 PM
  • Robin, Cory,

    You can use Azure Storage Explorer in combination with SAS key - more at https://azure.microsoft.com/en-us/blog/microsoft-azure-storage-explorer-preview-january-update-and-roadmap/

    hth
    Marcin

    Wednesday, October 26, 2016 12:00 AM