Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Windows Azure: Shall I use BLOB to upload files? #3855


User avatar
0
bilalhaidar created

Hello, The template uploads files to a subfolder (Temp) in the solution folder. In case the application is to be hosted on Azure, shall I use BLOB instead, or this current solution would work fine?

In case of BLOB then I will have the image/file uploaded stored as is on file system and maybe with the name of the file stored in the Db.

Thanks Bilal


10 Answer(s)
  • User Avatar
    0
    strix20 created

    You should always use an external file service for apps hosted in azure (and for apps in general, in my opinion.)

    Files stored locally on an azure website are not permanent. Redeploying or scaling events that rebuild the VM hosting your app will wipe out existing files (or the new VM could be on a completely different physical machine to begin with.)

    <a class="postlink" href="https://stackoverflow.com/questions/26365590/avoid-deleting-files-on-azure-cloud-service-publish">https://stackoverflow.com/questions/263 ... ce-publish</a>

  • User Avatar
    0
    ismcagdas created
    Support Team

    Totally agree with @strix20.

  • User Avatar
    0
    bilalhaidar created

    Thank you for your responses.

    @strix20: What is the suggestion on Azure, what to use? BLOB storage?

    @ismcagdas Is there a plan to make the ASPNETZERO compatible more with Azure?

    Thanks

  • User Avatar
    0
    strix20 created

    Azure blob storage is fine.

    In my personal opinion, AWS is better than azure. It is much more user friendly, their APIs are more clearly documented and have a more natural feeling architecture.

    But Azure is absolutely fine if you are comfortable with it. They are really quite equivalent services.

    What issues are you having with azure compatibility? We had no problems hosting our application in Azure, and have taken advantage of several other Azure services, including SQL Azure, Azure Service Bus, and Blob storage.

  • User Avatar
    0
    bilalhaidar created

    Hello @strix20, Thanks for the elaboration!

    I am using Azure as my client has an account there and we need to utilize it. Otherwise, I don't mind AWS. Maybe I should give it a try and test it out as you talked very well about it.

    I have a question for you on this regard. How do you develop your app in such a way that it can run locally and on Azure at the same time given that you are making use of Service Bus and BLOB? Do you use Conditional Compilation for that?

    Also, what was the case for you to need to use Service Bus? Like just the headline only, why would I use that thing.

    Thanks a lot Bilal

  • User Avatar
    0
    strix20 created

    All azure services are accessed through the SDK API provided by microsoft. Running locally vs on azure has no impact, because internally the SDK just makes Http / TCP requests to the resources in azure. It's really no different than connecting to a SQL Azure database locally vs from a web app.

    We do have multiple environments because we use gitflow.

    We use Team City as our build server, with Octopus Deploy, and use the config transforms in Octopus to transform the appsettings.json by selecting environment specific settings (ie. appsettings.Develop.json, appsettings.Staging.json, appsettings.Production.json)

    We have separate service bus Queues and Blob directories for our production and development/test environments, to ensure that testing never impacts production.

    We use service bus because we have a Windows Service that interacts with additional software that must be run on a VM inside of a VPN, and cannot be run on the web server. Service Bus provides a simple, reliable, fast way to distribute messages across applications by interacting with a queue service that lives in Azure.

  • User Avatar
    0
    bilalhaidar created

    Thanks a lot for the detailed explanation :-) I must start learning new stuff now ;)

  • User Avatar
    0
    webking created

    We have a customer scenario where we are going to store larger files (blue prints) and we think that they are to big to store in the sql server itself. Mostly to the increased storage cost. We are now looking into build a blob storage manager we can use in our asp.net zero project. Any tips on how to do that would be appriciated. Did you guys build you own azure blob storage manager?

  • User Avatar
    1
    BobIngham created

    See Azure blob storage manager for some code to get you started.

  • User Avatar
    0
    webking created

    thanks bobingham, I appreciate your help/answer.