Skip to main content

☁️ Azure Storage Short Notes

🟢 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

  1. 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.
  2. Table Storage → NoSQL key-value store.

    • Schemaless → good for semi-structured data.
    • Use cases: metadata, logs, user profile storage.
  3. Queue Storage → message queuing for async communication.

    • Simple producer-consumer pattern.
    • Use cases: background jobs, task scheduling.
    • Max message size: 64 KB.
  4. 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

  1. What are the different types of Azure Storage?
  2. Difference between Blob Storage access tiers (Hot, Cool, Archive)?
  3. When to use Queue Storage vs. Service Bus?
  4. How do you secure access to Blob Storage?
  5. What is SAS? How is it different from Managed Identity?
  6. How does Azure ensure durability of storage?
  7. Difference between Table Storage and Cosmos DB?
  8. 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

Popular posts from this blog

☁️ Azure Key vault Short Notes

🟢 What is Azure Key Vault? A cloud service for securely storing and accessing secrets, keys, and certificates . Removes the need to keep secrets (like connection strings, passwords, API keys) inside code or config files. Provides centralized secret management, encryption, and access control . 👉 Think of it like a secure password manager but for your applications. 🟢 Key Features Secrets → store text values (e.g., DB connection string, API key). Keys → store cryptographic keys (RSA, EC) for encryption, signing. Certificates → store/manage SSL/TLS certificates. Access Control → Access Policies (older model). Azure RBAC (modern, preferred). Integration → works with App Service, Functions, AKS, VMs, SQL DB, etc. Logging → audit who accessed secrets via Azure Monitor / Diagnostic Logs. 🟢 Why Use Key Vault? Security → secrets are encrypted with HSM (Hardware Security Modules). Compliance → meet industry standards (PCI-DSS, ISO, GDPR). Automation → aut...

🗑️ Garbage Collection & Resource Management in .NET (C#) — Beginner Friendly Guide

When you start working with .NET and C#, one of the biggest advantages is that you don’t need to manually manage memory like in C or C++. The Garbage Collector (GC) does most of the work for you. But here’s the catch — not everything is managed automatically. Some resources like files, database connections, sockets, and native memory still need special handling. This blog will help you understand: ✔ How the GC works ✔ What are managed vs unmanaged resources ✔ The difference between Dispose , Finalize , and using ✔ The Dispose pattern with examples ✔ Best practices every C# developer should know 1) How Garbage Collection Works in .NET Managed resources → Normal .NET objects (string, List, etc.). GC frees them automatically. Unmanaged resources → External resources like file handles, database connections, sockets, native memory. GC cannot clean them up — you must do it. 👉 GC uses a Generational Model for performance: Gen 0 : Short-lived objects (local variables, t...

🚀 Onboard a New API in Microsoft Entra and Consume It — with Full Examples

This article shows how to: Register your API in Microsoft Entra (Azure AD) and expose a scope. Register clients (daemon and web client) and grant permissions. Protect a .NET Web API (ASP.NET Core) using Microsoft.Identity.Web . Call the API from: a daemon/service using client credentials a backend that performs On-Behalf-Of (OBO) to call a downstream API Replace placeholders like YOUR_TENANT_ID , API_CLIENT_ID , CLIENT_APP_ID , and CLIENT_SECRET with actual values from the portal. ✳️ Portal steps (brief) Register API ( MyProductApi ) Azure Portal → Microsoft Entra ID → App registrations → New registration → MyProductApi Note: Application (client) ID → API_CLIENT_ID , Directory (tenant) ID → YOUR_TENANT_ID Expose an API App → Expose an API → Set Application ID URI to api://{API_CLIENT_ID} (default) or https://contoso.com/my-api Add a scope : Scope name: access_as_user Admin consent display name: Access MyProductApi as user Who can consent: Admins a...