In this azure tutorial, we will discuss How to Create Azure Blob storage. Apart from this, we will also discuss on below topics
- How to Create Azure storage account, step by step
- Create a container in Azure
- How to upload a block blob in azure
- Download a file from Azure blob storage
- Delete a file from Azure blob storage
- Create a folder in Azure blob storage
Table of Contents
- How to Create Azure Blob storage
- How to Create Azure storage account, step by step
- How to create a container in azure
- How to upload a block blob in azure
- How to download a file from Azure blob storage
- How to delete a file from Azure blob storage
- How to create a folder in Azure blob storage
- Azure blob storage url
How to Create Azure Blob storage
Let’s discuss here the process to Create Azure Blob storage. In order to create the Azure Bob storage, we need to consider to do a few things as bellow
- Create an Azure storage account
- Creation of a container in the Storage account created
- Create a Blob
How to Create Azure storage account, step by step
Now let’s discuss here, how to create a storage account. Refer to my article on an Easy way to Create an Azure storage account to create the Azure storage account using both the Azure portal and PowerShell.
Now you have the Azure storage account created, then it’s time to create the Azure storage container for the storage account you have created.
How to create a container in azure
Now, we will see how to create a blob container in azure. You can follow the below steps to create an Azure storage container using the Azure Portal.
Step-1: Navigate to the storage account you have created above in the Azure portal.
Note: I am using a different existing storage account but you can use the same account which you have created above.
Step-2: From the left menu for the storage account, from the Blob service section, select Containers.
Step-3: Click on the + Container button.
Step-4: Provide a name for your new container.
Note: Few important things to note here while choosing a name for the new container. The container name must contain only lowercase, Should start with a letter or number, and can contain only letters, numbers, and (-) character.
Select an option for the Public access level. Better to select the default option Private (no anonymous access). You can change also based on your business needs.
Step-5: Now click on the Create button to create the container.
You can see the notification area where it will show that “Successfully created storage container”.
You can able to see the newly created container on the Storage account | Containers page
This is how we can create the container using the Azure portal. Now we have both the storage account and container are ready. The time to upload the Blob now
How to upload a block blob in azure
We can store text, binary data in the cloud-like files, images, and videos in the Azure Block blobs. Let’s see the steps to upload a block blob to your new container or how to create a file in azure blob storage in the Azure portal
Step-1: Navigate to the newly created container in the Azure portal which you have created above.
Step-2: Click on the newly created container name and then click on the Upload button.
Step-3: Now the upload blade will open. Click on the browse button and select your local file to upload as a block blob.
Once you selected the file from the local system, you can click on the Upload button to upload as the block blob.
It will show Upload completed for Filename.txt.
See below, Demo.txt file is uploaded successfully to the newly created democontainer.
Here, we saw how to setup azure blob storage
How to download a file from Azure blob storage
We discussed above, how to upload a blob into Azure Blob storage. Now time to discuss the option How do I download from BLOB storage from Azure blob storage.
To download the file from the Blob storage, you can follow the below steps
Step-1: Select the file you have uploaded using the above mentioned steps.
Step-2: Right click on the file/blob and then click on the Download option.
Or you can also click on the three dots(…) option and select the Download option from there
These are the two ways we can follow to download the file from the Azure Blob storage.
How to delete a file from Azure blob storage
Here we will discuss how to delete a blob from Azure blob storage using the Azure portal.
To delete the file from the Blob storage, you can follow the below steps
Step-1: Select the file you have uploaded using the above mentioned steps, that you want to delete.
Step-2: Right click on the file/blob and then click on the Delete option.
Or you can also click on the three dots(…) option and select the Delete option from there
Now to confirm the deletion, you can click on the Ok button on the Delete blob(s) pop up.
If you want to delete the blob including the blob snapshots, you can select Also delete blob snapshots option and then click on the Ok button.
How to create a folder in Azure blob storage
Consider a scenario where instead of uploading the file directly on the Azure storage container, you need to create a folder inside the Azure storage container and then upload the file/Blob inside that folder.
There is one way to do this, you can follow the below steps to do that.
Step-1: Navigate to the newly created container in the Azure portal which you have created above.
Step-2: Click on the newly created container name and then click on the Upload button.
Step-3: Now the upload blade will open. Click on the browse button and select your local file to upload as a block blob.
Step-4: On the Upload blob window, browse the local file, and expand the Advanced option, enter the folder name for the Upload to folder option. Now click on the Upload button.
Step-5: Now see here, It created a folder name as MyFolder inside the container.
Step-6: If you will go inside the folder, you can see the Hello.txt file/blob is present there.
This is how we can create folder structure in Azure blob storage.
Azure blob storage url
Now, let’s discuss Azure blob storage url format.
A storage account provides helps you providing a unique namespace in Azure for your data. You can able to access each object which is stored in your Azure storage with the help of an address with the account name which is unique. Account name and the Azure Storage service endpoint combines together to form the endpoints for your storage account.
The default URL for accessing the Blob service in a storage account is https://<our account name>. blob.core.windows.net.
We can map our own domain or subdomain to the Blob service for our storage account so that users can browse using the custom domain.
You can also add a subdomain to the hostname For example, Add the subdomain “mysubdomain” to the hostname. The URL will be mysubdomain.mystorageaccount.blob.core.windows.net.
You can able to access the URL in the browser http://<subdomain.customdomain>/<mycontainer>/<myblob>
You may like following Azure tutorials:
Conclusion
Well, if you are new to Azure storage, I hope you got an idea of how to create a storage account in Microsoft Azure. Also, we saw how to create a container in Azure.
After we created the Azure container, we saw how to upload a block blob into the Azure container. Then we saw how to download and delete a file from Microsoft Azure blob storage.
Finally, we saw how to create a folder in Azure blob storage.