An Azure Storage account is a container for Azure's core storage services, sharing one namespace (https://<account>.<service>.core.windows.net), security settings, redundancy choice and billing. It provides: - Blob Storage: objects and files (images, documents, backups, logs). Data Lake Storage Gen2 adds a hierarchical namespace for analytics. - Azure Files: SMB or NFS file shares. - Queue Storage: simple message queues. - Table Storage: key-value NoSQL data. Account settings include performance (Standard or Premium), redundancy (LRS, ZRS, GRS, GZRS), access tier defaults (Hot, Cool, Cold, Archive), network rules and encryption. How I used it to upload files (example project answer) "Users uploaded invoices and documents from our Angular app. We stored files in Blob Storage and metadata in SQL." Flow: 1. The client asks the API for permission to upload. The API checks authorization, validates the file type and size limits, and creates a short-lived user delegation SAS URL with write-only permission for one blob name it generates (a GUID-based path, not the user's file name). 2. The browser uploads directly to Blob Storage with that SAS URL (chunked upload for large files), so big files do not pass through our API. 3. An Event Grid BlobCreated event triggers a Function that scans the file, validates its content type, and marks it as available in the database. For smaller files, uploading through the API is also fine: var blobClient = new BlobServiceClient(new Uri(accountUrl), new DefaultAzureCredential()) .GetBlobContainerClient("invoices") .GetBlobClient($"{tenantId}/{Guid.NewGuid()}.pdf"); await blobClient.UploadAsync(file.OpenReadStream(), new BlobUploadOptions { HttpHeaders = new() { ContentType = "application/pdf" } }, ct); Security and operations - Managed identity with the Storage Blob Data Contributor role; account key access and anonymous blob access disabled. - Private container; downloads through authorized API endpoints or short-lived read SAS URLs. - Soft delete and versioning for recovery; lifecycle rules to move older files to the Cool or Archive tier. - Private endpoint or firewall rules, and Microsoft Defender for Storage for malware scanning of uploads.
Ravindra Wadile · · 0 likes