Overview of Azure Storage Accounts and their Redundancy.
Tags: azure, beginners
Published: 2022-08-23 16:30:00

_Disclaimer_: Learning about Azure Storage Accounts is very ambiguous and overwhelming & quite confusing when coming straight from AWS storage services. (Personal Experience 😬)

## What is an Azure Storage Account?
An Azure storage account contains all of your Azure Storage data objects, including blobs, file shares, queues, tables, and disks. The storage account provides a unique namespace for your Azure Storage data that's accessible from anywhere in the world over HTTP or HTTPS.

Types of Storage Account provided and recommended by Microsoft for most scenarios,
![types-of-storage-account-table](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i8orc9m4qf81v9df7h9j.png)

There are some Legacy storage accounts which aren’t recommended by Microsoft, but may be used in certain scenarios:
![legacy-storage-accounts](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ctjsvf2c1wo7olyn6fe9.png)
 

## How is Storage in Azure any different from that of AWS?
In AWS platform, storage is primarily broken down into 3 services:
- **Simple Storage Service (S3)** - Basic object storage that makes data available through an Internet accessible API.
- **Elastic Block Storage (EBS)** - Block level storage intended for access by a single VM.
- **Elastic File System (EFS)** - File storage meant for use as shared storage for up to thousands of EC2 instances.

In Azure Storage, subscription-bound storage accounts allow you to create and manage the following storage services:
- **Blob storage** stores any type of text or binary data, such as a document, media file, or application installer. You can set Blob storage for private access or share contents publicly to the Internet. Blob storage serves the same purpose as both AWS S3 and EBS.

- **Table storage** stores structured datasets. Table storage is a NoSQL key-attribute data store that allows for rapid development and fast access to large quantities of data. Similar to AWS' SimpleDB and DynamoDB services.

- **Queue storage** provides messaging for workflow processing and for communication between components of cloud services.

- **File storage** offers shared storage for legacy applications using the standard server message block (SMB) protocol. File storage is used in a similar manner to EFS in the AWS platform.

Here's a table briefly comparing AWS & Azure storage services,
![azure-aws-comparison-1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/242tepio7cu3hlhuu8qv.png)

Now here I've created a Storage Account where I can store blobs,
![storage-account-desc](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/db3r7gcv4y58vmn8jgto.png)
As we can see in the above image, file service along Queue & Table services are disabled in this account.
Note: I can store blobs (in Containers), files, queue or tables by accessing the respective option under the Data Storage section in the Left Pane.

Now I created another Storage Account where both Blob and File Service are enabled,
![file-service-enabled](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ueucm8i9i3mhphixwcjl.png)

------------------------------------------------------------------

## Redundancy of Storage Accounts
Azure Storage always stores multiple copies of your data so that it's protected from planned and unplanned events, including transient hardware failures, network or power outages, and massive natural disasters. Redundancy ensures that your storage account meets its availability and durability targets even in the face of failures.

## Redundancy in the primary region.
Data in an Azure Storage account is always replicated three times in the primary region. Azure Storage offers two options for how your data is replicated in the primary region:

- Locally redundant storage (LRS) copies your data synchronously three times within a single physical location in the primary region. LRS is the least expensive replication option, but isn't recommended for applications requiring high availability or durability.
- Zone-redundant storage (ZRS) copies your data synchronously across three Azure availability zones in the primary region. For applications requiring high availability, Microsoft recommends using ZRS in the primary region, and also replicating to a secondary region.

## Redundancy in a secondary region.
For applications requiring high durability, you can choose to additionally copy the data in your storage account to a secondary region that is hundreds of miles away from the primary region. If your storage account is copied to a secondary region, then your data is durable even in the case of a complete regional outage or a disaster in which the primary region isn't recoverable.

Azure Storage offers two options for copying your data to a secondary region:
- Geo-redundant storage (GRS) copies your data synchronously three times within a single physical location in the primary region using LRS. It then copies your data asynchronously to a single physical location in the secondary region. Within the secondary region, your data is copied synchronously three times using LRS.
- Geo-zone-redundant storage (GZRS) copies your data synchronously across three Azure availability zones in the primary region using ZRS. It then copies your data asynchronously to a single physical location in the secondary region. Within the secondary region, your data is copied synchronously three times using LRS.


Note: We can set up the Redundancy while creating a Storage Account -or- we can change it after creating an account acc. to our requirements.

------------------------------------------------------------------

## Changing the Redundancy replication of a Storage Account from LRS to GRS

1. As we can see the in the details of the Storage Account, that it is set for LRS replication. 
![storage-account-deployed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2l8fr37udw8oiyz9xcbo.png)

2. Proceed for Configuration in Left Pane of the Storage Account and there change it to GRS in Replication option and save it.
![select-grs](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rs4hwxl2fhuwcinxll07.png)
![config-saved](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/20f6x6vf8qjz0gqswvqn.png)

3. Now we can see that our Storage Account is set for GRS replication.
![grs-deployed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/nx4cnfl3e2zjsoulg21m.png)
![overview-after-grs-deployed](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qc5yvlpu0kz0futr7zp6.png)