0

I am creating a C# ASP.NET app (using Visual Studio), which I'm hosting on Microsoft Azure. Currently, I have a folder in the solution named "Content", in which I store some media. For example, there a logo that is placed on the website.

The purpose of the web app is to generate a document that a user can download after entering some data. To generate this document, I also need to use some media (mainly images). There can be quite a lot of such images!

Where should I store these images? I currently have them in this "Content" folder as well (in seperate sub folders for each user), but I noticed on Azure there is also a tab called "Storage". I have tried to use this service for a bit, but I don't really understand its purpose. Would it be advisable to use this for storing the media, and then retrieving them with the web app when necessary, or should I leave them on the web app server? What is considered Good Practice?

Thanks in advance for any help

Wouter
  • 100
  • 1
  • 7
  • Duplicate of http://stackoverflow.com/questions/15223167/azure-best-way-to-store-and-deploy-static-content-e-g-images-css – alwayslearning Sep 26 '16 at 04:44
  • @alwayslearning You're right, that does seem similar. I'm sorry, I didn't see that question earlier. – Wouter Oct 05 '16 at 18:59

2 Answers2

0

As a starting point, using Blob storage (see Azure Storage Documentation) would be significantly better than file storage on a single webserver - its cheaper and more scalable (pricing tiers for Application server storage will be expensive, you'd have have to duplicate files or have a multi-server directory in a load-balanced environment). The basic design is the application will use an SDK to retrieve the bits and then stream it back to the web browser or other client.

If you anticipate many users downloading the same file, and network performance matters, consider using a Content Delivery Network

kevinc
  • 605
  • 5
  • 14
-1

You should store it in an Azure Storage Account and reference it using the SDK, after generating the document, you can use Shared Access Signature to give the user access and you can limit the access to read or write for a specific time.

If you will generate videos then you can serve it through Azure Media Services

Haitham Shaddad
  • 4,336
  • 2
  • 14
  • 19
  • I disagree. 1) No need for media services - the OP is generating a document. 2) SAS is optional, and requires the document to be written back to storage first (and you don't know if it's short- or long-lived). – David Makogon Sep 25 '16 at 11:30
  • @DavidMakogon no one said that we should use Media Services, Only if it was needed, otherwise, he can ignore it. as for SAS, it is optional but from security perspective it is better, otherwise, he will have to read the files from Storage using the storage key and serve it manually using an MVC Action that returns a FileResult – Haitham Shaddad Sep 25 '16 at 12:59