2.1 — Foundation

Storage Account

MS Docs

A Storage Account is the top-level container for all Azure storage services. One account = one namespace, one set of access keys, one firewall, one redundancy configuration. Everything storage-related sits inside it.

📖 Storage Account — Complete Explanation

Every piece of data in Azure Blob, Azure Files, Azure Queues, or Azure Tables lives inside a Storage Account. It's the top-level container — not the data itself, but the envelope that holds everything.

One account = one namespace. Your storage account name becomes the globally unique DNS prefix: kubestgprod.blob.core.windows.net. This is why names must be globally unique — two storage accounts cannot share a public hostname.

One account = one set of keys. There are exactly two account keys (Key1 and Key2). Anyone with either key has full access to everything inside — all blobs, all files, all queues. This is why you almost never use account keys directly. Instead you use SAS tokens (scoped, time-limited) or Managed Identity (no keys involved).

One account = one firewall. Storage firewall rules apply at the account level, not per container. If you restrict to a VNet subnet, that restriction applies to all blobs, files, and queues in that account.

One account = one redundancy configuration. You can't have some blobs in LRS and others in GRS inside the same account. The redundancy choice is account-wide. This is why large organisations often have multiple storage accounts — one for hot operational data (LRS, cheaper) and one for compliance archives (GRS, more durable).

🏭
The Metaphor

A Storage Account is like a warehouse building. The building has one address (endpoint), one security system (access keys + firewall), and one backup policy (redundancy). Inside the building are different rooms: the Blob room (open shelves — any box, any size), the Files room (filing cabinets — familiar Windows share), the Queue room (conveyor belt — messages in order), and the Table room (index cards — simple key-value data).

Storage Account — Complete Architecture
STORAGE ACCOUNT · kubestgprod eastus · GPv2 · HTTPS endpoint kubestgprod.blob.core.windows.net Blob Storage Block Blob Append Blob Page Blob Hot / Cool / Cold / Archive IoT data, images, backups, logs Azure Files SMB 3.0 / NFS 4.1 Port 445 (SMB) Azure File Sync agent Shared drives, lift-and shift file servers Queue Storage 64KB max per message Ordered FIFO messages 7-day default TTL Async job processing, decoupling services Table Storage PartitionKey + RowKey Schema-less NoSQL 1MB max per entity Structured data, metadata, device registries Access Layer (applies to ALL services above) Account Keys SAS Tokens Entra ID RBAC Managed Identity Firewall / VNet

Storage Account Types

TypeServicesAccess TiersRedundancyUse
GPv2 (General Purpose v2)Blob, Files, Queue, TableHot/Cool/Cold/ArchiveAll optionsDEFAULT — always use this
Premium Block BlobBlob ONLYAlways HotLRS / ZRS onlyIoT telemetry, analytics, low latency <1ms
Premium File SharesFiles ONLYN/ALRS / ZRS onlyHigh-performance SMB file shares
GPv1 (legacy)AllNoneAll optionsAvoid — upgrade to GPv2
💡
Kube context
For Kube IoT sensor data (high write throughput, sub-millisecond latency required): Premium Block Blob. For general config files, reports, exports: GPv2. Premium cannot have Archive tier — all data stays Hot.

Naming Rules — Exam Tested

Storage Account Naming
3–24 Characters · Lowercase + Numbers Only · Globally Unique
Valid: kubestgprod, iotdata2026, kiran123storage

Invalid: Kube-Storage (has uppercase + hyphen), st (too short), a-very-long-storage-account-name-that-exceeds-24 (too long)

Why globally unique: the storage account name becomes part of the public DNS endpoint (name.blob.core.windows.net). Two accounts cannot share a DNS name.
⚠️
Most Failed Naming Exam Questions
kube-storage — INVALID (has hyphen)
KubeStorage — INVALID (uppercase letters)
ps — INVALID (only 2 chars, minimum is 3)
Common trap: they give you 4 names and ask which is valid — look for hyphens and capitals first.
2.2 — Durability

Redundancy Options

MS Docs

Azure replicates your data automatically. You choose HOW MANY copies and WHERE. More geographic spread = higher durability = higher cost.

💾
The Metaphor

