CHAPTER 05
Azure Storage Services
Updated: May 15, 2026
20 min read
# CHAPTER 5
Azure Storage Services
1. Introduction
If you are building the next Netflix or Instagram, you cannot store millions of videos and photos on the hard drive of a Virtual Machine. If the VM crashes, the data is gone, and VM hard drives (Managed Disks) are incredibly expensive to scale. Enter Azure Storage. Azure Storage is a massive, highly durable, and incredibly cheap cloud storage solution. In this chapter, we will learn how to create Storage Accounts, manage access tiers to save money, and host a static website directly from storage without a server.2. Learning Objectives
By the end of this chapter, you will be able to:- Define the four core services: Blob, File, Queue, and Table storage.
- Understand the hierarchy of Storage Accounts and Containers.
- Choose the correct Access Tier (Hot, Cool, Cold, Archive).
- Upload and manage blobs via the Azure Portal.
- Host a public, static HTML website using Azure Blob Storage.
3. Beginner-Friendly Explanation
Imagine a massive, magical warehouse.- Disk Storage (VM Hard Drives): Like a filing cabinet in your office. Fast, structured, but has a strict physical limit. When it's full, you have to buy a bigger cabinet.
- Blob Storage (Azure Storage): Like throwing boxes into an infinitely expanding warehouse. You don't organize the boxes on shelves; you just attach a barcode label (the URL) to the box and throw it in. When you need the box, you ask the warehouse for the barcode, and it instantly retrieves it. The warehouse never gets full, and you only pay for the exact space your boxes take up.
4. The Four Core Storage Services
When you create a "Storage Account" in Azure, it gives you access to four distinct services:- 1. Blob Storage: "Binary Large Object". Designed for massive amounts of unstructured data (Images, Videos, Backups, Documents). This is the most popular service.
-
2.
File Storage: Fully managed file shares accessible via standard SMB protocol. You can mount it like a network
Z:drive on multiple Windows VMs simultaneously.
- 3. Queue Storage: A messaging store for reliable communication between application components (used to decouple microservices).
- 4. Table Storage: A NoSQL key/attribute store for rapid development using massive datasets.
5. Access Tiers (Saving Money)
Azure charges you based on *how often* you need to access the data stored in Blob Storage.- 1. Hot Tier: Best for data accessed frequently (e.g., profile pictures on a live website). Highest storage costs, lowest access costs.
- 2. Cool Tier: Best for data stored for at least 30 days and accessed infrequently (e.g., short-term backups).
- 3. Cold Tier: Best for data stored for at least 90 days.
- 4. Archive Tier: Best for data you hope to *never* access, stored for at least 180 days (e.g., legal compliance logs). Extremely cheap to store, but incredibly expensive and slow (can take up to 15 hours) to download!
6. Storage Accounts and Containers
In Blob Storage, data is organized hierarchically:-
Storage Account: The top-level namespace. *Crucial Rule:* Storage Account names must be Globally Unique across all of Azure, all lowercase, with no spaces (e.g.,
myphotostore12345).
- Container: A folder inside the Storage Account.
-
Blob: The actual file (e.g.,
image.jpg) inside the Container.
7. Mini Project: Host a Static Website
We don't need an expensive Virtual Machine to host a simple HTML/CSS website!Step-by-Step Tutorial:
-
1.
On your laptop, create an
index.htmlfile with a simple<h1>Hello World from Azure Storage!</h1>tag.
- 2. In the Azure Portal, search for Storage accounts. Click + Create.
-
3.
Resource group:
rg-web-demo.
-
4.
Storage account name: Give it a unique, lowercase name (e.g.,
myazurewebsite9988).
-
5.
Region:
East US.
-
6.
Redundancy: Choose
Locally-redundant storage (LRS)to save money. Click Review + create, then Create.
- 7. Once deployed, go to the resource.
- 8. Scroll down the left menu to Data management and click Static website.
- 9. Click Enabled.
-
10.
Index document name: type
index.html. Click Save.
-
11.
Azure automatically creates a special container named
$weband provides you a Primary endpoint URL. Copy this URL.
- 12. Now, go to the left menu under Data storage and click Containers.
-
13.
Click the
$webcontainer.
-
14.
Click Upload, and select your
index.htmlfile from your laptop.
- 15. Paste the Primary endpoint URL into your browser. Your website is live on the internet, and you are paying fractions of a penny to host it!
8. Real-World Scenarios
A hospital generates thousands of MRI images (10GB total) daily. They need immediate access to MRIs taken this week (Hot Tier). However, by law, they must keep all MRIs for 7 years. A Cloud Engineer configures a Lifecycle Management Policy on the Storage Account. The rule automatically moves any MRI older than 30 days into the ultra-cheap "Archive" tier. This zero-maintenance automation saves the hospital hundreds of thousands of dollars a year in storage costs.9. Best Practices
- Shared Access Signatures (SAS): Never share your Storage Account Access Keys! If you want to let a user temporarily download a private file, generate a SAS URL. It is a unique link that grants read-only access to a specific file, and automatically expires after exactly 10 minutes.
10. Cost Optimization Tips
- Use the Right Tier: If you dump 50 Terabytes of disaster recovery backups into the "Hot" tier, you will receive a massive bill. Analyze how often data is accessed and relentlessly utilize Cool or Archive tiers for backups.
11. CLI Examples
To create a new storage container via the Azure CLI:
bash
12. Exercises
- 1. Why must an Azure Storage Account name be globally unique across all of Azure?
-
2.
Explain the financial tradeoff between the
Hotaccess tier and theArchiveaccess tier.
13. FAQs
Q: Can I run a PHP or Node.js backend using Blob Storage static website hosting? A: No. Blob Storage can only host "Static" assets (HTML, CSS, JavaScript, Images). It has no compute power to execute backend server-side code. For PHP/Node.js, you need Azure App Service.14. Interview Questions
- Q: Describe the architectural difference between Disk Storage (Managed Disks) and Object Storage (Blob). When would you architecturally mandate the use of one over the other?
- Q: A client needs to store petabytes of financial compliance logs that must be retained for 5 years but will likely never be audited. Detail your storage tier recommendation and explain how you would automate the cost-reduction pipeline over time.