Cloud Course Blog

Files in the Cloud

In this blog I will go into detail of how I set up a console app and set it up with Azure’s Storage. I will be explaining the code, how much it would cost with a given scenario.

Application

So it’s a console app, and it attempts to upload an image onto Azure Storage, if there is already one with that name it doesn’t add it, then displays the URL along with the different files in that folder (Azure calls them containers).

Code

I followed the official Microsoft Documentation for how to set up Azure Blob Storage Client to get started, I made a Storage account on Azure, then I got the storage “Connection String” in order to set it as an enviroment variable in Windows, what that means is that in the background of my computer the variable will be saved so it won’t be on the program. After that I just started to add the code for the console app.

The code picture

Pricing

The pricing scenario was that we have 1000 users that are uploading 100MB worth of pictures each day, along with all of the pictures in the container getting downloaded 3 times per day. Azure Price

My monthly cost with this scenario would end up being 680€ (In the picture its in dollars)

I used this formula to figure out the download rate since each day there is more pictures that means the number gets increased with every day that goes by.

Other factores also being assumed is that each photograph is 5MB per so that means the user is uploading 20 per day, I needed this number in order to figure out how many times the user is writing to the database.

Resources

Microsoft Docs: Quickstart: Azure Blob Storage Client

Microsoft Docs: BlobServiceClient.GetBlobContainerClient() Method

Microsoft Docs: BlobServiceClient.CreateBlobContainerAsync() Method

Azure Pricing Calculator

Math Formula