Adapter
Azure Blob
Overview
The Azure Blob adapter maps each storagesdk bucket to an Azure container. Snapshots and forks create sibling containers populated by server-side Copy Blob operations. Same-account copies don’t require SAS tokens; the manifest lives at .storagesdk.metadata.json inside each container.
Configuration
import { Storage } from '@storagesdk/core';
import { azure } from '@storagesdk/adapters/azure';
const storage = new Storage({
adapter: azure({
bucket: 'agent-runs',
accountName: process.env.AZURE_ACCOUNT_NAME,
accountKey: process.env.AZURE_ACCOUNT_KEY,
}),
});
azure({
bucket: string;
accountName: string;
accountKey: string;
endpoint?: string; // override for Azure Gov, China, Azurite, etc.
});
Notes
- Peer dependency:
@azure/storage-blob. - For Entra ID, SAS tokens, or connection-string auth, construct a
BlobServiceClientyourself and usestorage.rawdirectly. maxSize/minSizeonuploadUrl()are accepted but not enforced — Azure SAS URLs have nocontent-length-rangeequivalent. Cap server-side if you need a hard limit.uploadUrl()returnsx-ms-blob-type: BlockBlobinheadersso callers don’t need Azure-specific knowledge.- Cross-container copies for snapshots/forks use
syncCopyFromURLwith a short-lived read SAS (real Azure requires source URL to self-authenticate; Azurite is lax).
Compatibility
| Capability | Support |
|---|---|
| Snapshots | Sibling containers via Copy Blob |
| Forks | Sibling containers via Copy Blob |
| Byte-range reads | ✓ |
| Multipart upload | ✓ |
| Enforced upload limits | ✗ |
| User metadata | ✓ |
| Signed URLs | ✓ |