LRS: 3 copies in the same room. Room burns down → all gone.
ZRS: 3 copies in 3 different buildings (zones) in the same city. City floods → all gone.
GRS: 3 copies in your city + 3 copies in another city 500km away. Your city destroyed → second city has it.
GZRS: Best of both — 3 copies across 3 buildings in your city AND 3 in another city.

Redundancy — Visual Comparison
LRS Locally Redundant 1 Datacenter 1 2 3 11 nines (99.999999999%) Cheapest · Compliance: 1 region ❌ Datacenter fire → data lost ZRS Zone Redundant 3 Zones · Same Region Z1 Z2 Z3 12 nines Compliance: stays in region ❌ Regional disaster → data lost GRS Geo Redundant Primary East US 3 copies async Secondary West US 3 copies 16 nines · 500+ km apart Read secondary on failover only ✓ Survives regional disaster ❌ Cannot read secondary live RA-GRS / GZRS Read-Access Geo / Geo-Zone Primary GZRS: 3 zones RA-GRS: 1 zone Secondary READ ANYTIME GZRS: 16 nines · highest cost -secondary suffix URL for reads ✓ Highest availability ✓ Read without failover
SKUCopiesZonesRegionsRead SecondaryData stays in 1 region?
LRS311✓ Yes
ZRS331✓ Yes
GRS612Failover only✗ No
GZRS632Failover only✗ No
RA-GRS612✓ Always✗ No
RA-GZRS632✓ Always✗ No
⚠️
Premium Storage + Redundancy Limitation
Premium Block Blob and Premium File Shares only support LRS or ZRS. No GRS, no RA-GRS. If compliance requires geo-redundancy AND you need premium performance — you cannot have both in a single account. Use GPv2 GRS for compliance or accept LRS for premium.
📋
Scenario → Answer Map
"Data MUST stay in one region (compliance/sovereignty)" → LRS or ZRS only
"Survive complete regional outage" → GRS or GZRS
"Read from secondary during normal operations" → RA-GRS or RA-GZRS
"Cheapest possible" → LRS
"IoT data, highest write throughput" → Premium Block Blob (LRS)
2.3 — Blob Storage

Blob Storage

MS Docs

Blob = Binary Large OBject. Unstructured data — any format, any size. The workhorse of Azure storage. IoT sensor data, images, videos, backups, logs — all go here.

Three Blob Types

Blob Types — Write Patterns
Block Blob DEFAULT type B1 B2 B3 190TB max Any write pattern · Read/overwrite blocks IoT data · Images · Videos · Backups Hot / Cool / Cold / Archive Append Blob Append ONLY — never modify log entry 1 log entry 2 log entry 3 append → Log files · Audit trails · Streaming data Page Blob Random read/write (512-byte pages) P1 P2✎ P3 8TB max VM managed disks (VHDs) Databases requiring random I/O

Access Tiers — Cost vs Access Speed

MS Docs
📦
The Metaphor

Hot = items on your desk. Instant access, most expensive real estate.
Cool = items in a nearby filing cabinet. Still accessible, cheaper space.
Cold = items in the office storeroom. Rarely needed, cheaper rent.
Archive = items in an off-site warehouse. Cheapest storage, but you need to order them and wait for delivery (rehydration).

Access Tiers — Storage Cost vs Access Cost Tradeoff
HOT Storage cost: ●●●● Access cost: ●○○○ Min duration: None Readable: Instantly Frequently accessed data Active IoT sensor data Live dashboards, APIs COOL Storage cost: ●●●○ Access cost: ●●○○ Min duration: 30 days Readable: Instantly Infrequent access, 30+ days 30-90 day sensor archives Monthly reports COLD Storage cost: ●●○○ Access cost: ●●●○ Min duration: 90 days Readable: Instantly Rarely accessed, 90+ days Quarterly archives Compliance data ARCHIVE Storage cost: ●○○○ Access cost: ●●●● Min duration: 180 days ⚠ Rehydration needed Cheapest · Long-term retention 7-year compliance archives Legal hold, audit trails
⚠️
Archive Rehydration — Exam Always Tests This
Cannot read Archive blobs directly — get error 409 BlobArchived.
Must rehydrate first (change tier to Hot or Cool):
Standard priority: up to 15 hours — cheaper
High priority: under 1 hour — costs more, for urgent recovery

