basalt / storage-azure/src / AzureBlobStorageDriver
Class: AzureBlobStorageDriver
Defined in: storage-azure/src/index.ts:85
Azure Blob Storage driver for @basaltkit/storage. Uses @azure/storage-blob (an optional peer dependency) via an injectable container client, so its logic is unit-tested without touching Azure.
Implements
Constructors
Constructor
> new AzureBlobStorageDriver(options): AzureBlobStorageDriver
Defined in: storage-azure/src/index.ts:89
Parameters
options
Returns
AzureBlobStorageDriver
Properties
name
> readonly name: "azure" = 'azure'
Defined in: storage-azure/src/index.ts:86
Human-readable driver name — used in error messages.
Implementation of
Methods
copy()
> copy(from, to, options?): Promise<void>
Defined in: storage-azure/src/index.ts:149
Server-side copy: the destination blob pulls the source through a short-lived read SAS, so the bytes never reach this process.
syncCopyFromURL (Copy Blob From URL) completes before it resolves and is limited to 256 MiB by Azure; copy larger blobs with beginCopyFromURL on the SDK client directly, or stream them with getStream/putStream.
Parameters
from
string
to
string
options?
Returns
Promise<void>
Implementation of
delete()
> delete(path): Promise<boolean>
Defined in: storage-azure/src/index.ts:190
Parameters
path
string
Returns
Promise<boolean>
Implementation of
disconnect()
> disconnect(): Promise<void>
Defined in: storage-azure/src/index.ts:260
Returns
Promise<void>
Implementation of
exists()
> exists(path): Promise<boolean>
Defined in: storage-azure/src/index.ts:186
Parameters
path
string
Returns
Promise<boolean>
Implementation of
get()
> get(path): Promise<Buffer<ArrayBufferLike>>
Defined in: storage-azure/src/index.ts:115
Throws StorageFileNotFoundError when the file does not exist.
Parameters
path
string
Returns
Promise<Buffer<ArrayBufferLike>>
Implementation of
getStream()
> getStream(path): Promise<Readable>
Defined in: storage-azure/src/index.ts:125
download() — the blob's body as a Node readable. The caller must consume or destroy it.
Parameters
path
string
Returns
Promise<Readable>
Implementation of
list()
> list(prefix): Promise<string[]>
Defined in: storage-azure/src/index.ts:195
Lists full object keys starting with prefix (the Disk layer passes the tenant scope in it). A plain string-prefix match is fine: the Disk narrows the result to directory semantics and strips the scope before callers see it.
Parameters
prefix
string
Returns
Promise<string[]>
Implementation of
put()
> put(path, content, options?): Promise<void>
Defined in: storage-azure/src/index.ts:91
Parameters
path
string
content
string | Buffer<ArrayBufferLike>
options?
Returns
Promise<void>
Implementation of
putStream()
> putStream(path, source, options): Promise<void>
Defined in: storage-azure/src/index.ts:102
uploadStream — the SDK splits the readable into blocks, so a body of any size (and of unknown length) is uploaded without ever being held whole.
Parameters
path
string
source
Readable
options
Returns
Promise<void>
Implementation of
stat()
> stat(path): Promise<StorageStat>
Defined in: storage-azure/src/index.ts:167
getProperties() — size, content type, etag and last-modified without a download.
Parameters
path
string
Returns
Promise<StorageStat>
Implementation of
temporaryUploadUrl()
> temporaryUploadUrl(path, expiresInMs, options): Promise<TemporaryUploadUrl>
Defined in: storage-azure/src/index.ts:229
Pre-signed direct upload: a service SAS with create + write permission only (no read/list/delete), valid for expiresInMs.
Caveat: an Azure SAS cannot bind request headers, so — unlike S3 and GCS — the declared Content-Type and Content-Length are NOT enforced by the signature. They are returned as the headers the client should send; treat the upload as untrusted and verify the blob's properties (type, size) before using it. checksumSha256 is refused: Put Blob has no SHA-256 header to carry it.
Parameters
path
string
expiresInMs
number
options
TemporaryUploadUrlDriverOptions
Returns
Promise<TemporaryUploadUrl>
Implementation of
StorageDriver.temporaryUploadUrl
temporaryUrl()
> temporaryUrl(path, expiresInMs, options?): Promise<string>
Defined in: storage-azure/src/index.ts:201
Optional: pre-signed URL valid for expiresInMs.
Parameters
path
string
expiresInMs
number
options?
Returns
Promise<string>