Introduction
This is an article about uploading a blob on Azure Storage and setting container properties with metadata. Before reading this article please go through the below writings,
- Click here for Azure Storage Components – Blob.
- Click here for Azure Storage – Creating a container using Visual Studio.
Follow the below steps now.
Note
This article assumes that you already have an Azure Storage account created and the solution file for Visual Studio which was created in the previous demo.
Step 1
Open the solution file in Visual Studio, as shown below.


Step 2 Uploading a Blob to the container
After creating a container, insert the code below to upload a blob to the container.
Note
Make sure that you have given the exact location of where the file is available on your machine to upload towards the container.
Code Snippet
- CloudBlockBlob blockBlob = container.GetBlockBlobReference("AzureStorageAccount");
- using(var filestream = System.IO.File.OpenRead(@ "C:\Users\devel\Documents\najuma\data.csv")) {
- blockBlob.UploadFromStream(filestream);
- }
- Console.ReadKey();

Upload a Block Blob onto the Container with a particular reference. The Using function performs a file stream operation to upload a Block Blob by mentioning its path.
Step 3
Click on "Start" to build the application.


Press any key to continue.

Open the Azure portal and check the blob which has been uploaded to the container.

Step 4 - Access policies for the blob on Containers.
The Access Policy for the blob on containers can be managed with the access for both the blobs and containers on the portal. Click on Access Policy over here.

From the public access level, specify if the data in the container may be accessed publicly. By default, the container data is private to the account owner. You can use the blob to allow public read access for blobs, use Container to allow public read and list access to the entire Container.








Naresh SinghalPosted Feb 1, 2018, 12:31 AM
Very Good ....Najuma Mahamuth ......
Naresh SinghalPosted Feb 1, 2018, 12:30 AM
Nicely Explained ....Najuma Mahamuth