Early deletion penalty: Move blob to Archive at day 1, then delete at day 50 — you still pay for 180 days. Same for Cool (30 days) and Cold (90 days). Azure charges the MINIMUM duration regardless of actual time stored.

Lifecycle Management Policy

Automated Tier Movement
Set Rules Once — Azure Moves Blobs Automatically
Lifecycle policies define: IF blob is X days old AND matches filters → THEN move to tier or delete.

Example For Kube IoT sensor data:
Day 0–30: Hot (active queries)
Day 30–90: Cool (occasional access)
Day 90–365: Archive (compliance)
Day 365: Delete

Important: Policies run ONCE PER DAY. Changes take up to 24 hours to apply. Not real-time. New policy can take up to 24 hours before its first evaluation.
JSON — Lifecycle Policy (Kube platform Data)
{
  "rules": [
    {
      "name": "iot-data-lifecycle",
      "enabled": true,
      "type": "Lifecycle",
      "definition": {
        "filters": {
          "blobTypes": ["blockBlob"],
          "prefixMatch": ["sensor-data/"]  // only this folder
        },
        "actions": {
          "baseBlob": {
            "tierToCool":    { "daysAfterModificationGreaterThan": 30 },
            "tierToArchive": { "daysAfterModificationGreaterThan": 90 },
            "delete":         { "daysAfterModificationGreaterThan": 365 }
          },
          "snapshot": {
            "delete": { "daysAfterCreationGreaterThan": 90 }
          }
        }
      }
    }
  ]
}

# Apply via CLI
az storage account management-policy create \
  --account-name kubestgprod \
  --resource-group RG-Kube-Prod \
  --policy @lifecycle-policy.json

Soft Delete & WORM Immutability

Soft Delete
Deleted but Recoverable
When enabled, deleted blobs go to a soft-deleted state for 1–365 days (you configure).

Two separate settings (exam important):
Blob soft delete: protects individual blobs
Container soft delete: protects entire containers

Must enable BOTH separately. Enabling blob soft delete does NOT protect containers and vice versa.
Immutability / WORM
Write Once, Read Many
Blobs in immutable state cannot be modified or deleted for the retention period.

Two types:
Time-based retention: locked for defined period (e.g. 7 years)
Legal hold: locked indefinitely until hold removed

Once a policy is locked (not just set): even admins cannot remove it. Required for SEC 17a-4 compliance.

Versioning & Snapshots

FeatureHow It WorksExam Key Point
Blob VersioningEvery PUT/overwrite creates new version automaticallyRecover previous version of overwritten blob
Blob SnapshotPoint-in-time read-only copy you trigger manuallyMust be manually created; doesn't auto-capture changes
Object ReplicationAsync copy of blobs from source to dest storage accountRequires versioning enabled on both accounts
2.4 — File Shares

Azure Files

MS Docs

Azure Files provides fully managed file shares accessible via SMB or NFS — the same protocol as Windows shared drives. Lift-and-shift file servers to cloud without changing how apps access them.

🗂️
The Metaphor

Azure Files is like your office's shared network drive (\\server\shared) — but instead of a physical server in the cupboard, Microsoft runs it. Your Windows laptop maps it as Z:, your Linux VM mounts it at /mnt/share. Both see the same files. No server to patch, no disk to replace, no backup to configure.

FeatureSMB (Standard)NFS (Premium only)
ProtocolSMB 3.0 / 2.1NFS 4.1
OSWindows, Linux, macOSLinux only
Storage tierStandard GPv2Premium File Shares only
Port445 (often blocked by ISPs)2049
AuthAD DS / Entra ID / storage keyStorage key only
EncryptionIn-transit (TLS)In-transit NOT supported
⚠️
Port 445 Blocked at Home — Most Common Azure Files Issue
Many ISPs and home routers block TCP port 445 (SMB) as an anti-malware measure. Symptom: Azure file share mounts fine in office, fails at home.

Fix options: (1) Connect via VPN to corporate network, then mount. (2) Use Azure File Sync with local cache instead of direct mount. (3) Use Azure Bastion/Jump box to access from within the VNet.

