🟢 What is Azure Storage?
- A cloud-based storage service for storing different types of data:
- Unstructured (images, videos, docs).
- Semi-structured (JSON, logs).
- Structured (tables).
- Highly available, durable (replicated), and scalable.
👉 Think of it as different storage buckets under one umbrella.
🟢 Core Azure Storage Services
-
Blob Storage → store unstructured data (images, docs, backups, logs).
- Access tiers: Hot, Cool, Archive (cost vs. access trade-off).
- Supports large file uploads (up to TBs).
- Use cases: CDN, backups, static website hosting.
-
Table Storage → NoSQL key-value store.
- Schemaless → good for semi-structured data.
- Use cases: metadata, logs, user profile storage.
-
Queue Storage → message queuing for async communication.
- Simple producer-consumer pattern.
- Use cases: background jobs, task scheduling.
- Max message size: 64 KB.
-
File Storage (Azure Files) → fully managed SMB file shares in the cloud.
- Mountable by Windows, Linux, macOS.
- Use cases: legacy app migration, shared file systems.
🟢 Redundancy Options (Replication)
- LRS (Locally Redundant Storage) → 3 copies within 1 datacenter.
- ZRS (Zone Redundant Storage) → across 3 availability zones.
- GRS (Geo-Redundant Storage) → across 2 regions, read-access optional (RA-GRS).
👉 Interview Tip: If asked “How does Azure ensure durability?” → Answer: by replication (LRS/ZRS/GRS).
🟢 Security
- Shared Access Signatures (SAS) → grant temporary, limited access to storage.
- Managed Identity + RBAC → modern, secure access.
- Encryption → data is encrypted at rest and in transit (TLS).
- Private Endpoints → restrict access to VNET.
🟢 Example: Upload to Blob in .NET
using Azure.Storage.Blobs;
using System;
using System.IO;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
string connStr = "<StorageAccountConnectionString>";
string containerName = "mycontainer";
// Create a client
BlobContainerClient container = new BlobContainerClient(connStr, containerName);
await container.CreateIfNotExistsAsync();
// Upload file
BlobClient blob = container.GetBlobClient("sample.txt");
using FileStream fileStream = File.OpenRead("sample.txt");
await blob.UploadAsync(fileStream, overwrite: true);
Console.WriteLine("✅ File uploaded!");
}
}
🟢 Monitoring
- Azure Monitor + Storage Metrics → track capacity, transactions, latency.
- Diagnostic logs → audit operations on blobs/queues/files.
🟢 Common Interview Questions
- What are the different types of Azure Storage?
- Difference between Blob Storage access tiers (Hot, Cool, Archive)?
- When to use Queue Storage vs. Service Bus?
- How do you secure access to Blob Storage?
- What is SAS? How is it different from Managed Identity?
- How does Azure ensure durability of storage?
- Difference between Table Storage and Cosmos DB?
- How do you host a static website in Blob Storage?
🟢 Pros & Cons
✅ Pros
- Highly scalable & durable.
- Multiple redundancy & tiering options.
- Easy integration with Azure services.
❌ Cons
- Latency if accessed across regions.
- Costs can grow with frequent access.
- Queue Storage is basic (no topics, sessions → use Service Bus instead).
✅ Quick Recap
- Blob → unstructured data (Hot/Cool/Archive).
- Table → NoSQL key-value store.
- Queue → simple messaging.
- Files → SMB shares.
- Secure with SAS + Managed Identity + RBAC.
- Replication options → LRS, ZRS, GRS.
Comments
Post a Comment