>, Azure Blob, Azure Cloud, Azure Storage, Cloud Computing>Azure storage data services types and how to store files in azure storage account 1/2 : Part 8

Azure storage data services types and how to store files in azure storage account 1/2 : Part 8

I am putting together a series for people who are excited to bring Azure into their software development life cycle and use Azure cloud’s extensive services to their full potential.

In this series, I will cover as below:

  1. Getting Started with Azure Development, Create App Service Plan and Publish MVC project using Visual Studio
  2. Deployment Slots and Slot Swap on Azure App Service using Visual Studio and Azure SDK
  3. Remote debugging App Service using visual Studio, monitoring and configuring alerts
  4. Diagnostic logs, live stream, process explorer and KUDU
  5. How to use Azure SQL Database in Dot.net Applications
  6. How to use Azure DocumentDB or Azure Cosmos DB in our Dot.net Applications
  7. How to use Visual Studio Team Service to do continuous Integration and continuous delivery
  8. Azure storage data services types and how to store files in azure storage account 1/2
  9. Azure storage data services types and how to store files in azure storage account 2/2
  10. How to use Azure Functions and trigger on new image/blob creation in Azure Storage using BlobTrigger 1/2
  11. How to use Azure Functions and trigger on new image/blob creation in Azure Storage using BlobTrigger 2/2

If you do not know where to start, please check my blog post, which covers detail about getting subscription and setting up. In this series, we assume that you already have active Azure subscription and Visual Studio 2013 or later installed on your system.

8. Azure storage data services types and how to store files in azure storage account

As a developer, we often need to store files on disk other than storing records in databases, Azure provide us different storage options according to one’s needs and scenarios. In this part, we will discuss about the different types of data storage services, Azure Provides us and how to decide which service to use when, we will also use blob storage to store files and access them using Azure Client API for azure storage.

Azure provide storage services as managed services, that are managed by Microsoft and are highly available, scalable, secure and have different level of redundancy to make it reliable. Azure gives us five main services, blob storage to store any kind of data, file storage, queue storage, table storage and disks storage.

Azure requires us to create Azure Storage account before using any of the services listed below: there are two main account types as of yet. General Purpose and Premium Account.

General Purpose Storage Account

This account provide us all the database service listed below and the main thing is the data is stored on magnetic media, which limit the performance of the IO operations.

Premium Storage Account

This account provide us high-performance SSD backed storage for page-blob (we will discuss this in a bit), which used for virtual machines VHD files. It is recommended to use Premium Storage for VMs workloads.

Our main discussion will be on General Purpose Storage Account as it provides us all the services to work with. Azure offer us below services as of yet under general-purpose storage account and by the time you read may be Microsoft add new services, which of course will be updated in this blog.

  • Blob Storage
  • File Storage
  • Queue Storage
  • Table Storage
  • Disk Storage

Blob Storage

Blob stands for binary large object and it represent almost every file that you use in every date life, ranging from a picture to word files or logs files or VHDs for virtual machines to name a few. It is import to note that on Azure every blob will stored in an outer container, it is similar to folder. We have three types of blobs, block blobs, page blobs and append blobs.

Block Blob

Block blob is used to hold any file as long as it is less than or equal to 4.7 TB.

Page Blob

Page blobs are used by mostly VMs as VHD, these are optimized for random read/write access, and the max file size it supports is 8.0 TB.

Append Blob

Append blob as the name suggest is optimized for appending; it can be used operation such as logging as you append new logs to the end of the already existing logs.

Azure provides us a number of ways to access our files, using URLs, through REST APIs, and Azure SDK client libraries, which we will use in this post. We will create a storage account and generate SAS (shared access token) and then upload and down the file using Azure SDK.

For more information on Blobs

File Storage

File storage/Azure Files is just like a shared folder, which have cloud-inherited properties as high availability over internet and you can access it using SMB protocol or by using REST interface or client API. For more information on Files storage/Azure Files.

Queue Storage

As the name suggests, Queue Storage provide you insert or retrieve messages, which could be max 64 kb in size, can be stored for 7 days and as usual, the cloud enable you to insert millions of messages in a queue. This is usually used for any processing which could be done asynchronously, like when you purchase anything on amazon, your order is inserted in a queue to be processed at a later time as scale of the amazon make it difficult to process the order synchronously. For more information on Queue Storage.

Table Storage

If you heard of term NOSQL, well table storage is exactly that. As Azure have now Azure CosmosDB the variant of DocumentDB as discussed in earlier post, table storage is now part of Azure CosmosDB. For more information on Table Storage.

Disk Storage

Disk storage is generally used for VMs, as disk storage can be used for OS or for temporary files. It also have options for SSD storage and data disks, there are different recommendations to use disk type according to your specific needs, well this is out of this post scope. For more information on Disk Storage.

We have given you brief introduction for the storages Azure offer, we will use blob storage in our demo next. If you have not opened your Azure Portal Already then open it. Let us create a storage account, I already have a post regarding Azure Storage Account creation, please follow the steps and resume.

I assume that you have created the storage account; all we need to create is now a container in blob storage and set the permissions, if you want to allow everybody to list and access blobs (files) then container, otherwise for read only access without listing permission go for blob. We are going for blob as will use shared access signature to access the files.

Figure 1 create container with blob access

We have created container “images” with blob permission and uploaded a file through Azure portal, click on the image and get the image link and open this in new tab, you will see that image is showing up.

Figure 2 Upload image to blob storage

Figure 3 Copy Image URL Blob Upload

Now remove the image name from the URL and just try to access the container, you will get ResourceNotFound error. We have gave blob permission to the container, so listing the folder is not allowed and if you have correct URL of the resource inside the images container only then you can access the resource directly, in our case you have URL of image so we were able to see the image.

Figure 4 Listing folder in Azure Blob storage

Now we do the same in visual studio, continue to next post.

Coming up next, Azure storage data services types and how to store files in azure storage account 2/2

  • 2
    Shares

About the Author:

I am an azure solutions architect along with SharePoint Developer/Admin having years of Microsoft products experience essentially for development , I love to help others and make a change in the world and this blog is the one way I use to achieve this goal.

Leave A Comment

Skip to toolbar