Azure File Sync

🔄
The Metaphor

Azure File Sync turns your Windows Server into a local cache of the Azure file share. Hot files stay on local SSD (fast access). Cold files exist only in Azure (cloud tiering). When someone opens a cold file — it streams down transparently. Like Google Drive File Stream, but for enterprise file servers.

Azure File Sync — Bidirectional Sync Architecture
Windows Server File Sync Agent installed Local cache (hot files) Cloud tiering enabled On-premises datacenter changes sync up cold files stream down Storage Sync Service Sync group Manages endpoints Conflict resolution Azure File Share Cloud endpoint (truth) ALL files always here Other offices mount direct
Blobfuse2
Mount Blob Container as Linux Filesystem
Blobfuse2 = a FUSE (Filesystem in Userspace) driver that mounts a Blob container as a Linux directory.

Your app reads/writes files normally (/mnt/blobdata/sensor.json) — under the hood it's actually reading/writing Azure Blob over HTTPS.

Compare: Azure File Sync = bidirectional sync with local cache. Blobfuse2 = direct mount, no local copy, every read/write goes to Azure. Different use cases.

Use: ML training jobs accessing large datasets, Linux apps that expect a filesystem path but data lives in Blob.
2.5 — Security

Access & Security

MS Docs

Four ways to access Azure Storage. Choose based on how much access you need to grant, to whom, and for how long.

SAS Tokens — Shared Access Signatures

🎟️
The Metaphor

Your account key is a master key that opens everything forever. You'd never hand that to a contractor.

A SAS token is a scoped, time-limited visitor pass: "You can enter the Blob room only, read files only, for the next 2 hours, only from this IP address." When it expires — gone. No need to change the master key.

SAS Token Types — Security Ranking
Account SAS Signed by Account Key Scope: ALL services (Blob+Files+Queue+Table) Broadest access · Highest risk Revoke: rotate account key ⚠ Avoid for production sharing Service SAS Signed by Account Key Scope: ONE service (Blob OR Files OR Queue) Narrower access · Medium risk Revoke: rotate account key OK for short-lived delegation User Delegation SAS ✓ MOST SECURE Signed by Entra ID credentials Scope: Blob only No account key involved Revoke: revoke Entra permission ✓ Use this for production
Animated — SAS Revocation: With Policy vs Without Policy
✓ WITH Stored Access Policy (Recommended) SAS Token A → Policy "read-2026" SAS Token B → Policy "read-2026" Stored Access Policy "read-2026" DELETE Policy Deleted Instant revoke ✓ Token A & B both invalid ✓ Other tokens unaffected ✓ Account key NOT changed ✗ WITHOUT Stored Access Policy SAS Token A Only option: Rotate Account Key ⚠ ALL tokens invalid + other apps break
⚠️
How to REVOKE a SAS Token — Critical Exam Question
If Stored Access Policy exists: Delete the policy → SAS immediately revoked ✅ (fastest, no impact on other apps)

If raw SAS (no policy): Only option is rotate the account key → ALL SAS tokens signed by that key are invalidated → breaks other apps using same key ⚠️

Best practice: Always back SAS tokens with a Stored Access Policy for easy, targeted revocation. One policy can control many SAS tokens.
Azure CLI — Generate SAS + Stored Access Policy
# Create Stored Access Policy on container
az storage container policy create \
  --account-name kubestgprod \
  --container-name sensor-data \
  --name "read-policy-2026" \
  --permissions r \
  --expiry "2026-12-31"

# Generate SAS backed by that policy
az storage container generate-sas \
  --account-name kubestgprod \
  --name sensor-data \
  --policy-name "read-policy-2026" \
  --output tsv

# Revoke: just delete the policy
az storage container policy delete \
  --account-name kubestgprod \
  --container-name sensor-data \
  --name "read-policy-2026"
# SAS tokens backed by this policy now INVALID ✅

Storage Firewall & Virtual Network Access

