[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6G9AXBH1H6NJCYPJ4KB1YQQ":3,"skill-same:01M6G9AXBH1H6NJCYPJ4KB1YQQ":79},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":13,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":50,"install":51,"resources":64},"01M6G9AXBH1H6NJCYPJ4KB1YQQ","azure-storage-blob-ts",null,"Azure Blob Storage JavaScript\u002FTypeScript SDK (@azure\u002Fstorage-blob) for blob operations. Use for uploading, downloading, listing, and managing blobs and containers. Supports block blobs, append blobs, page blobs, SAS tokens, and streaming. Triggers: \"blob storage\", \"@azure\u002Fstorage-blob\", \"BlobServiceClient\", \"ContainerClient\", \"upload blob\", \"download blob\", \"SAS token\", \"block blob\".","ricardoaevt\u002Fnexus-roms","ricardoaevt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F164531880?v=4","01M6DGFGSV6CF9AKPHABBREC79","01M6DGFGYNNPJVDFQA05TDPSBN",0,"AGPL-3.0","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fmicrosoft_skills\u002F.github\u002Fplugins\u002Fazure-sdk-typescript\u002Fskills\u002Fazure-storage-blob-ts\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"storage","azure storage","azure","azure storage blob ts","page","block","azure blob storage","triggers","tokens","token","upload","use","operations","append","typescript","download","streaming","javascript","sdk","containers","2026-11-10 10:12:30",false,"---\nname: azure-storage-blob-ts\ndescription: |\n  Azure Blob Storage JavaScript\u002FTypeScript SDK (@azure\u002Fstorage-blob) for blob operations. Use for uploading, downloading, listing, and managing blobs and containers. Supports block blobs, append blobs, page blobs, SAS tokens, and streaming. Triggers: \"blob storage\", \"@azure\u002Fstorage-blob\", \"BlobServiceClient\", \"ContainerClient\", \"upload blob\", \"download blob\", \"SAS token\", \"block blob\".\npackage: \"@azure\u002Fstorage-blob\"\n---\n\n# @azure\u002Fstorage-blob (TypeScript\u002FJavaScript)\n\nSDK for Azure Blob Storage operations — upload, download, list, and manage blobs and containers.\n\n## Installation\n\n```bash\nnpm install @azure\u002Fstorage-blob @azure\u002Fidentity\n```\n\n**Current Version**: 12.x  \n**Node.js**: >= 18.0.0\n\n## Environment Variables\n\n```bash\nAZURE_STORAGE_ACCOUNT_NAME=\u003Caccount-name>\nAZURE_STORAGE_ACCOUNT_KEY=\u003Caccount-key>\n# OR connection string\nAZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=...\n```\n\n## Authentication\n\n### DefaultAzureCredential (Recommended)\n\n```typescript\nimport { BlobServiceClient } from \"@azure\u002Fstorage-blob\";\nimport { DefaultAzureCredential } from \"@azure\u002Fidentity\";\n\nconst accountName = process.env.AZURE_STORAGE_ACCOUNT_NAME!;\nconst client = new BlobServiceClient(\n  `https:\u002F\u002F${accountName}.blob.core.windows.net`,\n  new DefaultAzureCredential()\n);\n```\n\n### Connection String\n\n```typescript\nimport { BlobServiceClient } from \"@azure\u002Fstorage-blob\";\n\nconst client = BlobServiceClient.fromConnectionString(\n  process.env.AZURE_STORAGE_CONNECTION_STRING!\n);\n```\n\n### StorageSharedKeyCredential (Node.js only)\n\n```typescript\nimport { BlobServiceClient, StorageSharedKeyCredential } from \"@azure\u002Fstorage-blob\";\n\nconst accountName = process.env.AZURE_STORAGE_ACCOUNT_NAME!;\nconst accountKey = process.env.AZURE_STORAGE_ACCOUNT_KEY!;\n\nconst sharedKeyCredential = new StorageSharedKeyCredential(accountName, accountKey);\nconst client = new BlobServiceClient(\n  `https:\u002F\u002F${accountName}.blob.core.windows.net`,\n  sharedKeyCredential\n);\n```\n\n### SAS Token\n\n```typescript\nimport { BlobServiceClient } from \"@azure\u002Fstorage-blob\";\n\nconst accountName = process.env.AZURE_STORAGE_ACCOUNT_NAME!;\nconst sasToken = process.env.AZURE_STORAGE_SAS_TOKEN!; \u002F\u002F starts with \"?\"\n\nconst client = new BlobServiceClient(\n  `https:\u002F\u002F${accountName}.blob.core.windows.net${sasToken}`\n);\n```\n\n## Client Hierarchy\n\n```\nBlobServiceClient (account level)\n└── ContainerClient (container level)\n    └── BlobClient (blob level)\n        ├── BlockBlobClient (block blobs - most common)\n        ├── AppendBlobClient (append-only blobs)\n        └── PageBlobClient (page blobs - VHDs)\n```\n\n## Container Operations\n\n### Create Container\n\n```typescript\nconst containerClient = client.getContainerClient(\"my-container\");\nawait containerClient.create();\n\n\u002F\u002F Or create if not exists\nawait containerClient.createIfNotExists();\n```\n\n### List Containers\n\n```typescript\nfor await (const container of client.listContainers()) {\n  console.log(container.name);\n}\n\n\u002F\u002F With prefix filter\nfor await (const container of client.listContainers({ prefix: \"logs-\" })) {\n  console.log(container.name);\n}\n```\n\n### Delete Container\n\n```typescript\nawait containerClient.delete();\n\u002F\u002F Or delete if exists\nawait containerClient.deleteIfExists();\n```\n\n## Blob Operations\n\n### Upload Blob (Simple)\n\n```typescript\nconst containerClient = client.getContainerClient(\"my-container\");\nconst blockBlobClient = containerClient.getBlockBlobClient(\"my-file.txt\");\n\n\u002F\u002F Upload string\nawait blockBlobClient.upload(\"Hello, World!\", 13);\n\n\u002F\u002F Upload Buffer\nconst buffer = Buffer.from(\"Hello, World!\");\nawait blockBlobClient.upload(buffer, buffer.length);\n```\n\n### Upload from File (Node.js only)\n\n```typescript\nconst blockBlobClient = containerClient.getBlockBlobClient(\"uploaded-file.txt\");\nawait blockBlobClient.uploadFile(\"\u002Fpath\u002Fto\u002Flocal\u002Ffile.txt\");\n```\n\n### Upload from Stream (Node.js only)\n\n```typescript\nimport * as fs from \"fs\";\n\nconst blockBlobClient = containerClient.getBlockBlobClient(\"streamed-file.txt\");\nconst readStream = fs.createReadStream(\"\u002Fpath\u002Fto\u002Flocal\u002Ffile.txt\");\n\nawait blockBlobClient.uploadStream(readStream, 4 * 1024 * 1024, 5, {\n  \u002F\u002F bufferSize: 4MB, maxConcurrency: 5\n  onProgress: (progress) => console.log(`Uploaded ${progress.loadedBytes} bytes`),\n});\n```\n\n### Upload from Browser\n\n```typescript\nconst blockBlobClient = containerClient.getBlockBlobClient(\"browser-upload.txt\");\n\n\u002F\u002F From File input\nconst fileInput = document.getElementById(\"fileInput\") as HTMLInputElement;\nconst file = fileInput.files![0];\nawait blockBlobClient.uploadData(file);\n\n\u002F\u002F From Blob\u002FArrayBuffer\nconst arrayBuffer = new ArrayBuffer(1024);\nawait blockBlobClient.uploadData(arrayBuffer);\n```\n\n### Download Blob\n\n```typescript\nconst blobClient = containerClient.getBlobClient(\"my-file.txt\");\nconst downloadResponse = await blobClient.download();\n\n\u002F\u002F Read as string (browser & Node.js)\nconst downloaded = await streamToText(downloadResponse.readableStreamBody!);\n\nasync function streamToText(readable: NodeJS.ReadableStream): Promise\u003Cstring> {\n  const chunks: Buffer[] = [];\n  for await (const chunk of readable) {\n    chunks.push(Buffer.from(chunk));\n  }\n  return Buffer.concat(chunks).toString(\"utf-8\");\n}\n```\n\n### Download to File (Node.js only)\n\n```typescript\nconst blockBlobClient = containerClient.getBlockBlobClient(\"my-file.txt\");\nawait blockBlobClient.downloadToFile(\"\u002Fpath\u002Fto\u002Flocal\u002Fdestination.txt\");\n```\n\n### Download to Buffer (Node.js only)\n\n```typescript\nconst blockBlobClient = containerClient.getBlockBlobClient(\"my-file.txt\");\nconst buffer = await blockBlobClient.downloadToBuffer();\nconsole.log(buffer.toString());\n```\n\n### List Blobs\n\n```typescript\n\u002F\u002F List all blobs\nfor await (const blob of containerClient.listBlobsFlat()) {\n  console.log(blob.name, blob.properties.contentLength);\n}\n\n\u002F\u002F List with prefix\nfor await (const blob of containerClient.listBlobsFlat({ prefix: \"logs\u002F\" })) {\n  console.log(blob.name);\n}\n\n\u002F\u002F List by hierarchy (virtual directories)\nfor await (const item of containerClient.listBlobsByHierarchy(\"\u002F\")) {\n  if (item.kind === \"prefix\") {\n    console.log(`Directory: ${item.name}`);\n  } else {\n    console.log(`Blob: ${item.name}`);\n  }\n}\n```\n\n### Delete Blob\n\n```typescript\nconst blobClient = containerClient.getBlobClient(\"my-file.txt\");\nawait blobClient.delete();\n\n\u002F\u002F Delete if exists\nawait blobClient.deleteIfExists();\n\n\u002F\u002F Delete with snapshots\nawait blobClient.delete({ deleteSnapshots: \"include\" });\n```\n\n### Copy Blob\n\n```typescript\nconst sourceBlobClient = containerClient.getBlobClient(\"source.txt\");\nconst destBlobClient = containerClient.getBlobClient(\"destination.txt\");\n\n\u002F\u002F Start copy operation\nconst copyPoller = await destBlobClient.beginCopyFromURL(sourceBlobClient.url);\nawait copyPoller.pollUntilDone();\n```\n\n## Blob Properties & Metadata\n\n### Get Properties\n\n```typescript\nconst blobClient = containerClient.getBlobClient(\"my-file.txt\");\nconst properties = await blobClient.getProperties();\n\nconsole.log(\"Content-Type:\", properties.contentType);\nconsole.log(\"Content-Length:\", properties.contentLength);\nconsole.log(\"Last Modified:\", properties.lastModified);\nconsole.log(\"ETag:\", properties.etag);\n```\n\n### Set Metadata\n\n```typescript\nawait blobClient.setMetadata({\n  author: \"John Doe\",\n  category: \"documents\",\n});\n```\n\n### Set HTTP Headers\n\n```typescript\nawait blobClient.setHTTPHeaders({\n  blobContentType: \"text\u002Fplain\",\n  blobCacheControl: \"max-age=3600\",\n  blobContentDisposition: \"attachment; filename=download.txt\",\n});\n```\n\n## SAS Token Generation (Node.js only)\n\n### Generate Blob SAS\n\n```typescript\nimport {\n  BlobSASPermissions,\n  generateBlobSASQueryParameters,\n  StorageSharedKeyCredential,\n} from \"@azure\u002Fstorage-blob\";\n\nconst sharedKeyCredential = new StorageSharedKeyCredential(accountName, accountKey);\n\nconst sasToken = generateBlobSASQueryParameters(\n  {\n    containerName: \"my-container\",\n    blobName: \"my-file.txt\",\n    permissions: BlobSASPermissions.parse(\"r\"), \u002F\u002F read only\n    startsOn: new Date(),\n    expiresOn: new Date(Date.now() + 3600 * 1000), \u002F\u002F 1 hour\n  },\n  sharedKeyCredential\n).toString();\n\nconst sasUrl = `https:\u002F\u002F${accountName}.blob.core.windows.net\u002Fmy-container\u002Fmy-file.txt?${sasToken}`;\n```\n\n### Generate Container SAS\n\n```typescript\nimport { ContainerSASPermissions, generateBlobSASQueryParameters } from \"@azure\u002Fstorage-blob\";\n\nconst sasToken = generateBlobSASQueryParameters(\n  {\n    containerName: \"my-container\",\n    permissions: ContainerSASPermissions.parse(\"racwdl\"), \u002F\u002F read, add, create, write, delete, list\n    expiresOn: new Date(Date.now() + 24 * 3600 * 1000), \u002F\u002F 24 hours\n  },\n  sharedKeyCredential\n).toString();\n```\n\n### Generate Account SAS\n\n```typescript\nimport {\n  AccountSASPermissions,\n  AccountSASResourceTypes,\n  AccountSASServices,\n  generateAccountSASQueryParameters,\n} from \"@azure\u002Fstorage-blob\";\n\nconst sasToken = generateAccountSASQueryParameters(\n  {\n    services: AccountSASServices.parse(\"b\").toString(), \u002F\u002F blob\n    resourceTypes: AccountSASResourceTypes.parse(\"sco\").toString(), \u002F\u002F service, container, object\n    permissions: AccountSASPermissions.parse(\"rwdlacupi\"), \u002F\u002F all permissions\n    expiresOn: new Date(Date.now() + 24 * 3600 * 1000),\n  },\n  sharedKeyCredential\n).toString();\n```\n\n## Blob Types\n\n### Block Blob (Default)\n\nMost common type for text and binary files.\n\n```typescript\nconst blockBlobClient = containerClient.getBlockBlobClient(\"document.pdf\");\nawait blockBlobClient.uploadFile(\"\u002Fpath\u002Fto\u002Fdocument.pdf\");\n```\n\n### Append Blob\n\nOptimized for append operations (logs, audit trails).\n\n```typescript\nconst appendBlobClient = containerClient.getAppendBlobClient(\"app.log\");\n\n\u002F\u002F Create the append blob\nawait appendBlobClient.create();\n\n\u002F\u002F Append data\nawait appendBlobClient.appendBlock(\"Log entry 1\\n\", 12);\nawait appendBlobClient.appendBlock(\"Log entry 2\\n\", 12);\n```\n\n### Page Blob\n\nFixed-size blobs for random read\u002Fwrite (VHDs).\n\n```typescript\nconst pageBlobClient = containerClient.getPageBlobClient(\"disk.vhd\");\n\n\u002F\u002F Create 512-byte aligned page blob\nawait pageBlobClient.create(1024 * 1024); \u002F\u002F 1MB\n\n\u002F\u002F Write pages (must be 512-byte aligned)\nconst buffer = Buffer.alloc(512);\nawait pageBlobClient.uploadPages(buffer, 0, 512);\n```\n\n## Error Handling\n\n```typescript\nimport { RestError } from \"@azure\u002Fstorage-blob\";\n\ntry {\n  await containerClient.create();\n} catch (error) {\n  if (error instanceof RestError) {\n    switch (error.statusCode) {\n      case 404:\n        console.log(\"Container not found\");\n        break;\n      case 409:\n        console.log(\"Container already exists\");\n        break;\n      case 403:\n        console.log(\"Access denied\");\n        break;\n      default:\n        console.error(`Storage error ${error.statusCode}: ${error.message}`);\n    }\n  }\n  throw error;\n}\n```\n\n## TypeScript Types Reference\n\n```typescript\nimport {\n  \u002F\u002F Clients\n  BlobServiceClient,\n  ContainerClient,\n  BlobClient,\n  BlockBlobClient,\n  AppendBlobClient,\n  PageBlobClient,\n\n  \u002F\u002F Authentication\n  StorageSharedKeyCredential,\n  AnonymousCredential,\n\n  \u002F\u002F SAS\n  BlobSASPermissions,\n  ContainerSASPermissions,\n  AccountSASPermissions,\n  AccountSASServices,\n  AccountSASResourceTypes,\n  generateBlobSASQueryParameters,\n  generateAccountSASQueryParameters,\n\n  \u002F\u002F Options & Responses\n  BlobDownloadResponseParsed,\n  BlobUploadCommonResponse,\n  ContainerCreateResponse,\n  BlobItem,\n  ContainerItem,\n\n  \u002F\u002F Errors\n  RestError,\n} from \"@azure\u002Fstorage-blob\";\n```\n\n## Best Practices\n\n1. **Use DefaultAzureCredential** — Prefer AAD over connection strings\u002Fkeys\n2. **Use streaming for large files** — `uploadStream`\u002F`downloadToFile` for files > 256MB\n3. **Set appropriate content types** — Use `setHTTPHeaders` for correct MIME types\n4. **Use SAS tokens for client access** — Generate short-lived tokens for browser uploads\n5. **Handle errors gracefully** — Check `RestError.statusCode` for specific handling\n6. **Use `*IfNotExists` methods** — For idempotent container\u002Fblob creation\n7. **Close clients** — Not required but good practice in long-running apps\n\n## Platform Differences\n\n| Feature | Node.js | Browser |\n|---------|---------|---------|\n| `StorageSharedKeyCredential` | ✅ | ❌ |\n| `uploadFile()` | ✅ | ❌ |\n| `uploadStream()` | ✅ | ❌ |\n| `downloadToFile()` | ✅ | ❌ |\n| `downloadToBuffer()` | ✅ | ❌ |\n| `uploadData()` | ✅ | ✅ |\n| SAS generation | ✅ | ❌ |\n| DefaultAzureCredential | ✅ | ❌ |\n| Anonymous\u002FSAS access | ✅ | ✅ |\n","# @azure\u002Fstorage-blob (TypeScript\u002FJavaScript)\n\nSDK for Azure Blob Storage operations — upload, download, list, and manage blobs and containers.\n\n## Installation\n\n```bash\nnpm install @azure\u002Fstorage-blob @azure\u002Fidentity\n```\n\n**Current Version**: 12.x  \n**Node.js**: >= 18.0.0\n\n## Environment Variables\n\n```bash\nAZURE_STORAGE_ACCOUNT_NAME=\u003Caccount-name>\nAZURE_STORAGE_ACCOUNT_KEY=\u003Caccount-key>\n# OR connection string\nAZURE_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=https;AccountName=...\n```\n\n## Authentication\n\n### DefaultAzureCredential (Recommended)\n\n```typescript\nimport { BlobServiceClient } from \"@azure\u002Fstorage-blob\";\nimport { DefaultAzureCredential } from \"@azure\u002Fidentity\";\n\nconst accountName = process.env.AZURE_STORAGE_ACCOUNT_NAME!;\nconst client = new BlobServiceClient(\n  `https:\u002F\u002F${accountName}.blob.core.windows.net`,\n  new DefaultAzureCredential()\n);\n```\n\n### Connection String\n\n```typescript\nimport { BlobServiceClient } from \"@azure\u002Fstorage-blob\";\n\nconst client = BlobServiceClient.fromConnectionString(\n  process.env.AZURE_STORAGE_CONNECTION_STRING!\n);\n```\n\n### StorageSharedKeyCredential (Node.js only)\n\n```typescript\nimport { BlobServiceClient, StorageSharedKeyCredential } from \"@azure\u002Fstorage-blob\";\n\nconst accountName = process.env.AZURE_STORAGE_ACCOUNT_NAME!;\nconst accountKey = process.env.AZURE_STORAGE_ACCOUNT_KEY!;\n\nconst sharedKeyCredential = new StorageSharedKeyCredential(accountName, accountKey);\nconst client = new BlobServiceClient(\n  `https:\u002F\u002F${accountName}.blob.core.windows.net`,\n  sharedKeyCredential\n);\n```\n\n### SAS Token\n\n```typescript\nimport { BlobServiceClient } from \"@azure\u002Fstorage-blob\";\n\nconst accountName = process.env.AZURE_STORAGE_ACCOUNT_NAME!;\nconst sasToken = process.env.AZURE_STORAGE_SAS_TOKEN!; \u002F\u002F starts with \"?\"\n\nconst client = new BlobServiceClient(\n  `https:\u002F\u002F${accountName}.blob.core.windows.net${sasToken}`\n);\n```\n\n## Client Hierarchy\n\n```\nBlobServiceClient (account level)\n└── ContainerClient (container level)\n    └── BlobClient (blob level)\n        ├── BlockBlobClient (block blobs - most common)\n        ├── AppendBlobClient (append-only blobs)\n        └── PageBlobClient (page blobs - VHDs)\n```\n\n## Container Operations\n\n### Create Container\n\n```typescript\nconst containerClient = client.getContainerClient(\"my-container\");\nawait containerClient.create();\n\n\u002F\u002F Or create if not exists\nawait containerClient.createIfNotExists();\n```\n\n### List Containers\n\n```typescript\nfor await (const container of client.listContainers()) {\n  console.log(container.name);\n}\n\n\u002F\u002F With prefix filter\nfor await (const container of client.listContainers({ prefix: \"logs-\" })) {\n  console.log(container.name);\n}\n```\n\n### Delete Container\n\n```typescript\nawait containerClient.delete();\n\u002F\u002F Or delete if exists\nawait containerClient.deleteIfExists();\n```\n\n## Blob Operations\n\n### Upload Blob (Simple)\n\n```typescript\nconst containerClient = client.getContainerClient(\"my-container\");\nconst blockBlobClient = containerClient.getBlockBlobClient(\"my-file.txt\");\n\n\u002F\u002F Upload string\nawait blockBlobClient.upload(\"Hello, World!\", 13);\n\n\u002F\u002F Upload Buffer\nconst buffer = Buffer.from(\"Hello, World!\");\nawait blockBlobClient.upload(buffer, buffer.length);\n```\n\n### Upload from File (Node.js only)\n\n```typescript\nconst blockBlobClient = containerClient.getBlockBlobClient(\"uploaded-file.txt\");\nawait blockBlobClient.uploadFile(\"\u002Fpath\u002Fto\u002Flocal\u002Ffile.txt\");\n```\n\n### Upload from Stream (Node.js only)\n\n```typescript\nimport * as fs from \"fs\";\n\nconst blockBlobClient = containerClient.getBlockBlobClient(\"streamed-file.txt\");\nconst readStream = fs.createReadStream(\"\u002Fpath\u002Fto\u002Flocal\u002Ffile.txt\");\n\nawait blockBlobClient.uploadStream(readStream, 4 * 1024 * 1024, 5, {\n  \u002F\u002F bufferSize: 4MB, maxConcurrency: 5\n  onProgress: (progress) => console.log(`Uploaded ${progress.loadedBytes} bytes`),\n});\n```\n\n### Upload from Browser\n\n```typescript\nconst blockBlobClient = containerClient.getBlockBlobClient(\"browser-upload.txt\");\n\n\u002F\u002F From File input\nconst fileInput = document.getElementById(\"fileInput\") as HTMLInputElement;\nconst file = fileInput.files![0];\nawait blockBlobClient.uploadData(file);\n\n\u002F\u002F From Blob\u002FArrayBuffer\nconst arrayBuffer = new ArrayBuffer(1024);\nawait blockBlobClient.uploadData(arrayBuffer);\n```\n\n### Download Blob\n\n```typescript\nconst blobClient = containerClient.getBlobClient(\"my-file.txt\");\nconst downloadResponse = await blobClient.download();\n\n\u002F\u002F Read as string (browser & Node.js)\nconst downloaded = await streamToText(downloadResponse.readableStreamBody!);\n\nasync function streamToText(readable: NodeJS.ReadableStream): Promise\u003Cstring> {\n  const chunks: Buffer[] = [];\n  for await (const chunk of readable) {\n    chunks.push(Buffer.from(chunk));\n  }\n  return Buffer.concat(chunks).toString(\"utf-8\");\n}\n```\n\n### Download to File (Node.js only)\n\n```typescript\nconst blockBlobClient = containerClient.getBlockBlobClient(\"my-file.txt\");\nawait blockBlobClient.downloadToFile(\"\u002Fpath\u002Fto\u002Flocal\u002Fdestination.txt\");\n```\n\n### Download to Buffer (Node.js only)\n\n```typescript\nconst blockBlobClient = containerClient.getBlockBlobClient(\"my-file.txt\");\nconst buffer = await blockBlobClient.downloadToBuffer();\nconsole.log(buffer.toString());\n```\n\n### List Blobs\n\n```typescript\n\u002F\u002F List all blobs\nfor await (const blob of containerClient.listBlobsFlat()) {\n  console.log(blob.name, blob.properties.contentLength);\n}\n\n\u002F\u002F List with prefix\nfor await (const blob of containerClient.listBlobsFlat({ prefix: \"logs\u002F\" })) {\n  console.log(blob.name);\n}\n\n\u002F\u002F List by hierarchy (virtual directories)\nfor await (const item of containerClient.listBlobsByHierarchy(\"\u002F\")) {\n  if (item.kind === \"prefix\") {\n    console.log(`Directory: ${item.name}`);\n  } else {\n    console.log(`Blob: ${item.name}`);\n  }\n}\n```\n\n### Delete Blob\n\n```typescript\nconst blobClient = containerClient.getBlobClient(\"my-file.txt\");\nawait blobClient.delete();\n\n\u002F\u002F Delete if exists\nawait blobClient.deleteIfExists();\n\n\u002F\u002F Delete with snapshots\nawait blobClient.delete({ deleteSnapshots: \"include\" });\n```\n\n### Copy Blob\n\n```typescript\nconst sourceBlobClient = containerClient.getBlobClient(\"source.txt\");\nconst destBlobClient = containerClient.getBlobClient(\"destination.txt\");\n\n\u002F\u002F Start copy operation\nconst copyPoller = await destBlobClient.beginCopyFromURL(sourceBlobClient.url);\nawait copyPoller.pollUntilDone();\n```\n\n## Blob Properties & Metadata\n\n### Get Properties\n\n```typescript\nconst blobClient = containerClient.getBlobClient(\"my-file.txt\");\nconst properties = await blobClient.getProperties();\n\nconsole.log(\"Content-Type:\", properties.contentType);\nconsole.log(\"Content-Length:\", properties.contentLength);\nconsole.log(\"Last Modified:\", properties.lastModified);\nconsole.log(\"ETag:\", properties.etag);\n```\n\n### Set Metadata\n\n```typescript\nawait blobClient.setMetadata({\n  author: \"John Doe\",\n  category: \"documents\",\n});\n```\n\n### Set HTTP Headers\n\n```typescript\nawait blobClient.setHTTPHeaders({\n  blobContentType: \"text\u002Fplain\",\n  blobCacheControl: \"max-age=3600\",\n  blobContentDisposition: \"attachment; filename=download.txt\",\n});\n```\n\n## SAS Token Generation (Node.js only)\n\n### Generate Blob SAS\n\n```typescript\nimport {\n  BlobSASPermissions,\n  generateBlobSASQueryParameters,\n  StorageSharedKeyCredential,\n} from \"@azure\u002Fstorage-blob\";\n\nconst sharedKeyCredential = new StorageSharedKeyCredential(accountName, accountKey);\n\nconst sasToken = generateBlobSASQueryParameters(\n  {\n    containerName: \"my-container\",\n    blobName: \"my-file.txt\",\n    permissions: BlobSASPermissions.parse(\"r\"), \u002F\u002F read only\n    startsOn: new Date(),\n    expiresOn: new Date(Date.now() + 3600 * 1000), \u002F\u002F 1 hour\n  },\n  sharedKeyCredential\n).toString();\n\nconst sasUrl = `https:\u002F\u002F${accountName}.blob.core.windows.net\u002Fmy-container\u002Fmy-file.txt?${sasToken}`;\n```\n\n### Generate Container SAS\n\n```typescript\nimport { ContainerSASPermissions, generateBlobSASQueryParameters } from \"@azure\u002Fstorage-blob\";\n\nconst sasToken = generateBlobSASQueryParameters(\n  {\n    containerName: \"my-container\",\n    permissions: ContainerSASPermissions.parse(\"racwdl\"), \u002F\u002F read, add, create, write, delete, list\n    expiresOn: new Date(Date.now() + 24 * 3600 * 1000), \u002F\u002F 24 hours\n  },\n  sharedKeyCredential\n).toString();\n```\n\n### Generate Account SAS\n\n```typescript\nimport {\n  AccountSASPermissions,\n  AccountSASResourceTypes,\n  AccountSASServices,\n  generateAccountSASQueryParameters,\n} from \"@azure\u002Fstorage-blob\";\n\nconst sasToken = generateAccountSASQueryParameters(\n  {\n    services: AccountSASServices.parse(\"b\").toString(), \u002F\u002F blob\n    resourceTypes: AccountSASResourceTypes.parse(\"sco\").toString(), \u002F\u002F service, container, object\n    permissions: AccountSASPermissions.parse(\"rwdlacupi\"), \u002F\u002F all permissions\n    expiresOn: new Date(Date.now() + 24 * 3600 * 1000),\n  },\n  sharedKeyCredential\n).toString();\n```\n\n## Blob Types\n\n### Block Blob (Default)\n\nMost common type for text and binary files.\n\n```typescript\nconst blockBlobClient = containerClient.getBlockBlobClient(\"document.pdf\");\nawait blockBlobClient.uploadFile(\"\u002Fpath\u002Fto\u002Fdocument.pdf\");\n```\n\n### Append Blob\n\nOptimized for append operations (logs, audit trails).\n\n```typescript\nconst appendBlobClient = containerClient.getAppendBlobClient(\"app.log\");\n\n\u002F\u002F Create the append blob\nawait appendBlobClient.create();\n\n\u002F\u002F Append data\nawait appendBlobClient.appendBlock(\"Log entry 1\\n\", 12);\nawait appendBlobClient.appendBlock(\"Log entry 2\\n\", 12);\n```\n\n### Page Blob\n\nFixed-size blobs for random read\u002Fwrite (VHDs).\n\n```typescript\nconst pageBlobClient = containerClient.getPageBlobClient(\"disk.vhd\");\n\n\u002F\u002F Create 512-byte aligned page blob\nawait pageBlobClient.create(1024 * 1024); \u002F\u002F 1MB\n\n\u002F\u002F Write pages (must be 512-byte aligned)\nconst buffer = Buffer.alloc(512);\nawait pageBlobClient.uploadPages(buffer, 0, 512);\n```\n\n## Error Handling\n\n```typescript\nimport { RestError } from \"@azure\u002Fstorage-blob\";\n\ntry {\n  await containerClient.create();\n} catch (error) {\n  if (error instanceof RestError) {\n    switch (error.statusCode) {\n      case 404:\n        console.log(\"Container not found\");\n        break;\n      case 409:\n        console.log(\"Container already exists\");\n        break;\n      case 403:\n        console.log(\"Access denied\");\n        break;\n      default:\n        console.error(`Storage error ${error.statusCode}: ${error.message}`);\n    }\n  }\n  throw error;\n}\n```\n\n## TypeScript Types Reference\n\n```typescript\nimport {\n  \u002F\u002F Clients\n  BlobServiceClient,\n  ContainerClient,\n  BlobClient,\n  BlockBlobClient,\n  AppendBlobClient,\n  PageBlobClient,\n\n  \u002F\u002F Authentication\n  StorageSharedKeyCredential,\n  AnonymousCredential,\n\n  \u002F\u002F SAS\n  BlobSASPermissions,\n  ContainerSASPermissions,\n  AccountSASPermissions,\n  AccountSASServices,\n  AccountSASResourceTypes,\n  generateBlobSASQueryParameters,\n  generateAccountSASQueryParameters,\n\n  \u002F\u002F Options & Responses\n  BlobDownloadResponseParsed,\n  BlobUploadCommonResponse,\n  ContainerCreateResponse,\n  BlobItem,\n  ContainerItem,\n\n  \u002F\u002F Errors\n  RestError,\n} from \"@azure\u002Fstorage-blob\";\n```\n\n## Best Practices\n\n1. **Use DefaultAzureCredential** — Prefer AAD over connection strings\u002Fkeys\n2. **Use streaming for large files** — `uploadStream`\u002F`downloadToFile` for files > 256MB\n3. **Set appropriate content types** — Use `setHTTPHeaders` for correct MIME types\n4. **Use SAS tokens for client access** — Generate short-lived tokens for browser uploads\n5. **Handle errors gracefully** — Check `RestError.statusCode` for specific handling\n6. **Use `*IfNotExists` methods** — For idempotent container\u002Fblob creation\n7. **Close clients** — Not required but good practice in long-running apps\n\n## Platform Differences\n\n| Feature | Node.js | Browser |\n|---------|---------|---------|\n| `StorageSharedKeyCredential` | ✅ | ❌ |\n| `uploadFile()` | ✅ | ❌ |\n| `uploadStream()` | ✅ | ❌ |\n| `downloadToFile()` | ✅ | ❌ |\n| `downloadToBuffer()` | ✅ | ❌ |\n| `uploadData()` | ✅ | ✅ |\n| SAS generation | ✅ | ❌ |\n| DefaultAzureCredential | ✅ | ❌ |\n| Anonymous\u002FSAS access | ✅ | ✅ |\n",{"name":5,"package":43,"description":44},"@azure\u002Fstorage-blob","Azure Blob Storage JavaScript\u002FTypeScript SDK (@azure\u002Fstorage-blob) for blob operations. Use for uploading, downloading, listing, and managing blobs and containers. Supports block blobs, append blobs, page blobs, SAS tokens, and streaming. Triggers: \"blob storage\", \"@azure\u002Fstorage-blob\", \"BlobServiceClient\", \"ContainerClient\", \"upload blob\", \"download blob\", \"SAS token\", \"block blob\".\n","main","d41309588593cee5c2fb44062474efc3a99fbcb6",".agent\u002Fskills\u002Fmicrosoft_skills\u002F.github\u002Fplugins\u002Fazure-sdk-typescript\u002Fskills\u002Fazure-storage-blob-ts","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms","https:\u002F\u002Fgithub.com\u002Fricardoaevt","2026-03-23 00:05:03",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add ricardoaevt\u002Fnexus-roms --skill azure-storage-blob-ts",{"tool":57,"command":58},"bunx","bunx skills add ricardoaevt\u002Fnexus-roms --skill azure-storage-blob-ts",{"tool":60,"command":61},"pnpm","pnpm dlx skills add ricardoaevt\u002Fnexus-roms --skill azure-storage-blob-ts","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fmicrosoft_skills\u002F.github\u002Fplugins\u002Fazure-sdk-typescript\u002Fskills\u002Fazure-storage-blob-ts\u002FSKILL.md",true,[65,71,75],{"path":66,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":69,"sourceHtmlUrl":70},"references\u002Facceptance-criteria.md","REFERENCE","参考文档",11344,"https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fmicrosoft_skills\u002F.github\u002Fplugins\u002Fazure-sdk-typescript\u002Fskills\u002Fazure-storage-blob-ts\u002Freferences\u002Facceptance-criteria.md",{"path":72,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":73,"sourceHtmlUrl":74},"references\u002Fsas-tokens.md",12987,"https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fmicrosoft_skills\u002F.github\u002Fplugins\u002Fazure-sdk-typescript\u002Fskills\u002Fazure-storage-blob-ts\u002Freferences\u002Fsas-tokens.md",{"path":76,"resourceType":67,"resourceTypeDesc":68,"sizeBytes":77,"sourceHtmlUrl":78},"references\u002Fstreaming.md",10493,"https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fmicrosoft_skills\u002F.github\u002Fplugins\u002Fazure-sdk-typescript\u002Fskills\u002Fazure-storage-blob-ts\u002Freferences\u002Fstreaming.md",[80,104,120,135,146,155],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":84,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":38},"01M6G9HYKQRK6HBKVTZM3258M3","openspec-propose","Propose a new change with all artifacts generated in one step. Use when the user wants to quickly describe what they want to build and get a complete proposal with design, specs, and tasks ready for implementation.","MIT","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-propose\u002FSKILL.md",[],[88,89,90,91,92,93,94,95,96,97,98,29,99,100,101,102,103],"openspec propose","openspec","cli","generated","with","proposal","complete","get","build","implementation","ready","user","artifacts","tasks","change","design",{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":84,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":38},"01M6G9HV9V20WFCHYVSDNQMJVK","openspec-new-change","Start a new OpenSpec change using the experimental artifact workflow. Use when the user wants to create a new feature, fix, or modification with a structured step-by-step approach.","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-new-change\u002FSKILL.md",[],[89,111,102,112,90,113,114,115,29,99,116,117,118,119,92],"openspec new change","new feature","structured","artifact","workflow","create","start","fix","feature",{"skillNo":121,"name":122,"nameZh":6,"description":123,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":84,"licenseFileUrl":6,"sourceHtmlUrl":124,"categories":125,"keywords":126,"publishedAt":38},"01M6G9HRF6R89QZXGSFC9DRQW3","openspec-explore","Enter explore mode - a thinking partner for exploring ideas, investigating problems, and clarifying requirements. Use when the user wants to think through something before or during a change.","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-explore\u002FSKILL.md",[],[127,128,89,29,129,90,102,99,130,131,132,133,134],"openspec explore","explore","partner","think","thinking partner","thinking","ideas","requirements",{"skillNo":136,"name":137,"nameZh":6,"description":138,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":84,"licenseFileUrl":6,"sourceHtmlUrl":139,"categories":140,"keywords":141,"publishedAt":38},"01M6G9HP3APFCXZG7XRWBMM524","openspec-continue-change","Continue working on an OpenSpec change by creating the next artifact. Use when the user wants to progress their change, create the next artifact, or continue their workflow.","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-continue-change\u002FSKILL.md",[],[89,142,143,102,115,90,116,99,29,144,114,145],"continue","openspec continue change","next","progress",{"skillNo":147,"name":148,"nameZh":6,"description":149,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":84,"licenseFileUrl":6,"sourceHtmlUrl":150,"categories":151,"keywords":152,"publishedAt":38},"01M6G9HKT3WMSDBSKA7YM4MSSQ","openspec-archive-change","Archive a completed change in the experimental workflow. Use when the user wants to finalize and archive a change after implementation is complete.","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-archive-change\u002FSKILL.md",[],[153,89,154,102,90,115,99,29,97,94],"openspec archive change","archive",{"skillNo":156,"name":157,"nameZh":6,"description":158,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":84,"licenseFileUrl":6,"sourceHtmlUrl":159,"categories":160,"keywords":161,"publishedAt":38},"01M6G9HHEG0RJK4E0YTVZZ6A8T","openspec-apply-change","Implement tasks from an OpenSpec change. Use when the user wants to start implementing, continue implementation, or work through tasks.","https:\u002F\u002Fgithub.com\u002Fricardoaevt\u002Fnexus-roms\u002Fblob\u002Fmain\u002F.agent\u002Fskills\u002Fopenspec-apply-change\u002FSKILL.md",[],[89,102,162,163,101,117,142,164,99,29,97,90],"openspec apply change","implement","work"]