Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Manage Azure Storage services including Blob, File Shares, Queues, Tables, and Data Lake
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/sdk/azure-storage-blob-ts.md
1# Blob Storage — TypeScript SDK Quick Reference23> Condensed from **azure-storage-blob-ts**. Full patterns (SAS generation,4> append/page blobs, streaming, browser uploads, error handling)5> in the **azure-storage-blob-ts** plugin skill if installed.67## Install8npm install @azure/storage-blob @azure/identity910## Quick Start11```typescript12import { BlobServiceClient } from "@azure/storage-blob";13import { DefaultAzureCredential } from "@azure/identity";14const client = new BlobServiceClient(`https://${accountName}.blob.core.windows.net`, new DefaultAzureCredential());15```1617## Best Practices18- Use DefaultAzureCredential for **local development only** — in production, use ManagedIdentityCredential. See [auth-best-practices.md](../auth-best-practices.md)19- Use streaming for large files — `uploadStream`/`downloadToFile` for files > 256MB20- Set appropriate content types — use `setHTTPHeaders` for correct MIME types21- Use SAS tokens for client access — generate short-lived tokens for browser uploads22- Handle errors gracefully — check `RestError.statusCode` for specific handling23- Use `*IfNotExists` methods for idempotent container/blob creation24- Close clients — good practice in long-running apps25