StorageLesson 6 of 16

Storage Accounts

An Azure Storage Account is the foundational container for all Azure storage services — Blobs, Files, Queues, and Tables. Everything storage-related starts here.

Simple Explanation

A Storage Account is like a locker rental facility. The account is the building; inside you choose lockers (Blob containers, File shares, Queues, Tables). Different locker types serve different storage needs.

Storage Services Within an Account

ServicePurposeUse When
Blob StorageUnstructured object storageImages, videos, backups, logs, static web assets
Azure FilesManaged SMB/NFS file sharesLegacy app file shares, lift-and-shift
Queue StorageMessage queue for async processingDecouple app components, background jobs
Table StorageNoSQL key-value storeSimple structured data, cheap non-relational storage

Performance Tiers

TierPurposeBacked by
StandardGeneral purpose, balanced costMagnetic (HDD)
PremiumLow-latency, I/O-intensive workloadsSSD

Redundancy Options

RedundancyWhat it meansUse When
LRS (Locally Redundant)3 copies in one datacenterDev/test; cost-sensitive workloads
ZRS (Zone Redundant)3 copies across 3 availability zonesHigh availability in one region
GRS (Geo Redundant)LRS + async copy to paired regionDisaster recovery (secondary read not enabled)
RA-GRS (Read-Access Geo)GRS + read access to secondary regionDR + need to read from secondary
GZRS / RA-GZRSZRS + geo replicationMaximum availability + DR
Naming Constraints

Storage account names must be globally unique, 3–24 characters, lowercase letters and numbers only. Plan your naming convention early — you cannot rename an account after creation.

Visual Representation

Storage Account Hierarchy
Storage Account
mystorageacct
Region: East US
Tier: Standard / Premium
Redundancy: LRS / ZRS / GRS
Services Inside
Blob (containers)
Files (shares)
Queues
Tables
Security
Firewall rules
Private endpoints
RBAC / SAS / Keys
Encryption at rest

Commands

Azure CLI
# Create a standard storage account (LRS)
az storage account create \
  --name mystorageaccountweb \
  --resource-group rg-storage \
  --location eastus \
  --sku Standard_LRS \
  --kind StorageV2

# Create with ZRS (zone-redundant)
az storage account create \
  --name mystorageacctzrs \
  --resource-group rg-storage \
  --location eastus \
  --sku Standard_ZRS \
  --kind StorageV2

# Get connection string
az storage account show-connection-string \
  --resource-group rg-storage \
  --name mystorageaccountweb \
  --output tsv

# List storage accounts
az storage account list --resource-group rg-storage --output table

# Enable soft delete (recovery window = 7 days)
az storage account blob-service-properties update \
  --account-name mystorageaccountweb \
  --resource-group rg-storage \
  --enable-delete-retention true \
  --delete-retention-days 7

# Add firewall rule (restrict to specific IP)
az storage account network-rule add \
  --resource-group rg-storage \
  --account-name mystorageaccountweb \
  --ip-address 203.0.113.10

Hands-on

  1. Create a Standard_LRS storage account in your preferred region.
  2. Browse the Storage account in Portal: find Blob, Files, Queues, Tables.
  3. Enable soft delete for blobs (7-day retention window).
  4. Add a firewall rule to restrict access to your IP only.
  5. Retrieve the connection string and export it as an environment variable.

Debugging Scenario

Issue: App cannot connect to storage account from a VM.

Interview Questions

Beginner

What is a Storage Account?

A top-level Azure resource that groups Blob, File, Queue, and Table storage services. You configure redundancy and performance here; all child services inherit these settings.

Difference between LRS and GRS?

LRS stores 3 copies in one datacenter. GRS adds an asynchronous copy to a paired region for disaster recovery, at ~2x the cost of LRS.

Scenario-based

You need to store backups and access them even if an entire Azure region goes down.

Use GRS or RA-GRS redundancy. GRS replicates data to a paired secondary region. RA-GRS allows reading from the secondary endpoint during primary region failure.

Summary

Storage Accounts are the foundation of Azure Storage. Choose Standard for general workloads and Premium for high-IOPS scenarios. Always select the right redundancy tier (LRS for dev, ZRS/GRS for production) to match your availability and disaster recovery requirements.