intermediate

Blob Storage

Store object data with containers, access tiers, SAS tokens, lifecycle policy, CDN integration, and backup considerations.

Azure Blob Storage stores unstructured objects in containers with tiered pricing (Hot, Cool, Archive), optional immutability, and CDN fronting for static delivery. Access uses Azure RBAC, shared access signatures (SAS), or managed identity from App Service, Functions, and AKS.

| Tier | Typical use | |------|-------------| | Hot | Frequent reads and writes | | Cool | Infrequent access with lower storage cost | | Archive | Rare retrieval; rehydration latency applies |

					const { BlobServiceClient } = require('@azure/storage-blob');
const client = BlobServiceClient.fromConnectionString(process.env.AZURE_STORAGE);
await client.getContainerClient('uploads').getBlockBlobClient(key).upload(data, data.length);
				

On interviews: blob vs Azure Files vs disk; SAS scope and expiry; lifecycle rules to tier old assets; direct browser upload via user-delegation SAS; and consistency expectations for listing after upload.

Common pitfalls: public containers by mistake; long-lived SAS tokens in frontend code; serving large files through the app tier instead of signed URLs; and no lifecycle policy on log or backup buckets.

The trade-off is cheap durable storage and CDN-friendly static delivery versus eventual listing consistency, egress cost, and the need to design upload auth carefully.

Checklist:

  • Default containers to private with least-privilege RBAC.
  • Prefer short-lived SAS or user-delegation for uploads.
  • Set lifecycle rules for logs, backups, and temp files.
  • Front static assets with CDN and cache headers.
  • Monitor capacity, transaction count, and egress spend.