Stage 5 · Platform
Storage & Secrets
Azure Storage
Blob, File, Queue, Table — choosing the right storage tier and access patterns.
Azure Storage Services
Azure Storage provides durable, highly available, massively scalable cloud storage. The four core services are Blob (object storage), File (SMB/NFS shares), Queue (message queuing), and Table (NoSQL key-value).
| Service | Type | Use Case | Protocol |
|---|---|---|---|
| Blob Storage | Object storage | Images, documents, backups, data lake | REST API |
| Azure Files | File shares | Lift-and-shift, shared config | SMB 3.0, NFS 4.1 |
| Queue Storage | Message queue | Async processing, decoupling | REST API |
| Table Storage | NoSQL | Structured data, IoT telemetry | REST API / OData |
Blob Storage
Blob Storage is Azure's object storage service. It stores unstructured data — files of any type and size. Blobs are organized into containers (similar to S3 buckets), and each blob has a URL for direct access.
# Create a storage account
az storage account create \
--name stpaymentsprod \
--resource-group rg-payments \
--location eastus \
--sku Standard_LRS \
--kind StorageV2 \
--access-tier Hot
# Create a blob container
az storage container create \
--account-name stpaymentsprod \
--name uploads \
--public-access off
# Upload a blob
az storage blob upload \
--account-name stpaymentsprod \
--container-name uploads \
--name backups/db-backup-2025-01-15.tar.gz \
--file ./db-backup-2025-01-15.tar.gzStorage account names must be globally unique, 3-24 characters, lowercase letters and numbers only.
Access Tiers
Blob Storage offers three access tiers optimized for different usage patterns. Hot for frequently accessed data, Cool for infrequently accessed data, and Archive for data accessed less than once a year.
| Tier | Storage Cost | Access Cost | Minimum Retention |
|---|---|---|---|
| Hot | Highest | Lowest | None |
| Cool | Medium | Medium | 30 days |
| Cold | Low | Higher | 90 days |
| Archive | Lowest | Highest | 180 days |
# Move a blob to Cool tier
az storage blob set-tier \
--account-name stpaymentsprod \
--container-name uploads \
--name backups/db-backup-2025-01-15.tar.gz \
--tier Cool
# Move to Archive tier
az storage blob set-tier \
--account-name stpaymentsprod \
--container-name uploads \
--name backups/db-backup-2024-01-15.tar.gz \
--tier ArchiveArchive blobs are not directly accessible — you must rehydrate them first (which takes up to 15 hours). Plan your tiering strategy based on actual access patterns.
Azure Storage Lifecycle Management policies can automatically move blobs between tiers based on age. For example, move to Cool after 30 days, Archive after 365 days.
Storage Accounts
A storage account is a container for all your storage resources. It defines the billing boundary, redundancy model, and access tier. Each storage account has a unique namespace.
# Create with ZRS (Zone-Redundant Storage)
az storage account create \
--name stpaymentszrs \
--resource-group rg-payments \
--sku Standard_ZRS \
--kind StorageV2
# Create with GRS (Geo-Redundant Storage)
az storage account create \
--name stpaymentsgrs \
--resource-group rg-payments \
--sku Standard_GRS \
--kind StorageV2
# Check redundancy status
az storage account show \
--name stpaymentsprod \
--query "{sku:sku.name, kind:kind, accessTier:accessTier}" \
--output jsonZRS provides 99.99% availability across zones. GRS replicates to a paired region but only provides 99.9% availability. Choose based on your availability requirements.
Azure Files
Azure Files provides fully managed SMB and NFS file shares. It is commonly used for lift-and-shift scenarios, shared application configuration, and persistent storage for containers.
# Create a file share
az storage share-rm create \
--storage-account stpaymentsprod \
--name config-files \
--quota 100
# Mount from a Linux VM
sudo mount -t cifs //stpaymentsprod.file.core.windows.net/config-files /mnt/config \
-o vers=3.0,username=stpaymentsprod,password=$STORAGE_KEY,dir_mode=0777,file_mode=0777For AKS, use the Azure Files CSI driver to mount file shares as persistent volumes in pods.
Queue and Table Storage
Queue Storage provides reliable message queuing for asynchronous communication. Table Storage is a NoSQL key-value store for rapid development with structured data.
# Create a queue
az storage queue create \
--account-name stpaymentsprod \
--name order-processing
# Create a table
az storage table create \
--account-name stpaymentsprod \
--name AuditLog
# Send a message to the queue
az storage message put \
--account-name stpaymentsprod \
--queue-name order-processing \
--content "Order #12345 processed"For high-throughput messaging, consider Azure Service Bus instead of Queue Storage. Service Bus provides topics, sessions, and dead-letter queues.
Azure Storage costs are a combination of capacity (GB/month), transactions (per 10,000), and data retrieval. Optimize for your access pattern — Cool storage has lower capacity cost but higher transaction cost.
Mark this lesson complete to store local progress and unlock a cleaner resume path the next time you visit.