azure.storage.blob
Module azure.storage.blob
API
Declarations
Definitions
ballerinax/azure.storage.blob Ballerina library
Overview
Azure Blob Storage is Microsoft's object storage for the cloud, holding unstructured data such as documents, media, backups, and logs in containers and serving it over HTTP.
The Azure Blob Storage connector offers APIs to connect to Azure Blob Storage and manage containers and the blobs within them, covering uploads, downloads, typed data binding, copies, access tiers, index tags, snapshots, leases, append and page blobs, block staging, and SAS token generation.
Key Features
- Container-scoped
Clientfor blob operations, transfers with typed data binding, copies, access tiers, index tags, snapshots, and leases - Account-level
AdminClientfor creating, listing, deleting, and restoring containers and for the service configuration - Append blobs, page blobs, and block staging for composing blobs from separately uploaded pieces
Listenerwhose services consume the storage queues Event Grid subscriptions deliver blob events to, dispatching created and deleted events to typed handlers with aCallerbound to the event's container, settling each message by the handler's return, and moving failures to a poison queue- Authentication with shared key, SAS tokens, connection strings, and Microsoft Entra ID
- GraalVM compatible for native image builds
Setup guide
To use the Azure Blob Storage connector, you must have an Azure subscription and an Azure storage account. If you do not have an Azure account, you can sign up for one here.
Step 1: Create a storage account
-
Sign in to the Azure portal, search for Storage accounts, and open it.
-
Click + Create.
-
On the Basics tab, provide the following:
Input Value Subscription and Resource group The subscription and group the account bills to. Storage account name A globally unique name. Region The region closest to your workload. Performance Standard for general-purpose blob storage; Premium with the Block blobs account type for low-latency workloads. -
Click Review + create, then Create, and wait for the deployment to complete. For the full set of options, see the Azure documentation.
Step 2: Create a container
-
Open the deployed storage account and navigate to Data storage > Containers.
-
Click + Container, provide a name, and click Create. The container name is what you pass to the connector's
Clientat initialization.
Step 3: Obtain the credentials
-
In the storage account, navigate to Security + networking > Access keys.
-
Click Show next to key1 and copy the following values:
Value Used as Storage account name accountNamekey1 Key accountKey -
Optionally, use one of the other credentials the connector accepts: a SAS token or SAS URL (generated under Security + networking > Shared access signature), a connection string (shown alongside each access key), or Microsoft Entra ID credentials.
Step 4: Enable soft delete (optional)
Restoring deleted blobs and containers needs soft delete. Under Data management > Data protection, enable soft delete for blobs (also settable through the connector's service configuration) and soft delete for containers (an account setting), each with a retention period.
Step 5: Wire the event queue (listener only)
The connector's Listener consumes blob events from a storage queue that an Event Grid subscription fills. Create one queue and one subscription per listener service:
-
In the storage account, navigate to Data storage > Queues, click + Queue, and provide a name (for example
invoice-events). Each listener service names the queue it consumes in its@blob:ServiceConfigannotation; create one queue, and one subscription, per service. -
Navigate to Events and click + Event Subscription. Provide a name, choose the Event Grid Schema or Cloud Event Schema v1.0 (the listener accepts both), and under Event Types select Blob Created and Blob Deleted.
-
Under Endpoint Details, choose Storage Queue as the endpoint type and select the queue created in step 1.
-
Under Filters, set a Subject Begins With filter such as
/blobServices/default/containers/invoices/to limit the subscription to one container, and any further filter the service needs (a suffix, a prefix to exclude, or event types). The subscription does the filtering; the service consumes whatever its queue carries. -
Click Create. The credential the
Listeneruses must cover the queue as well as the blobs its handlers read: the account key does, an account SAS must span the queue and blob services, and a Microsoft Entra ID identity needs the Storage Queue Data Contributor role in addition to its blob data role. The poison queue a service's failed messages move to,<queue name>-poisonunless the service names another, is created by the listener when a message first moves there.
The same wiring with the Azure CLI:
az storage queue create --name invoice-events --account-name <storage account name> --account-key <storage account key> az eventgrid event-subscription create --name invoice-events-to-queue \ --source-resource-id "/subscriptions/<subscription id>/resourceGroups/<resource group>/providers/Microsoft.Storage/storageAccounts/<storage account name>" \ --endpoint-type storagequeue \ --endpoint "/subscriptions/<subscription id>/resourceGroups/<resource group>/providers/Microsoft.Storage/storageAccounts/<storage account name>/queueServices/default/queues/invoice-events" \ --included-event-types Microsoft.Storage.BlobCreated Microsoft.Storage.BlobDeleted
Quickstart
To use the azure.storage.blob connector in your Ballerina application, modify the .bal file as follows:
Step 1: Import the module
import ballerina/io; import ballerinax/azure.storage.blob;
Step 2: Instantiate a new connector
A Client is bound to a single container. Provide the credentials through configurable variables:
configurable string accountName = ?; configurable string accountKey = ?; blob:Client blobClient = check new ("reports", auth = {accountName, accountKey});
Step 3: Invoke the connector operation
Now, utilize the available connector operations.
Create the container
The client is bound to a container, so create it first if it does not exist yet.
blob:AdminClient admin = check new (auth = {accountName, accountKey}); if !(check admin->hasContainer("reports")) { check admin->createContainer("reports"); }
Upload a file
Paths are relative to the bound container; slashes in a path form virtual folders.
check blobClient->uploadFromFile("./local/q1.pdf", "2026/q1.pdf");
Upload and read back structured content
A record is serialized per the destination's extension, and read back into the type the target declares.
type Metric record { string quarter; int revenue; }; Metric q1 = {quarter: "q1", revenue: 1250000}; check blobClient->upload(q1, "2026/q1/metrics.json"); Metric stored = check blobClient->getBlob("2026/q1/metrics.json");
List the blobs under a prefix
stream<blob:BlobEntry, blob:Error?> entries = check blobClient->listBlobs({prefix: "2026/"}); check from blob:BlobEntry entry in entries do { io:println(entry.path); };
React to blobs as they arrive
With the event queue wired (setup guide, step 5), a Listener service consumes the queue it names and dispatches each blob event to a handler. A .json blob created in the reports container binds to the handler's record; the message is acknowledged when the handler returns.
listener blob:Listener blobListener = check new (auth = {accountName, accountKey}); @blob:ServiceConfig {queueName: "report-events"} isolated service on blobListener { isolated remote function onBlobJson(Metric metric, blob:BlobEvent event, blob:Caller caller) returns error? { io:println(string `${event.path}: ${metric.quarter} revenue ${metric.revenue}`); check caller->setTags(event.path, {status: "processed"}); } }
Step 4: Run the Ballerina application
Save the changes and run the Ballerina application using the following command.
bal run
Examples
The azure.storage.blob connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:
- Folder archive - Upload a local folder into a container, tier each blob by its age, and list what the archive holds.
- Time-limited download link - Upload a report and generate a time-limited, read-only SAS URL that can be handed to a third party.
- Blob event processor - React to blobs as they arrive with the listener, binding invoices to a record, tagging and moving them, parking bad ones in the poison queue, and logging everything else.
- Tag search - Find blobs by their index tags with a tag query and mark the matches processed.
- Blob events from Service Bus - Consume blob events delivered to an Azure Service Bus queue with
parseEventand read each new invoice through the client.
Functions
parseEvent
Parses one delivered blob event into a BlobEvent, for applications that receive blob events
by another route, such as an Event Grid subscription delivering to Azure Service Bus.
Parameters
- message anydata - The message body as bytes, a string, or parsed JSON; base64-encoded or raw; in the Event Grid or CloudEvents schema; a single event or a one-element array
Clients
azure.storage.blob: AdminClient
Account-level client for Azure Blob Storage, managing the containers within a storage account, the account's blob service configuration, and account-level SAS tokens.
Constructor
Initializes the account-level client for the given storage account.
init (*ClientConfiguration config)- config *ClientConfiguration - The client configuration (authentication, retry, transport)
hasContainer
Checks whether a container exists in the storage account. Returns false only when Azure
confirms the container is absent; an Error means the check itself failed.
Parameters
- containerName string - The name of the container to check
listContainers
function listContainers(ContainerListOptions? options) returns ContainerList|ErrorLists the containers in the storage account.
Parameters
- options ContainerListOptions? (default ()) - Optional listing options (prefix, inclusion toggles, a result limit and marker)
Return Type
- ContainerList|Error - The
ContainerList, or anError
createContainer
function createContainer(string containerName, ContainerCreateOptions? options) returns Error?Creates a new container in the storage account.
Parameters
- containerName string - The name of the container to create
- options ContainerCreateOptions? (default ()) - Optional creation options (metadata, anonymous access level)
Return Type
- Error? - An
Errorif the container could not be created, otherwise()
deleteContainer
function deleteContainer(string containerName, DeleteContainerOptions? options) returns Error?Deletes a container and every blob in it. Where the account's container soft-delete retention policy is enabled, the container is retained for the configured period.
Parameters
- containerName string - The name of the container to delete
- options DeleteContainerOptions? (default ()) - Optional deletion options (the lease id, when the container is leased)
Return Type
- Error? - An
Errorif the container could not be deleted, otherwise()
undeleteContainer
Restores a soft-deleted container.
Parameters
- containerName string - The name of the soft-deleted container to restore
- deletedContainerVersion string - The version of the soft-deleted container (from
ContainerInfo.deletedVersion)
Return Type
- Error? - An
Errorif the container could not be restored, otherwise()
getServiceProperties
function getServiceProperties() returns ServiceProperties|ErrorReads the account's blob service configuration.
Return Type
- ServiceProperties|Error - The
ServiceProperties, or anError
setServiceProperties
function setServiceProperties(ServiceProperties properties) returns Error?Writes the account's blob service configuration. A group present in the record replaces that group whole; a group absent is left unchanged.
Parameters
- properties ServiceProperties - The configuration groups to apply
Return Type
- Error? - An
Errorif the configuration could not be written, otherwise()
getAccountInfo
function getAccountInfo() returns AccountInfo|ErrorReads the storage account's SKU, kind, and whether it has a hierarchical namespace.
Return Type
- AccountInfo|Error - The
AccountInfo, or anError
getUserDelegationKey
function getUserDelegationKey(Utc startTime, Utc expiryTime) returns UserDelegationKey|ErrorObtains a key for signing user-delegation SAS tokens. Requires a Microsoft Entra ID
credential whose identity holds the generateUserDelegationKey action at storage account
scope or wider, which Storage Blob Delegator or any blob data role assigned there grants.
Parameters
- startTime Utc - When the key becomes valid
- expiryTime Utc - When the key expires; at most 7 days after
startTime
Return Type
- UserDelegationKey|Error - The
UserDelegationKey, or anError
generateAccountSas
function generateAccountSas(AccountSasSignatureValues values) returns string|ErrorMints an account-level SAS token, signed locally with the account key. Requires a shared-key credential or a connection string carrying an account key.
Parameters
- values AccountSasSignatureValues - The values signed into the token (services, resource types, permissions, window)
azure.storage.blob: Caller
The context object passed to a listener service's handlers, bound to the event's container
and exposing a subset of Client to act on the event's blob. It cannot be instantiated by
user code.
getBlob
function getBlob(string path, GetBlobOptions? options, typedesc<RetrievableType> targetType) returns targetType|ErrorRetrieves a blob's content in the form the target type selects. Binding is strict: content
that does not match the target fails with a client-side Error.
Parameters
- path string - The container-relative path of the blob
- options GetBlobOptions? (default ()) - Optional retrieval options (a byte range, a snapshot id, the binding format)
- targetType typedesc<RetrievableType> (default <>) - Expected return type (to be used for automatic data binding).
Supported types:
- Raw bytes (
byte[]) or UTF-8 text (string) - A
jsonorxmlvalue - Custom records (e.g.,
Person,Person[]), bound perGetBlobOptions.fileFormat, else the path's extension (.json,.xml,.csv) - A lazy byte stream (
stream<byte[], error?>) - A lazy stream of CSV-bound records (e.g.,
stream<Person, error?>)
- Raw bytes (
Return Type
- targetType|Error - The content in the requested form, or an
Erroron a failed retrieval or a data binding failure
getBlobProperties
function getBlobProperties(string path) returns BlobProperties|ErrorReads a blob's properties, metadata, and the state of its most recent copy.
Parameters
- path string - The container-relative path of the blob
Return Type
- BlobProperties|Error - The
BlobProperties, or anError
download
function download(string sourcePath, string destinationPath, DownloadOptions? options) returns Error?Downloads a blob to a local file. Fails if a local file already exists at the destination.
Parameters
- sourcePath string - The container-relative path of the blob
- destinationPath string - The local path to write, including the file name
- options DownloadOptions? (default ()) - Optional download options (a byte range, a snapshot id)
Return Type
- Error? - An
Errorif the download failed, otherwise()
upload
function upload(UploadContent content, string destinationPath, UploadContentOptions? options) returns Error?Uploads in-memory content to the event's container.
Parameters
- content UploadContent - The content to upload.
byte[],stringand a byte stream are written as-is;json,xml, a record, a record array and a record stream are serialized per the resolved format
- destinationPath string - The container-relative path, including the blob name
- options UploadContentOptions? (default ()) - Optional upload options (headers, metadata, format override)
Return Type
- Error? - An
Errorif the upload failed, otherwise()
deleteBlob
function deleteBlob(string path, DeleteBlobOptions? options) returns Error?Deletes a blob, one of its snapshots, or the blob together with its snapshots.
Parameters
- path string - The container-relative path of the blob
- options DeleteBlobOptions? (default ()) - Optional deletion options (snapshot handling, lease id)
Return Type
- Error? - An
Errorif the blob could not be deleted, otherwise()
copyBlobFromUrl
function copyBlobFromUrl(string sourceUrl, string destinationPath, CopyOptions? options) returns CopyInfo|ErrorStarts a copy from any readable blob URL, such as BlobEvent.url, to a path in the
event's container. The copy is asynchronous; read its state through getBlobProperties.
Parameters
- sourceUrl string - The URL of the blob to copy. A source in this storage account, such as
BlobEvent.url, is authorized by the listener's credential, a SAS being attached to the URL unless it already carries one; a source elsewhere carries its own authorization
- destinationPath string - The container-relative path to write
- options CopyOptions? (default ()) - Optional copy options (metadata, tags, tier, lease id)
setTags
function setTags(string path, map<string> tags, TagOptions? options) returns Error?Replaces a blob's index tags.
Parameters
- path string - The container-relative path of the blob
- options TagOptions? (default ()) - Optional tag options (lease id)
Return Type
- Error? - An
Errorif the tags could not be set, otherwise()
azure.storage.blob: Client
Container-scoped client for Azure Blob Storage, bound to one container at initialization. A
blob is addressed by its container-relative path, such as 2026/07/invoice.pdf.
Constructor
Initializes the client and binds it to a container. No call is made to Azure; a container
that does not exist fails on the first operation with a NotFoundError.
init (string containerName, *ClientConfiguration config)- containerName string - The name of the container to bind to
- config *ClientConfiguration - The client configuration (authentication, retry, transport)
getContainerProperties
function getContainerProperties() returns ContainerProperties|ErrorReads the bound container's properties and metadata.
Return Type
- ContainerProperties|Error - The
ContainerProperties, or anError
setContainerMetadata
function setContainerMetadata(map<string> metadata, ContainerMetadataOptions? options) returns Error?Replaces the container's complete metadata set. Any key absent from metadata is removed.
Parameters
- options ContainerMetadataOptions? (default ()) - Optional options (the lease id, when the container is leased)
Return Type
- Error? - An
Errorif the metadata could not be set, otherwise()
getContainerAccessPolicy
function getContainerAccessPolicy() returns ContainerAccessPolicy|ErrorReads the container's anonymous access level and its stored access policies together.
Return Type
- ContainerAccessPolicy|Error - The
ContainerAccessPolicy, or anError
setPublicAccess
function setPublicAccess(PublicAccess access, AccessPolicyOptions? options) returns Error?Sets the container's anonymous access level. The stored access policies are left unchanged.
Parameters
- access PublicAccess - The anonymous access level to apply
- options AccessPolicyOptions? (default ()) - Optional options (the lease id, when the container is leased)
Return Type
- Error? - An
Errorif the access level could not be set, otherwise()
setContainerAccessPolicy
function setContainerAccessPolicy(SignedIdentifier[] identifiers, AccessPolicyOptions? options) returns Error?Replaces the container's stored access policies. The anonymous access level is left unchanged.
Parameters
- identifiers SignedIdentifier[] - The new complete policy set, at most five; pass
[]to remove them all
- options AccessPolicyOptions? (default ()) - Optional options (the lease id, when the container is leased)
Return Type
- Error? - An
Errorif the policies could not be set, otherwise()
listBlobs
function listBlobs(BlobListOptions? options) returns stream<BlobEntry, Error?>|ErrorLists the container's blobs as a lazy stream.
Parameters
- options BlobListOptions? (default ()) - Optional listing options (prefix, delimiter, inclusion toggles)
listBlobsPage
function listBlobsPage(BlobPageOptions? options) returns BlobList|ErrorLists one page of the container's blobs, with the marker to resume from.
Parameters
- options BlobPageOptions? (default ()) - Optional listing options, plus the page size and marker
hasBlob
Checks whether a blob exists. Returns false only when Azure confirms the blob is
absent; an Error means the check itself failed.
Parameters
- path string - The container-relative path of the blob
deleteBlob
function deleteBlob(string path, DeleteBlobOptions? options) returns Error?Deletes a blob, or one of its snapshots. A blob that has snapshots cannot be deleted without directing what happens to them.
Parameters
- path string - The container-relative path of the blob
- options DeleteBlobOptions? (default ()) - Optional deletion options (snapshot handling, a snapshot id, the lease id)
Return Type
- Error? - An
Errorif the blob could not be deleted, otherwise()
undeleteBlob
Restores a soft-deleted blob, together with any soft-deleted snapshots it had. Find
restorable blobs with listBlobs({includeDeleted: true}).
Parameters
- path string - The container-relative path of the deleted blob
Return Type
- Error? - An
Errorif the blob could not be restored, otherwise()
getBlobProperties
function getBlobProperties(string path) returns BlobProperties|ErrorReads a blob's properties, metadata, and the state of its most recent copy operation. This is also how a pending copy is watched.
Parameters
- path string - The container-relative path of the blob
Return Type
- BlobProperties|Error - The
BlobProperties, or anError
setBlobMetadata
function setBlobMetadata(string path, map<string> metadata, BlobMetadataOptions? options) returns Error?Replaces a blob's complete metadata set. Any key absent from metadata is removed.
Parameters
- path string - The container-relative path of the blob
- options BlobMetadataOptions? (default ()) - Optional options (the lease id, when the blob is leased)
Return Type
- Error? - An
Errorif the metadata could not be set, otherwise()
setContentHeaders
function setContentHeaders(string path, ContentHeaders headers, ContentHeaderOptions? options) returns Error?Replaces a blob's complete content-header set; any header omitted from the record is cleared on the blob. Metadata is untouched.
Parameters
- path string - The container-relative path of the blob
- headers ContentHeaders - The new complete content-header set
- options ContentHeaderOptions? (default ()) - Optional options (the lease id, when the blob is leased)
Return Type
- Error? - An
Errorif the headers could not be set, otherwise()
uploadFromFile
function uploadFromFile(string sourcePath, string destinationPath, UploadOptions? options) returns Error?Uploads a local file as a block blob.
// ./reports/q1.pdf (local disk) --> 2026/q1/report.pdf (in the container) check blobClient->uploadFromFile("./reports/q1.pdf", "2026/q1/report.pdf");
Parameters
- sourcePath string - The local file to upload, including its name
- destinationPath string - The container-relative path to write, including the blob's name
- options UploadOptions? (default ()) - Optional upload options (content headers, metadata, tags, tier, lease id)
Return Type
- Error? - An
Errorif the upload failed, otherwise()
upload
function upload(UploadContent content, string destinationPath, UploadContentOptions? options) returns Error?Uploads in-memory content to the bound container.
Metrics metrics = {revenue: 1250000, growth: 0.12}; check blobClient->upload(metrics, "2026/q1/metrics.json");
Parameters
- content UploadContent - The content to upload.
byte[],stringand a byte stream are written as-is;json,xml, a record, a record array and a record stream are serialized per the resolved format
- destinationPath string - The container-relative path, including the blob name
- options UploadContentOptions? (default ()) - Optional upload options (headers, metadata, format override)
Return Type
- Error? - An
Errorif the upload failed, otherwise()
download
function download(string sourcePath, string destinationPath, DownloadOptions? options) returns Error?Downloads a blob to a local file. Fails if a local file already exists at the destination.
// 2026/q1/report.pdf (in the container) --> ./downloads/report.pdf (local disk) check blobClient->download("2026/q1/report.pdf", "./downloads/report.pdf");
Parameters
- sourcePath string - The container-relative path of the blob
- destinationPath string - The local path to write, including the file name
- options DownloadOptions? (default ()) - Optional download options (a byte range, a snapshot id)
Return Type
- Error? - An
Errorif the download failed, otherwise()
getBlob
function getBlob(string path, GetBlobOptions? options, typedesc<RetrievableType> targetType) returns targetType|ErrorRetrieves a blob's content in the form the target type selects. Binding is strict: content
that does not match the target fails with a client-side Error.
byte[] raw = check blobClient->getBlob("2026/q1/report.pdf"); Person[] people = check blobClient->getBlob("2026/q1/people.csv"); stream<byte[], error?> chunks = check blobClient->getBlob("2026/q1/large.bin");
Parameters
- path string - The container-relative path of the blob
- options GetBlobOptions? (default ()) - Optional retrieval options (a byte range, a snapshot id, the binding format)
- targetType typedesc<RetrievableType> (default <>) - Expected return type (to be used for automatic data binding).
Supported types:
- Raw bytes (
byte[]) or UTF-8 text (string) - A
jsonorxmlvalue - Custom records (e.g.,
Person,Person[]), bound perGetBlobOptions.fileFormat, else the path's extension (.json,.xml,.csv) - A lazy byte stream (
stream<byte[], error?>) - A lazy stream of CSV-bound records (e.g.,
stream<Person, error?>)
- Raw bytes (
Return Type
- targetType|Error - The content in the requested form, or an
Erroron a failed retrieval or a data binding failure
copyBlob
function copyBlob(string sourcePath, string destinationPath, CopyOptions? options) returns CopyInfo|ErrorCopies a blob within the bound container. The copy is asynchronous; watch it with
getBlobProperties or cancel it with abortCopy.
Parameters
- sourcePath string - The container-relative path of the source blob
- destinationPath string - The container-relative path of the destination blob
- options CopyOptions? (default ()) - Optional copy options (destination metadata, tags, tier, lease id)
copyBlobFromUrl
function copyBlobFromUrl(string sourceUrl, string destinationPath, CopyOptions? options) returns CopyInfo|ErrorCopies into the bound container from any Azure Storage URL the service can read. The copy is asynchronous.
Parameters
- sourceUrl string - The URL of the source. A source in this storage account is authorized by the client's credential, a SAS being attached to the URL unless it already carries one; a source elsewhere carries its own authorization, typically a SAS token
- destinationPath string - The container-relative path of the destination blob
- options CopyOptions? (default ()) - Optional copy options (destination metadata, tags, tier, lease id)
abortCopy
function abortCopy(string path, string copyId, AbortCopyOptions? options) returns Error?Cancels a pending copy.
Parameters
- path string - The container-relative path of the destination blob
- copyId string - The identifier from the
CopyInfothe copy returned
- options AbortCopyOptions? (default ()) - Optional options (the lease id, when the destination is leased)
Return Type
- Error? - An
Errorif the copy could not be aborted, otherwise()
setAccessTier
function setAccessTier(string path, AccessTier accessTier, SetAccessTierOptions? options) returns Error?Moves a blob to another access tier. Moving an archived blob to an online tier starts a rehydration that takes hours.
Parameters
- path string - The container-relative path of the blob
- accessTier AccessTier - The tier to move the blob to
- options SetAccessTierOptions? (default ()) - Optional options (the rehydration priority, the lease id)
Return Type
- Error? - An
Errorif the tier could not be set, otherwise()
setTags
function setTags(string path, map<string> tags, TagOptions? options) returns Error?Replaces a blob's complete index-tag set, at most ten tags.
Parameters
- path string - The container-relative path of the blob
- options TagOptions? (default ()) - Optional options (the lease id, when the blob is leased)
Return Type
- Error? - An
Errorif the tags could not be set, otherwise()
getTags
Reads a blob's index tags.
Parameters
- path string - The container-relative path of the blob
findBlobsByTags
function findBlobsByTags(string query) returns stream<TaggedBlobEntry, Error?>|ErrorFinds the bound container's blobs whose index tags match a query. The query is validated locally before any request is made.
Parameters
- query string - The filter expression, such as
"status" = 'done' AND "priority" >= '05'
Return Type
- stream<TaggedBlobEntry, Error?>|Error - A stream of
TaggedBlobEntry, or anError
createSnapshot
function createSnapshot(string path, CreateSnapshotOptions? options) returns string|ErrorCreates a point-in-time, read-only copy of a blob. Read the snapshot by passing its
identifier in the options of getBlob or download, and delete it through deleteBlob.
Parameters
- path string - The container-relative path of the blob
- options CreateSnapshotOptions? (default ()) - Optional options (the snapshot's metadata, the lease id)
acquireLease
function acquireLease(string path, int leaseDurationSeconds, string? proposedLeaseId) returns string|ErrorAcquires a lease on a blob, locking it against writes and deletion by others. The duration is validated locally.
Parameters
- path string - The container-relative path of the blob
- leaseDurationSeconds int - 15 to 60 for a fixed lease, or -1 for an infinite one
- proposedLeaseId string? (default ()) - A lease id to use; omit and the service generates one
renewLease
Renews a fixed-duration lease, restarting its clock.
Parameters
- path string - The container-relative path of the blob
- leaseId string - The current lease id
Return Type
- Error? - An
Errorif the lease could not be renewed, otherwise()
releaseLease
Releases a lease, making the blob immediately available to other clients.
Parameters
- path string - The container-relative path of the blob
- leaseId string - The current lease id
Return Type
- Error? - An
Errorif the lease could not be released, otherwise()
breakLease
Breaks a lease without holding its id. With no break period a fixed lease runs out its remaining time and an infinite lease breaks immediately.
Parameters
- path string - The container-relative path of the blob
- breakPeriodSeconds int? (default ()) - How long the lease keeps running before it breaks, 0 to 60
changeLease
Changes a lease's id, handing it over without a window in which another client could acquire it.
Parameters
- path string - The container-relative path of the blob
- leaseId string - The current lease id
- proposedLeaseId string - The new lease id
createAppendBlob
function createAppendBlob(string path, CreateBlobOptions? options) returns Error?Creates an empty append blob. Append blobs grow only through the append operations: the transfer operations always create block blobs.
Parameters
- path string - The container-relative path of the blob to create
- options CreateBlobOptions? (default ()) - Optional creation options (content headers, metadata, tags, lease id)
Return Type
- Error? - An
Errorif the blob could not be created, otherwise()
appendBlock
function appendBlock(string path, byte[] content, AppendBlockOptions? options) returns Error?Appends a block of content at the blob's end. Blocks append in arrival order; each block may be at most 4 MiB, and a blob holds at most 50,000 blocks.
Parameters
- path string - The container-relative path of the append blob
- content byte[] - The content to append
- options AppendBlockOptions? (default ()) - Optional options (the lease id, when the blob is leased)
Return Type
- Error? - An
Errorif the block could not be appended, otherwise()
appendBlockFromUrl
function appendBlockFromUrl(string path, string sourceUrl, AppendBlockOptions? options) returns Error?Appends content the service reads from a URL, with the same source rules as
copyBlobFromUrl.
Parameters
- path string - The container-relative path of the append blob
- sourceUrl string - The URL of the source
- options AppendBlockOptions? (default ()) - Optional options (the lease id, when the blob is leased)
Return Type
- Error? - An
Errorif the block could not be appended, otherwise()
createPageBlob
function createPageBlob(string path, int sizeInBytes, CreateBlobOptions? options) returns Error?Creates an empty page blob of a fixed capacity. The capacity is reserved sparsely: unwritten pages read as zeros and only written pages are billed.
Parameters
- path string - The container-relative path of the blob to create
- sizeInBytes int - The blob's fixed capacity, a multiple of 512 up to 8 TiB
- options CreateBlobOptions? (default ()) - Optional creation options (content headers, metadata, tags, lease id)
Return Type
- Error? - An
Errorif the blob could not be created, otherwise()
uploadPages
function uploadPages(string path, int offset, byte[] content, PageOptions? options) returns Error?Writes content at the given offset of a page blob. The offset must be 512-byte aligned and the content length a multiple of 512, at most 4 MiB per call.
Parameters
- path string - The container-relative path of the page blob
- offset int - The 512-byte-aligned offset to write at
- content byte[] - The content to write
- options PageOptions? (default ()) - Optional options (the lease id, when the blob is leased)
Return Type
- Error? - An
Errorif the pages could not be written, otherwise()
clearPages
function clearPages(string path, int offset, int length, PageOptions? options) returns Error?Resets a 512-byte-aligned range of a page blob to zeros, releasing its storage.
Parameters
- path string - The container-relative path of the page blob
- offset int - The 512-byte-aligned offset to clear from
- length int - The 512-byte-aligned number of bytes to clear
- options PageOptions? (default ()) - Optional options (the lease id, when the blob is leased)
Return Type
- Error? - An
Errorif the pages could not be cleared, otherwise()
listPageRanges
function listPageRanges(string path, PageRangeOptions? options) returns PageRange[]|ErrorLists the written byte ranges of a page blob.
Parameters
- path string - The container-relative path of the page blob
- options PageRangeOptions? (default ()) - Optional options (a byte range to restrict the listing, a snapshot id)
stageBlock
function stageBlock(string path, string blockId, byte[] content, StageBlockOptions? options) returns Error?Stages a block of content under a base64 block id, without changing the visible blob. An id that is not valid base64 fails before any request is made.
Parameters
- path string - The container-relative path of the blob
- blockId string - The block's base64 identifier; all ids of one blob must be equal in length
- content byte[] - The content to stage, at most 4,000 MiB
- options StageBlockOptions? (default ()) - Optional options (the lease id, when the blob is leased)
Return Type
- Error? - An
Errorif the block could not be staged, otherwise()
stageBlockFromUrl
function stageBlockFromUrl(string path, string blockId, string sourceUrl, StageBlockFromUrlOptions? options) returns Error?Stages a block the service reads from a URL, so the content never passes through the
caller. The source rules are those of copyBlobFromUrl.
Parameters
- path string - The container-relative path of the blob
- blockId string - The block's base64 identifier; all ids of one blob must be equal in length
- sourceUrl string - The URL of the source
- options StageBlockFromUrlOptions? (default ()) - Optional options (a source byte range, the lease id)
Return Type
- Error? - An
Errorif the block could not be staged, otherwise()
commitBlockList
function commitBlockList(string path, string[] blockIds, UploadOptions? options) returns Error?Commits an ordered list of staged block ids as the blob's content, creating or replacing it in one atomic step.
Parameters
- path string - The container-relative path of the blob
- blockIds string[] - The block ids to commit, in order
- options UploadOptions? (default ()) - Optional options (content headers, metadata, tags, tier, lease id)
Return Type
- Error? - An
Errorif the blocks could not be committed, otherwise(). All block ids must be equal in length; an unequal set fails before the request is made
listBlocks
Reports a blob's committed blocks and its staged, uncommitted blocks. This is how a restarted producer finds what it already staged.
Parameters
- path string - The container-relative path of the blob
generateContainerSas
function generateContainerSas(ContainerSasSignatureValues values) returns string|ErrorMints a SAS token scoped to the whole container, signed locally with the account key. Requires a shared-key credential or a connection string carrying an account key.
Parameters
- values ContainerSasSignatureValues - The values signed into the token (window, permissions, policy identifier)
generateSas
function generateSas(string path, BlobSasSignatureValues values) returns string|ErrorMints a SAS token scoped to a single blob. Signs locally with the account key and makes no service call, so this is an ordinary method.
Parameters
- path string - The container-relative path of the blob the token grants access to
- values BlobSasSignatureValues - The values signed into the token (window, permissions, policy identifier)
generateContainerUserDelegationSas
function generateContainerUserDelegationSas(ContainerSasSignatureValues values, UserDelegationKey key) returns string|ErrorMints a container-scoped user-delegation SAS token, signed with the given key. Valid at
most 7 days; a stored access policy identifier is rejected.
Parameters
- values ContainerSasSignatureValues - The values signed into the token; an explicit window and permissions are required
- key UserDelegationKey - The user-delegation key from
AdminClient.getUserDelegationKey
generateUserDelegationSas
function generateUserDelegationSas(string path, BlobSasSignatureValues values, UserDelegationKey key) returns string|ErrorMints a blob-scoped user-delegation SAS token, signed with the given key. Valid at most
7 days; a stored access policy identifier is rejected.
Parameters
- path string - The container-relative path of the blob the token grants access to
- values BlobSasSignatureValues - The values signed into the token; an explicit window and permissions are required
- key UserDelegationKey - The user-delegation key from
AdminClient.getUserDelegationKey
Service types
azure.storage.blob: Service
The service type attached to a Listener.
Enums
azure.storage.blob: AccessTier
The access tiers this module sets on a blob. The tier a blob reports is a plain string.
Members
azure.storage.blob: BlobEventType
The blob lifecycle event types this module dispatches.
Members
azure.storage.blob: CopyStatus
The state of a copy operation.
Members
azure.storage.blob: DeleteSnapshotsOption
What happens to a blob's snapshots when the blob is deleted.
Members
azure.storage.blob: EntraIdKind
The Microsoft Entra ID credential chains.
Members
azure.storage.blob: FileFormat
The serialization format applied to structured content.
Members
azure.storage.blob: LeaseDuration
Whether a lease runs for a fixed time or indefinitely.
Members
azure.storage.blob: LeaseState
The lease state of a container or blob.
Members
azure.storage.blob: LeaseStatus
Whether a container or blob is locked by a lease.
Members
azure.storage.blob: ProxyType
The proxy protocol.
Members
azure.storage.blob: PublicAccess
A container's anonymous access level.
Members
azure.storage.blob: RehydratePriority
How quickly an archived blob is rehydrated.
Members
azure.storage.blob: RetryPolicyType
How the delay between retries grows.
Members
azure.storage.blob: SasProtocol
The protocols a request presenting a SAS token may use.
Members
Listeners
azure.storage.blob: Listener
Consumes the blob events Azure Event Grid subscriptions deliver to Azure Storage queues, and dispatches each to the service that names the queue it arrived on.
Constructor
Initializes the listener. Every value is validated locally; no call reaches Azure.
init (*ListenerConfiguration config)- config *ListenerConfiguration - The listener configuration (authentication, data binding, transport)
attach
Attaches a service, which names the queue it consumes in its @blob:ServiceConfig
annotation. On a running listener the service's queue is polled at once.
Parameters
- serviceRef Service - The service to attach
Return Type
- error? - An
errorif the service could not be attached, otherwise()
detach
Detaches a service: its queue is no longer polled, while its running handlers finish and settle their messages. Detaching a service that is not attached fails.
Parameters
- serviceRef Service - The service to detach
Return Type
- error? - An
errorif the service could not be detached, otherwise()
'start
function 'start() returns error?Starts polling the queue of every attached service. Starting a listener that is already running fails, and a stopped listener cannot be started again.
Return Type
- error? - An
errorif the listener could not be started, otherwise()
gracefulStop
function gracefulStop() returns error?Stops polling and waits for the handlers still running, for up to ten minutes.
Return Type
- error? - An
errorif the listener could not be stopped, otherwise()
immediateStop
function immediateStop() returns error?Stops polling and returns at once. Handlers still running keep their messages hidden and settle normally.
Return Type
- error? - An
errorif the listener could not be stopped, otherwise()
Annotations
azure.storage.blob: FunctionConfig
Declares the routing configuration of a content handler.
azure.storage.blob: ServiceConfig
Names the queue a service consumes and sets its consumption settings.
Records
azure.storage.blob: AbortCopyOptions
Options for abortCopy.
Fields
- Fields Included from *LeaseOptions
- leaseId string
azure.storage.blob: AccessPolicyOptions
Options for setContainerAccessPolicy.
Fields
- Fields Included from *LeaseOptions
- leaseId string
azure.storage.blob: AccountInfo
The storage account's SKU, kind, and namespace type.
Fields
- skuName string - The account's SKU name (e.g.
Standard_LRS)
- accountKind string - The account kind (e.g.
StorageV2)
- isHierarchicalNamespaceEnabled boolean - Whether the account has a hierarchical namespace (Azure Data Lake Storage Gen2), on which directories are real and renames exist through a different endpoint
azure.storage.blob: AccountSasPermissions
The permissions granted by an account-level SAS. Every permission is off unless enabled.
Fields
- read boolean(default false) - Read content, properties, and metadata
- write boolean(default false) - Write content, properties, and metadata
- delete boolean(default false) - Delete resources
- list boolean(default false) - List containers and their blobs
- add boolean(default false) - Add content to append blobs and send queue messages; required by the
Listener
- create boolean(default false) - Create new resources, queues included; required by the
Listener
- update boolean(default false) - Update a queued message; required by the
Listener
- process boolean(default false) - Get and delete queued messages; required by the
Listener
- tag boolean(default false) - Read and write blob index tags
- filter boolean(default false) - Query blobs by their index tags
azure.storage.blob: AccountSasResourceTypes
The resource types an account SAS covers.
Fields
- 'service boolean(default false) - Service-level operations, such as reading the service properties
- container boolean(default false) - Container-level operations, such as creating or listing containers
- 'object boolean(default false) - Object-level operations on a blob
azure.storage.blob: AccountSasServices
The storage services an account SAS covers.
Fields
- blob boolean(default false) - The blob service
- queue boolean(default false) - The queue service; enable it for a
Listenercredential
azure.storage.blob: AccountSasSignatureValues
The values signed into an account-level SAS token.
Fields
- expiryTime Utc - When the token expires
- permissions AccountSasPermissions - The permissions granted
- services AccountSasServices - The services the token covers
- resourceTypes AccountSasResourceTypes - The resource types the token covers
- startTime? Utc - When the token becomes valid; omit for immediately valid
- protocol? SasProtocol - The protocols a request presenting the token may use
- ipRange? string - An IP address or range the requests must come from (e.g.
168.1.5.60-168.1.5.70)
azure.storage.blob: AppendBlockOptions
Options for the append-block operations.
Fields
- Fields Included from *LeaseOptions
- leaseId string
azure.storage.blob: BlobEntry
One entry of a blob listing. In the hierarchical mode an entry whose isPrefix is set is a
collapsed group of names rather than a blob.
Fields
- path string - The blob's container-relative path, which feeds the path-taking operations directly
- isPrefix boolean(default false) - Whether this entry is a collapsed prefix rather than a blob
- contentLength? int - The blob's size in bytes; absent on prefix entries
- lastModified? Utc - When the blob was last modified
- eTag? string - The blob's entity tag
- blobType? string - The blob type (
BlockBlob,AppendBlob, orPageBlob)
- accessTier? string - The blob's access tier, as the wire's string
- snapshotId? string - The snapshot identifier; present on snapshot entries
- isDeleted? boolean - Whether the blob is soft-deleted; present on soft-deleted entries
azure.storage.blob: BlobEvent
A blob lifecycle event, as delivered through Azure Event Grid. The fields describe the blob at the moment the event fired.
Fields
- eventType BlobEventType - Whether the blob was created (or replaced) or deleted
- accountName string - The storage account the event comes from
- containerName string - The container the blob belongs to, derived from the event subject
- path string - The blob's container-relative path, derived from the event subject
- url string - The blob's URL on the blob endpoint, which
Caller.copyBlobFromUrltakes as its source
- eventTime Utc - When the event fired
- api string - The storage operation that caused the event (e.g.
PutBlob,PutBlockList,CopyBlob)
- contentType? string - The blob's content type, as provided by the event
- contentLength? int - The blob's size in bytes, as provided by the event
- blobType? string - The blob type as the event reports it:
BlockBlob,PageBlob, orAppendBlob
- eTag? string - The blob's entity tag, as provided by the event
- sequencer string - An opaque string whose ordering is comparable for one blob path, for detecting stale events about the same blob
azure.storage.blob: BlobList
One page of a blob listing.
Fields
- blobs BlobEntry[] - The blobs returned
- nextMarker? string - The marker to resume the listing from; present only when more blobs remain
azure.storage.blob: BlobListOptions
Options for Client.listBlobs.
Fields
- prefix? string - Return only blobs whose name begins with this prefix
- delimiter? string - Group names that extend past this delimiter into a single prefix entry
- includeMetadata boolean(default false) - Include each blob's metadata
- includeTags boolean(default false) - Include each blob's index tags
- includeSnapshots boolean(default false) - Include blob snapshots
- includeDeleted boolean(default false) - Include soft-deleted blobs
azure.storage.blob: BlobMetadataOptions
Options for setBlobMetadata.
Fields
- Fields Included from *LeaseOptions
- leaseId string
azure.storage.blob: BlobPageOptions
Options for Client.listBlobsPage.
Fields
- Fields Included from *BlobListOptions
- pageSize? int - The maximum number of blobs in the page, up to the service maximum of 5,000
- marker? string - Resume from a previous
BlobList.nextMarker
azure.storage.blob: BlobProperties
A blob's properties, metadata, and the state of its most recent copy.
Fields
- lastModified Utc - When the blob was last modified
- createdTime Utc - When the blob was created
- eTag string - The blob's entity tag
- contentLength int - The blob's size in bytes
- contentHeaders ContentHeaders - The blob's content headers
- blobType string - The blob type (
BlockBlob,AppendBlob, orPageBlob)
- accessTier? string - The access tier, as the wire's string
- accessTierInferred? boolean - Whether the tier was inferred rather than set explicitly; present whenever the blob has a tier
- archiveStatus? string - The rehydration state, set while a rehydration from the archive tier is pending
- leaseState LeaseState - The lease state
- leaseStatus LeaseStatus - Whether the blob is locked by a lease
- leaseDuration LeaseDuration? - Whether a held lease is fixed-duration or infinite, or
()when no lease is held
- copyStatus? CopyStatusInfo - The most recent copy operation; absent when the blob was never a copy destination
- blobSequenceNumber? int - The page blob's write sequence marker; present only on page blobs
- committedBlockCount? int - The append blob's committed block count; present only on append blobs
azure.storage.blob: BlobSasPermissions
The permissions granted by a blob SAS. Every permission is off unless enabled.
Fields
- read boolean(default false) - Read the blob's content, properties, and metadata
- add boolean(default false) - Append a block to the append blob
- create boolean(default false) - Create the blob
- write boolean(default false) - Write the blob's content, properties, and metadata
- delete boolean(default false) - Delete the blob
- tag boolean(default false) - Read and write the blob's index tags
azure.storage.blob: BlobSasSignatureValues
The values signed into a blob SAS token.
Fields
- Fields Included from *ServiceSasSignatureValues
- expiryTime Utc
- identifier string
- startTime Utc
- protocol SasProtocol
- ipRange string
- permissions? BlobSasPermissions - The permissions granted. May be omitted only when
identifiersupplies them
azure.storage.blob: BlockInfo
One block of a block blob.
Fields
- blockId string - The block's base64 identifier
- sizeBytes int - The block's size in bytes
azure.storage.blob: BlockList
A block blob's committed and staged blocks.
Fields
- committedBlocks BlockInfo[] - The blocks that make up the blob's current content
- uncommittedBlocks BlockInfo[] - The blocks staged but not yet committed
azure.storage.blob: ByteRange
A byte range, with inclusive start and end offsets.
Fields
- startByte int - The first byte of the range
- endByte int - The last byte of the range
azure.storage.blob: CertKey
A certificate and private key pair identifying the client for mutual TLS.
Fields
- certFile string - Path to the client certificate file
- keyFile string - Path to the client private key file
- keyPassword? string - The password protecting the private key, when it is encrypted
azure.storage.blob: CertStore
A PKCS12 or JKS certificate store and the password that opens it.
Fields
- path string - Path to the store file
- password string - The store password
azure.storage.blob: ClientCertificateConfig
Microsoft Entra ID authentication as a service principal with a client certificate.
Fields
- accountName string - The storage account name (determines the service URL unless
serviceUrloverrides it)
- tenantId string - The Entra ID tenant the service principal belongs to
- clientId string - The application (client) ID of the service principal
- certificatePath string - Path to the certificate file: a PEM file, or a PFX file when
certificatePasswordis set
- certificatePassword? string - The password protecting a PFX certificate. Omit for an unencrypted PEM certificate
- serviceUrl? string - The blob service endpoint URL, including the scheme. Omit to use the default
https://{accountName}.blob.core.windows.net
azure.storage.blob: ClientConfiguration
Configuration for an azure.storage.blob client (Client or AdminClient).
Fields
- auth AuthConfig - The authentication configuration (see
AuthConfig)
- retryConfig RetryConfig(default {}) - Retry behaviour for service requests; the connector's defaults apply when omitted
- transportConfig TransportConfig(default {}) - HTTP transport settings (proxy, connection pool, TLS)
azure.storage.blob: ClientSecretConfig
Microsoft Entra ID authentication as a service principal with a client secret.
Fields
- accountName string - The storage account name (determines the service URL unless
serviceUrloverrides it)
- tenantId string - The Entra ID tenant the service principal belongs to
- clientId string - The application (client) ID of the service principal
- clientSecret string - The client secret issued for the service principal
- serviceUrl? string - The blob service endpoint URL, including the scheme. Omit to use the default
https://{accountName}.blob.core.windows.net
azure.storage.blob: ConnectionPoolConfig
Connection-pool settings for the connector's HTTP transport.
Fields
- maxConnections int(default 50) - The maximum number of concurrent connections
- idleTimeout decimal(default 60) - How long an idle connection is kept before being closed, in seconds
- connectTimeout decimal(default 10) - The timeout for establishing a connection, in seconds
- readTimeout decimal(default 60) - The timeout for reading a response, in seconds
azure.storage.blob: ConnectionStringConfig
Connection-string authentication. The connection string carries the account name, the credential (an account key or a SAS token), and the service endpoints.
Fields
- connectionString string - An Azure Storage connection string, as issued by the Azure portal, the Azure CLI, or infrastructure tooling
azure.storage.blob: ContainerAccessPolicy
A container's anonymous access level and its stored access policies, as the wire carries them: together.
Fields
- access PublicAccess - The anonymous access level
- identifiers SignedIdentifier[] - The stored access policies, at most five
azure.storage.blob: ContainerCreateOptions
Options for createContainer.
Fields
- publicAccess? PublicAccess - The anonymous access level. Omit to create a private container. Anonymous access also requires the storage account to permit it
azure.storage.blob: ContainerInfo
A container as returned by the account-level listings.
Fields
- name string - The container name
- lastModified Utc - When the container was last modified
- eTag string - The container's entity tag
- publicAccess PublicAccess - The anonymous access level
- leaseState LeaseState - The lease state
- leaseStatus LeaseStatus - Whether the container is locked by a lease
- leaseDuration LeaseDuration? - Whether a held lease is fixed-duration or infinite, or
()when no lease is held
- isDeleted? boolean - Whether the container is soft-deleted; present only on soft-deleted entries
- deletedVersion? string - The restore version of a soft-deleted container; pass to
AdminClient.undeleteContainer
- deletedTime? Utc - When the container was deleted; present only on soft-deleted entries
- remainingRetentionDays? int - Days remaining before the soft-deleted container is purged
azure.storage.blob: ContainerList
The result of a container listing.
Fields
- containers ContainerInfo[] - The containers returned
- nextMarker? string - The marker to resume the listing from; present only when more containers remain
azure.storage.blob: ContainerListOptions
Options for AdminClient.listContainers.
Fields
- prefix? string - Return only containers whose name begins with this prefix
- includeMetadata boolean(default false) - Include each container's metadata
- includeDeleted boolean(default false) - Include soft-deleted containers
- 'limit? int - The maximum number of containers to return; omit for all
- marker? string - Resume from a previous
ContainerList.nextMarker
azure.storage.blob: ContainerMetadataOptions
Options for setContainerMetadata.
Fields
- Fields Included from *LeaseOptions
- leaseId string
azure.storage.blob: ContainerProperties
The bound container's properties and metadata.
Fields
- lastModified Utc - When the container was last modified
- eTag string - The container's entity tag
- publicAccess PublicAccess - The anonymous access level
- leaseState LeaseState - The lease state
- leaseStatus LeaseStatus - Whether the container is locked by a lease
- leaseDuration LeaseDuration? - Whether a held lease is fixed-duration or infinite, or
()when no lease is held
- hasImmutabilityPolicy boolean - Whether an immutability policy is set on the container
- hasLegalHold boolean - Whether a legal hold is set on the container
azure.storage.blob: ContainerSasPermissions
The permissions granted by a container SAS: the blob permissions, plus listing and tag queries.
Fields
- Fields Included from *BlobSasPermissions
- list boolean(default false) - List the container's blobs
- filter boolean(default false) - Run an index-tag query
azure.storage.blob: ContainerSasSignatureValues
The values signed into a container SAS token.
Fields
- Fields Included from *ServiceSasSignatureValues
- expiryTime Utc
- identifier string
- startTime Utc
- protocol SasProtocol
- ipRange string
- permissions? ContainerSasPermissions - The permissions granted. May be omitted only when
identifiersupplies them
azure.storage.blob: ContentBindingErrorDetail
The blob whose content failed to bind.
Fields
- containerName string - The blob's container
- path string - The blob's container-relative path
- content? byte[] - The content, when it was already read into memory
azure.storage.blob: ContentHeaderOptions
Options for setContentHeaders.
Fields
- Fields Included from *LeaseOptions
- leaseId string
azure.storage.blob: ContentHeaders
A blob's standard content headers. Written as a whole set: a field omitted from the record is cleared on the blob.
Fields
- contentType? string - The media type of the blob's content
- contentEncoding? string - The content encoding applied to the blob
- contentLanguage? string - The natural language of the blob's content
- contentDisposition? string - How a user agent should present the content
- cacheControl? string - The caching directives for the blob
- contentMd5? string - The MD5 hash of the blob's content
azure.storage.blob: CopyInfo
The identifier and state of a copy at the moment the service accepted it.
Fields
- copyId string - The identifier of the copy operation, which
abortCopycancels
- copyStatus CopyStatus - The copy's state at acceptance, which may already be
SUCCESSfor a small copy
azure.storage.blob: CopyOptions
Options for the copies. An asynchronous copy over a leased destination requires that lease to be infinite.
Fields
- Fields Included from *LeaseOptions
- leaseId string
- accessTier? AccessTier - The access tier the destination blob starts in
azure.storage.blob: CopyStatusInfo
The state of a blob's most recent copy operation.
Fields
- copyId string - The identifier of the copy operation
- copyStatus CopyStatus - The copy's state
- copySource string - The URL the content was copied from
- copyProgress? string - The bytes copied so far, as
copied/total
- copyCompletionTime? Utc - When the copy completed
- copyStatusDescription? string - The service's description of a failed or aborted copy
azure.storage.blob: CorsRule
One cross-origin resource sharing rule.
Fields
- allowedOrigins string[] - The origins allowed to make cross-origin requests
- allowedMethods string[] - The HTTP methods allowed in cross-origin requests
- allowedHeaders string[] - The request headers the origin may specify
- exposedHeaders string[] - The response headers exposed to the client
- maxAgeInSeconds int - How long a browser may cache the preflight response, in seconds
azure.storage.blob: CreateBlobOptions
Options for creating an append blob or a page blob.
Fields
- Fields Included from *LeaseOptions
- leaseId string
- contentHeaders? ContentHeaders - The content headers stored with the new blob
azure.storage.blob: CreateSnapshotOptions
Options for createSnapshot.
Fields
- Fields Included from *LeaseOptions
- leaseId string
azure.storage.blob: DeleteBlobOptions
Options for deleteBlob.
Fields
- Fields Included from *LeaseOptions
- leaseId string
- deleteSnapshots? DeleteSnapshotsOption - What happens to the blob's snapshots. Required when the blob has snapshots
- snapshotId? string - Deletes this snapshot instead of the blob
azure.storage.blob: DeleteContainerOptions
Options for deleteContainer.
Fields
- Fields Included from *LeaseOptions
- leaseId string
azure.storage.blob: DownloadOptions
Options for download.
Fields
- range? ByteRange - Reads only this byte range of the blob
- snapshotId? string - Reads this snapshot instead of the live blob
azure.storage.blob: EntraIdChainConfig
Microsoft Entra ID authentication through a credential chain.
Fields
- kind EntraIdKind - The credential chain to use
- accountName string - The storage account name (determines the service URL unless
serviceUrloverrides it)
- clientId? string - The client ID of a user-assigned managed identity. Omit to use the system-assigned one
- serviceUrl? string - The blob service endpoint URL, including the scheme. Omit to use the default
https://{accountName}.blob.core.windows.net
azure.storage.blob: FunctionConfiguration
The per-handler routing configuration, supplied through the @blob:FunctionConfig
annotation. It overrides the extension-based routing of created events.
Fields
- namePattern? string - A regular expression matched against the blob name (the last path segment)
- contentTypePattern? string - A regular expression matched against the blob's content type
azure.storage.blob: GetBlobOptions
Options for getBlob, extending the download options with the binding format.
Fields
- Fields Included from *DownloadOptions
- fileFormat? FileFormat - The binding format for record targets; when absent, the format is inferred from the
path's extension (
.json,.xml,.csv)
azure.storage.blob: LeaseOptions
The lease a write must carry. Included by every option record of a lease-guarded write.
Fields
- leaseId? string - The active lease id, required when the target is leased
azure.storage.blob: ListenerConfiguration
Configuration for an azure.storage.blob Listener.
Fields
- auth AuthConfig - The authentication configuration (see
AuthConfig). One credential serves every queue, every poison queue, and everyCallerof the listener; a SAS credential must be an account SAS covering both the queue and the blob services
- laxDataBinding boolean(default false) - Relaxed data binding for the typed content handlers: JSON and CSV record binding treat a null value as an optional field and an absent field as a nilable field, and XML record binding tolerates undeclared elements
- retryConfig RetryConfig(default {}) - Retry behaviour for service requests; the connector's defaults apply when omitted. The secondary host, if given, serves the blob requests only
- transportConfig TransportConfig(default {}) - HTTP transport settings (proxy, connection pool, TLS), shared by every service and
Callerof the listener
- queueServiceUrl? string - The queue service endpoint URL, including the scheme. Omit to derive it from the credential's blob endpoint or account name
azure.storage.blob: LoggingProperties
Classic request logging for the blob service.
Fields
- version string - The logging configuration version
- read boolean - Whether read requests are logged
- write boolean - Whether write requests are logged
- delete boolean - Whether delete requests are logged
- retentionPolicy? RetentionPolicy - How long the log data is retained
azure.storage.blob: MetricsProperties
Request-metrics collection for the blob service.
Fields
- version string - The metrics configuration version
- enabled boolean - Whether metrics collection is enabled
- includeApis? boolean - Whether per-API metrics are collected
- retentionPolicy? RetentionPolicy - How long the metrics data is retained
azure.storage.blob: PageOptions
Options for the page write operations.
Fields
- Fields Included from *LeaseOptions
- leaseId string
azure.storage.blob: PageRange
One written byte range of a page blob.
Fields
- offset int - The range's start offset in bytes
- length int - The range's length in bytes
azure.storage.blob: PageRangeOptions
Options for listPageRanges.
Fields
- range? ByteRange - Restricts the listing to this byte range
- snapshotId? string - Lists the ranges of this snapshot instead of the live blob
azure.storage.blob: ProxyConfig
Proxy settings for the connector's traffic.
Fields
- proxyType ProxyType(default HTTP) - The proxy protocol
- host string - The proxy host name or address
- port int - The proxy port
- username? string - The user name, when the proxy requires authentication
- password? string - The password, when the proxy requires authentication
- nonProxyHosts? string[] - Host names that bypass the proxy
azure.storage.blob: RetentionPolicy
How long soft-deleted blobs, or metrics and log data, are retained.
Fields
- enabled boolean - Whether the retention policy is enabled
- days? int - The number of days a deleted resource is retained
azure.storage.blob: RetryConfig
Retry behaviour for service requests. Omit the record to keep the connector's defaults.
Fields
- retryPolicyType RetryPolicyType(default EXPONENTIAL) - How the delay between tries grows
- maxTries int(default 4) - The maximum number of tries, counting the first attempt
- tryTimeout decimal(default 60) - The timeout applied to each individual try, in seconds
- retryDelay decimal(default 4) - The base delay between tries, in seconds
- maxRetryDelay decimal(default 120) - The upper bound on the delay between tries, in seconds
- secondaryHostUrl? string - A secondary endpoint to retry reads against, for geo-redundant accounts
azure.storage.blob: RetryErrorDetail
The detail of a RetryError.
Fields
- delay decimal - The least time, in seconds, before the message is redelivered
azure.storage.blob: SasConfig
Shared Access Signature (SAS) authentication with a bare SAS token, as issued by
az storage container generate-sas or the SAS-generation operations.
Fields
- accountName string - The name of the storage account the token belongs to (determines the service URL)
- sasToken string - A SAS token scoped to the required resources and permissions
azure.storage.blob: SasUrlConfig
Shared Access Signature (SAS) authentication with a full SAS URL, which carries the service URL and the SAS token in one string, as issued by the Azure portal.
Fields
- sasUrl string - A full blob-service SAS URL, including the scheme and the SAS query string
(e.g.
https://{account}.blob.core.windows.net/?sv=...&sig=...)
azure.storage.blob: SecureSocket
TLS configuration for the connector's HTTPS traffic.
Fields
- protocolVersions? string[] - The TLS protocol versions offered during the handshake (e.g.
["TLSv1.3", "TLSv1.2"])
- ciphers? string[] - The cipher suites offered during the handshake
- verifyHostName boolean(default true) - Whether the server's host name is verified against its certificate
- sessionResumption? boolean - Whether TLS sessions may be resumed
- validateRevocation? boolean - Whether the server certificate's revocation status is checked
- sniHostName? string - The Server Name Indication host name sent during the handshake
- handshakeTimeout? decimal - The TLS handshake timeout, in seconds
- sessionTimeout? decimal - The TLS session timeout, in seconds
azure.storage.blob: ServiceConfiguration
The queue a service consumes and how it is consumed, supplied through the
@blob:ServiceConfig annotation.
Fields
- queueName string - The storage queue the service's Event Grid subscription delivers to
- poisonQueueName? string - The queue failed messages move to. Defaults to
{queueName}-poison
- batchSize int(default 16) - How many messages one receive fetches, 1 to 32
- newBatchThreshold? int - The number of events still being handled at which the next batch is fetched, 0 to
batchSize. Defaults to half the batch size, rounded down
- maxPollingInterval decimal(default 60) - The longest wait between polls of an empty queue, in seconds
- redeliveryDelay decimal(default 0) - How long a message stays invisible after its handler fails, before it is redelivered, in seconds, 0 to 604,800, rounded up to whole seconds
- maxDeliveryCount int(default 5) - How many deliveries a message gets before it is moved to the poison queue, at least 1
azure.storage.blob: ServiceErrorDetail
Structured detail carried by every error the Azure service raised.
Fields
- httpStatus int - The HTTP status code returned by Azure
- errorCode string - The Azure error code (e.g.
BlobNotFound)
azure.storage.blob: ServiceProperties
The account's blob service configuration. A group present in the record replaces that group whole; a group absent is left unchanged.
Fields
- hourMetrics? MetricsProperties - Hourly request-metrics collection
- minuteMetrics? MetricsProperties - Per-minute request-metrics collection
- logging? LoggingProperties - Classic request logging
- cors? CorsRule[] - The CORS rules; an empty array deletes every rule
- deleteRetentionPolicy? RetentionPolicy - The blob soft-delete retention policy, the prerequisite for
undeleteBlob
- staticWebsite? StaticWebsiteProperties - The static website settings
- defaultServiceVersion? string - The service version applied to requests that do not name one
azure.storage.blob: ServiceSasSignatureValues
The values shared by the container and blob SAS tokens. A parameter may be carried by the stored access policy or by the token, but not both.
Fields
- expiryTime? Utc - When the token expires. May be omitted only when
identifiersupplies it
- identifier? string - A stored access policy on the container whose window and permissions the token inherits
- startTime? Utc - When the token becomes valid; omit for immediately valid
- protocol? SasProtocol - The protocols a request presenting the token may use
- ipRange? string - An IP address or range the requests must come from (e.g.
168.1.5.60-168.1.5.70)
azure.storage.blob: SetAccessTierOptions
Options for setAccessTier.
Fields
- Fields Included from *LeaseOptions
- leaseId string
- rehydratePriority? RehydratePriority - How quickly an archived blob is rehydrated; meaningful when leaving the archive tier
azure.storage.blob: SharedKeyConfig
Shared Key authentication with the storage account name and one of its access keys.
Fields
- accountName string - The storage account name, used to sign requests and to derive the service URL
- accountKey string - A base64-encoded access key of the storage account
- serviceUrl? string - The blob service endpoint URL, including the scheme. Omit to use the default
https://{accountName}.blob.core.windows.net
azure.storage.blob: SignedIdentifier
One stored access policy: a validity window and a permission string under an identifier.
Fields
- id string - The identifier a SAS token references to inherit this policy
- startTime? Utc - When the policy becomes valid
- expiryTime? Utc - When the policy expires
- permissions? string - The permissions the policy grants, as the wire's permission string
azure.storage.blob: StageBlockFromUrlOptions
Options for stageBlockFromUrl.
Fields
- Fields Included from *LeaseOptions
- leaseId string
- sourceRange? ByteRange - Stages only this byte range of the source instead of its whole content
azure.storage.blob: StageBlockOptions
Options for stageBlock.
Fields
- Fields Included from *LeaseOptions
- leaseId string
azure.storage.blob: StaticWebsiteProperties
The account's static website settings.
Fields
- enabled boolean - Whether static website hosting is enabled
- indexDocument? string - The blob served for a directory request
- errorDocument404Path? string - The blob served when a request matches nothing
- defaultIndexDocumentPath? string - The default index document path
azure.storage.blob: TaggedBlobEntry
One blob matched by an index-tag query.
Fields
- path string - The blob's container-relative path
azure.storage.blob: TagOptions
Options for the index-tag writes.
Fields
- Fields Included from *LeaseOptions
- leaseId string
azure.storage.blob: TransportConfig
HTTP transport settings: proxying, connection pooling, and TLS.
Fields
- proxy? ProxyConfig - Route traffic through this proxy
- connectionPool ConnectionPoolConfig(default {}) - Connection-pool tuning
- secureSocket? SecureSocket - Custom TLS settings (trust and key material, verification)
azure.storage.blob: UploadContentOptions
Options for upload, extending the upload options with the serialization format.
Fields
- Fields Included from *UploadOptions
- contentHeaders ContentHeaders
- metadata map<string>
- tags map<string>
- accessTier AccessTier
- leaseId string
- fileFormat? FileFormat - The serialization format for structured content; when absent, the format is inferred
from the destination path's extension (
.json,.xml,.csv)
azure.storage.blob: UploadOptions
Options for the uploads.
Fields
- Fields Included from *LeaseOptions
- leaseId string
- contentHeaders? ContentHeaders - The content headers stored with the new blob
- accessTier? AccessTier - The access tier the new blob starts in
azure.storage.blob: UserDelegationKey
A key for signing user-delegation SAS tokens, obtained from AdminClient.getUserDelegationKey.
Fields
- signedObjectId string - The object ID of the Entra ID identity the key was issued to
- signedTenantId string - The tenant the identity belongs to
- signedStart Utc - When the key becomes valid
- signedExpiry Utc - When the key expires; tokens signed with it cannot outlive this
- signedService string - The service the key applies to
- signedVersion string - The service version that issued the key
- value string - The key value used to sign tokens
azure.storage.blob: WorkloadIdentityConfig
Microsoft Entra ID workload-identity authentication, for Kubernetes workloads federated with Entra ID.
Fields
- accountName string - The storage account name (determines the service URL unless
serviceUrloverrides it)
- tenantId string - The Entra ID tenant the workload identity belongs to
- clientId string - The application (client) ID of the federated identity
- tokenFilePath string - Path to the projected service-account token file
- serviceUrl? string - The blob service endpoint URL, including the scheme. Omit to use the default
https://{accountName}.blob.core.windows.net
Errors
azure.storage.blob: ArchivedBlobError
The blob's content is unavailable because of the archive tier, either still archived or currently rehydrating (HTTP 409).
azure.storage.blob: AuthorizationError
Authentication or authorization failed, e.g. an invalid key or insufficient SAS permissions (HTTP 403).
azure.storage.blob: ConflictError
The operation conflicts with the current state of the resource, e.g. creating a container that already exists, or deleting a blob whose snapshots were not directed (HTTP 409).
azure.storage.blob: ContentBindingError
A blob's content could not be bound to the handler's parameter type.
azure.storage.blob: DeadLetterError
Returned by a handler to move the message to the poison queue at once.
azure.storage.blob: Error
The root error type. A client-side failure is this type and carries no detail, except the
listener's ContentBindingError; an error raised by the Azure service is a ServiceError.
azure.storage.blob: InvalidBlobTypeError
The operation applies to another blob type, e.g. appending to a block blob or writing pages to an append blob (HTTP 409).
azure.storage.blob: NotFoundError
The requested container, blob, queue or message was not found (HTTP 404).
azure.storage.blob: PreconditionFailedError
A precondition such as a lease-id requirement on a write was not met (HTTP 412).
azure.storage.blob: RangeNotSatisfiableError
The requested byte range cannot be satisfied for the target blob, including a misaligned page range (HTTP 416).
Union types
azure.storage.blob: UploadContent
UploadContent
The content forms upload accepts. byte[], string and a byte stream are written as-is;
the other members are serialized per the resolved format.
azure.storage.blob: RetrievableType
RetrievableType
The target forms getBlob retrieves. The members mirror UploadContent, so anything written
is readable back in the same type.
azure.storage.blob: EntraIdConfig
EntraIdConfig
Microsoft Entra ID authentication: a credential chain, or a service principal identified by its client secret, its certificate, or a federated token.
azure.storage.blob: AuthConfig
AuthConfig
The authentication configuration: exactly one credential-artifact record, selected by the fields present.
Import
import ballerinax/azure.storage.blob;Other versions
1.0.0
Metadata
Released date: about 6 hours ago
Version: 1.0.0
License: Apache-2.0
Compatibility
Platform: java25
Ballerina version: 2201.14.0
GraalVM compatible: Yes
Pull count
Total: 0
Current verison: 0
Weekly downloads
Keywords
Type/Connector
Area/Storage & File Management
Cost/Paid
Vendor/Microsoft
Contributors