MethodWhat It DoesCostTraffic PathOn-Prem Access
No restrictionStorage accessible from anywhere (default)FreePublic internet
IP firewall rulesAllow specific public IPs onlyFreePublic internet from allowed IPs✓ if IP listed
Service EndpointVNet traffic via MS backbone, restrict to subnetFreeVNet → MS backbone → Storage public IP✗ Cannot use
Private EndpointStorage gets private IP inside your VNetHourly + dataStays entirely in VNet✓ Via VPN/ER
⚠️
Service Endpoint Requires TWO Steps — Most Missed
Step 1: Enable Service Endpoint (Microsoft.Storage) on the VM's subnet
Step 2: Add VNet/subnet rule in Storage Account firewall → Selected Networks → Add VNet

Step 1 alone = VMs route via MS backbone but Storage still accepts traffic from anywhere.
Step 2 alone (without Step 1) = Rule exists but traffic still routes over internet.
Both required for private-backbone + restricted access.

Identity-Based Access for Azure Files

Azure Files — Auth Options
Share-Level + File/Dir Level Permissions
Azure Files supports identity-based access — no storage key needed:

On-premises AD DS: join storage account to on-prem AD, use Windows NTFS permissions + SMB ACLs
Entra ID Kerberos: for cloud-only (no on-prem DC needed), hybrid identities
Entra Domain Services: Azure-managed AD DS

Two layers of permissions:
Share-level RBAC: Storage File Data SMB Share Contributor/Reader
Directory/file NTFS ACLs: granular file-level permissions via Windows File Explorer or icacls
2.6 — Migration

Data Transfer & Migration Tools

MS Docs
ToolDirectionSpeedBest ForKey Fact
AzCopyLocal↔Azure or Azure↔AzureFast (parallel)Scripted bulk transfers, storage-to-storage copyNo local download on account-to-account copy
Storage ExplorerGUI toolMediumAd-hoc management, browsing, small transfersDesktop app — free download
Azure Import/ExportPhysical disk to/from AzureShip daysWhen internet is too slow for data volumeYou ship drives to MS datacenter
Data BoxPhysical applianceShip days80TB–1EB offline transferMS ships you a device, you fill it, ship back
Data Box HeavyPhysical applianceShip days1EB+ transfersLargest — 770TB usable capacity per device
Azure File SyncOn-prem server↔Azure FilesContinuousLift-and-shift + hybrid file serversBidirectional — NOT one-way like AzCopy
📋
AzCopy vs Azure File Sync — Key Difference
AzCopy: one-time or scheduled one-way copy. Not continuous. CLI-based.
Azure File Sync: continuous bidirectional sync with local caching. Server-based agent.

Exam scenario: "Copy 500GB from storage account A to storage account B" → AzCopy
Exam scenario: "Windows file server needs to sync with Azure Files ongoing" → Azure File Sync
AzCopy — Key Commands
# Copy local folder to Blob container
azcopy copy 'C:\sensor-data\*' \
  'https://kubestgprod.blob.core.windows.net/sensor-data?<SAS>' \
  --recursive

# Copy between two storage accounts (no local download)
azcopy copy \
  'https://source.blob.core.windows.net/container?<SAS>' \
  'https://dest.blob.core.windows.net/container?<SAS>' \
  --recursive

# Sync (like rsync — only copies changed/new files)
azcopy sync \
  'C:\reports' \
  'https://kubestgprod.blob.core.windows.net/reports?<SAS>' \
  --delete-destination true

# Authenticate with Managed Identity (recommended)
azcopy login --identity
# Then copy without SAS token
azcopy copy 'source' 'destination'
Exam Prep

Phase 2 — Exam Q&A

Exam Guide

Click to reveal. Based on real AZ-104 exam patterns from last 2–3 years.

Q A company needs to store 7 years of IoT sensor logs for compliance. The data is never accessed after 90 days. Minimize cost. What storage tier and settings?
ANSWER
GPv2 storage account + Archive tier after 90 days + Lifecycle Management Policy.

Configure lifecycle rule: move to Cool at 30 days, Archive at 90 days, delete at 7 years (2555 days).
Also enable WORM immutability policy (locked) if regulatory compliance requires data cannot be modified/deleted during retention period (e.g., SEC 17a-4).

⚠️ Trap: if using Archive, you cannot read data directly. Any compliance read access requires rehydration (up to 15 hours). Factor this into SLA planning.
Q A storage account is shared with an external partner via SAS token. The partner's credentials were compromised. The SAS has no Stored Access Policy. How do you revoke access immediately?
ANSWER
Rotate the storage account key that was used to sign the SAS token.

This immediately invalidates ALL SAS tokens signed by that key. Side effect: any other app using that key or SAS tokens from it will also break — must update those apps with new key/SAS.

Lesson: Always create SAS tokens backed by Stored Access Policy. Then you can delete the policy to revoke specific SAS without affecting others.
Q A VM cannot access Azure Storage even though a Service Endpoint is configured on the subnet. What is the most likely missing step?
ANSWER
Storage Account firewall not configured to allow the VNet/subnet.

Service Endpoint has 2 required steps:
✅ Step 1 done: Service Endpoint enabled on subnet
❌ Step 2 missing: Storage Account → Networking → Selected Networks → Add the VNet and subnet

Without Step 2, storage still accepts traffic from everywhere (default allow) but the Service Endpoint provides no restriction OR the firewall may be set to deny all, blocking the VM.
Q You need to grant an external vendor read access to specific blobs for 48 hours. The most secure method that doesn't use account keys?
ANSWER
User Delegation SAS token (signed by Entra ID credentials, Blob only, expiry 48 hours).

User Delegation SAS = most secure because:
1. Not signed by account key (key not exposed)
2. Backed by Entra ID identity (audited)
3. Max validity = 7 days (capped by Azure)
4. Revocable by revoking the delegating user's permissions

⚠️ User Delegation SAS works for Blob service only. Not supported for Files, Queue, or Table.
Q An admin deleted critical production blobs by mistake. Soft delete was NOT enabled. Is recovery possible?
ANSWER
If versioning was enabled: yes — restore from previous version. If soft delete AND versioning both disabled: no recovery possible.

Recovery options in order of preference:
1. Blob versioning: previous versions available if enabled
2. Azure Backup: operational backup for Blob (requires Backup Vault)
3. Object Replication: if configured to another account, copies exist there
4. No options if none of the above were configured

Best practice: enable both soft delete AND versioning on production storage.
Q Which is correct for a storage account name? (a) Kube-Storage (b) kubestorage2026 (c) ps (d) kube_storage
ANSWER
(b) kubestorage2026

(a) INVALID — uppercase P + hyphen
(b) VALID — lowercase letters and numbers, 22 chars ✅
(c) INVALID — only 2 chars (minimum 3)
(d) INVALID — underscore not allowed

Rules: 3–24 chars · lowercase letters and numbers ONLY · no hyphens · no underscores · globally unique
Q A company needs storage that survives complete regional outage AND allows reading from secondary region without waiting for failover. What redundancy option?
ANSWER
RA-GRS (Read-Access Geo Redundant Storage) or RA-GZRS.

RA-GRS = 6 copies across 2 regions, secondary region readable always via -secondary suffix URL
RA-GZRS = same but primary region uses 3 availability zones (more resilient)

⚠️ GRS alone does NOT allow reading secondary. Must be RA-GRS or RA-GZRS for live read access.
Phase 2 — Cheat Sheet
Storage account name has hyphen — valid?INVALID — lowercase + numbers only, no hyphens
Cheapest long-term storageArchive tier — lowest storage cost
Log files, append-only writesAppend Blob
VM disk storage typePage Blob (VHD files)
Cannot read Archive blobRehydrate first — Standard (15hr) or High priority (<1hr)
Lifecycle policy not working after creationUp to 24 hours for first evaluation — expected
Revoke SAS immediately, no policyRotate account key — breaks all SAS from that key
Most secure SAS typeUser Delegation SAS — signed by Entra ID, Blob only
IoT data, sub-ms latencyPremium Block Blob (LRS only, no Archive)
Data must stay in one regionLRS or ZRS only
Read secondary without failoverRA-GRS or RA-GZRS
Service Endpoint still accessible from internetMissing Step 2 — Storage firewall must add VNet rule
500TB offline migrationAzure Data Box — physical appliance
AzCopy vs Azure File SyncAzCopy = one-way, one-time. File Sync = bidirectional, continuous
Blob soft delete vs Container soft deleteEnable both separately — one doesn't cover the other