azure.storage.files
Module azure.storage.files
API
Declarations
Definitions
ballerinax/azure.storage.files Ballerina library
Overview
Azure Files offers fully managed file shares in the cloud, accessible via the industry-standard SMB and NFS protocols and a REST API.
The Azure Files connector offers APIs to connect to Azure Files and manage shares and the directories and files within them, covering uploads, downloads, copies, renames, byte ranges, snapshots, leases, and SAS token generation. It also provides a polling Listener that turns files arriving on a share into service events.
Key Features
- Share-scoped
Clientfor directory and file operations, transfers, copies, and byte ranges - Account-level
AdminClientfor creating, listing, deleting, and restoring shares - Polling
Listenerthat routes files arriving on a watched path to raw, typed, or streaming content handlers, with an optionalonErrornotification handler - Share snapshots, leases, access policies, SMB handles, and NFS links
- Authentication with shared key, SAS tokens, connection strings, and Microsoft Entra ID
- GraalVM compatible for native image builds
Setup guide
To use the Azure Files 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, select a subscription and resource group, provide a globally unique storage account name, and pick a region. The Standard performance tier is sufficient for SMB file shares; choose Premium with the File shares account type only if you need provisioned performance or NFS.

-
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 file share
-
Open the deployed storage account and navigate to Data storage > File shares.
-
Click + File share, provide a name, and click Create. The share name is what you pass to the connector's
Clientat initialization. For details, see the Azure Files documentation.
Step 3: Obtain the credentials
-
In the storage account, navigate to Security + networking > Access keys.
-
Click Show next to key1, then copy the storage account name and the key value. These two values are the
accountNameandaccountKeythe connector's shared key authentication uses.
The connector also accepts a SAS token or SAS URL (generated under Security + networking > Shared access signature), a connection string (shown alongside each access key), and Microsoft Entra ID credentials.

Quickstart
To use the azure.storage.files connector in your Ballerina application, modify the .bal file as follows:
Step 1: Import the module
import ballerinax/azure.storage.files;
Step 2: Instantiate a new connector
A Client is bound to a single file share. Provide the credentials through configurable variables:
configurable string accountName = ?; configurable string accountKey = ?; files:Client fileClient = check new ("reports", auth = {accountName, accountKey});
Step 3: Invoke the connector operation
Now, utilize the available connector operations.
Upload a file
check fileClient->uploadFile("./local/q1.pdf", "/reports/q1.pdf");
Get the properties of a file
files:FileProperties props = check fileClient->getFileProperties("/reports/q1.pdf");
Manage shares
files:AdminClient admin = check new (auth = {accountName, accountKey}); check admin->createShare("reports");
Step 4: Run the Ballerina application
Save the changes and run the Ballerina application using the following command.
bal run
Examples
The azure.storage.files connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering use cases like backing up a folder to a share, handing out a time-limited file link, and processing files dropped into a share folder.
- File backup - Back up a local folder to a file share and restore a file from it.
- Share handout - Upload a report and generate a time-limited, read-only SAS URL to share with a third party.
- Drop folder processor - Watch a folder on a share with the listener and process each dropped file, deleting JSON files and moving the rest into a processed folder.
Clients
azure.storage.files: AdminClient
Account-level client for Azure Files, managing the shares within a storage account.
Constructor
Initializes the account-level client for the given storage account.
init (*ClientConfiguration config)- config *ClientConfiguration - The client configuration (authentication, retry, transport)
hasShare
Checks whether a share exists in the storage account. Returns false only when Azure
confirms the share is absent; an Error means the check itself failed.
Parameters
- shareName string - The name of the share to check
listShares
function listShares(ShareListOptions? options) returns ShareInfo[]|ErrorLists the shares in the storage account.
Parameters
- options ShareListOptions? (default ()) - Optional filtering and listing options
createShare
function createShare(string shareName, ShareCreateOptions? options) returns Error?Creates a new share in the storage account.
Parameters
- shareName string - The name of the share to create
- options ShareCreateOptions? (default ()) - Optional creation options (quota, tier, protocols, metadata)
Return Type
- Error? - An
Errorif the share could not be created, otherwise()
deleteShare
function deleteShare(string shareName, ShareDeleteOptions? options) returns Error?Deletes a share from the storage account.
Parameters
- shareName string - The name of the share to delete
- options ShareDeleteOptions? (default ()) - Optional deletion options (snapshot handling, lease id)
Return Type
- Error? - An
Errorif the share could not be deleted, otherwise()
undeleteShare
Restores a soft-deleted share.
Parameters
- shareName string - The name of the soft-deleted share to restore
- version string - The version of the soft-deleted share (from
ShareInfo.version)
Return Type
- Error? - An
Errorif the share could not be restored, otherwise()
getServiceProperties
function getServiceProperties() returns ServiceProperties|ErrorReads the account's file-service configuration (metrics and CORS rules).
Return Type
- ServiceProperties|Error - The
ServiceProperties, or anError
setServiceProperties
function setServiceProperties(ServiceProperties properties) returns Error?Updates the account's file-service configuration. The record replaces the whole configuration.
Parameters
- properties ServiceProperties - The complete file-service configuration to apply
Return Type
- Error? - An
Errorif the configuration could not be updated, otherwise()
getUserDelegationKey
function getUserDelegationKey(Utc startTime, Utc expiryTime) returns UserDelegationKey|ErrorGets a user-delegation key for signing user-delegation SAS tokens. Requires Microsoft
Entra ID credentials with the Storage File Delegator role.
Parameters
- startTime Utc - The start of the key's validity period
- expiryTime Utc - The end of the key's validity period (at most 7 days out)
Return Type
- UserDelegationKey|Error - The
UserDelegationKey, or anError
generateAccountSas
function generateAccountSas(AccountSasSignatureValues values) returns string|ErrorGenerates an account-level SAS (Shared Access Signature) token. Requires shared key credentials.
Parameters
- values AccountSasSignatureValues - What the SAS grants: validity window, permissions, and resource types
azure.storage.files: Caller
The context object passed to a listener service's handlers, exposing a share-scoped
subset of Client to act on the event's file.
It cannot be instantiated by user code.
downloadFile
function downloadFile(string sourcePath, string destinationPath, DownloadOptions? options) returns Error?Downloads a file to a local path. An existing local file at destinationPath fails the
download with a ProcessingError.
Parameters
- sourcePath string - The share-relative path of the file to download, including the file name
- destinationPath string - The local path to write the downloaded file to (must not exist)
- options DownloadOptions? (default ()) - Optional download options (range)
Return Type
- Error? - An
Errorif the download failed, otherwise()
getFileContent
function getFileContent(string path, DownloadOptions? options) returns stream<byte[], Error?>|ErrorOpens a file's content as a byte stream.
Parameters
- path string - The source share-relative path
- options DownloadOptions? (default ()) - Optional download options (range)
getFileText
function getFileText(string path, DownloadOptions? options) returns string|ErrorReads a file's full content as UTF-8 text.
Parameters
- path string - The source share-relative path
- options DownloadOptions? (default ()) - Optional download options (range, snapshot)
getFileJson
function getFileJson(string path, DownloadOptions? options, typedesc<json|record {}> targetType) returns targetType|ErrorReads a file's full content and binds it as JSON to the target type. Binding is strict: the content must match the target type exactly.
Parameters
- path string - The source share-relative path
- options DownloadOptions? (default ()) - Optional download options (range, snapshot)
- targetType typedesc<json|record {}> (default <>) - The type to bind the content to, a
jsonform or a record
Return Type
- targetType|Error - The bound value, or an
Error
getFileXml
function getFileXml(string path, DownloadOptions? options, typedesc<xml|record {}> targetType) returns targetType|ErrorReads a file's full content and binds it as XML: to an xml value, or to a record
projected from the document. Binding is strict.
Parameters
- path string - The source share-relative path
- options DownloadOptions? (default ()) - Optional download options (range, snapshot)
- targetType typedesc<xml|record {}> (default <>) - The type to bind the content to,
xmlor a record
Return Type
- targetType|Error - The bound value, or an
Error
getFileCsv
function getFileCsv(string path, DownloadOptions? options, typedesc<string[][]|record {}[]> targetType) returns targetType|ErrorReads a file's full content and binds it as CSV: to string[][] rows, or to a record
array whose field names are taken from the header row. Binding is strict.
Parameters
- path string - The source share-relative path
- options DownloadOptions? (default ()) - Optional download options (range, snapshot)
- targetType typedesc<string[][]|record {}[]> (default <>) - The type to bind the content to,
string[][]or a record array
Return Type
- targetType|Error - The bound value, or an
Error
uploadFile
function uploadFile(string sourcePath, string destinationPath, UploadOptions? options) returns Error?Uploads a local file to the watched share.
Parameters
- sourcePath string - The path of the local file to upload, including the file name
- destinationPath string - The share-relative path the file is written to, including the file name
- options UploadOptions? (default ()) - Optional upload options (headers, metadata, permission, SMB properties)
Return Type
- Error? - An
Errorif the upload failed, otherwise()
uploadContent
function uploadContent(byte[]|string|xml|map<json>|string[][] content, string destinationPath, UploadOptions? options) returns Error?Uploads in-memory content to the watched share. Dispatch is by the value's runtime type:
byte[] is written as-is, a string as raw text, xml as its textual form, a
map<json> (including compatible records) as a JSON document, and a string[][] as
CSV rows.
Parameters
- destinationPath string - The share-relative path the content is written to, including the file name
- options UploadOptions? (default ()) - Optional upload options (headers, metadata, permission, SMB properties)
Return Type
- Error? - An
Errorif the upload failed, otherwise()
deleteFile
Deletes a file from the watched share.
Parameters
- path string - The share-relative path of the file to delete
Return Type
- Error? - An
Errorif the file could not be deleted, otherwise()
renameFile
function renameFile(string sourcePath, string destinationPath, RenameOptions? options) returns Error?Renames or moves a file within the watched share. An existing destination file is
overwritten only when RenameOptions.replaceIfExists is set.
Parameters
- sourcePath string - The current share-relative path of the file
- destinationPath string - The new share-relative path
- options RenameOptions? (default ()) - Optional rename options (overwrite, permission, metadata)
Return Type
- Error? - An
Errorif the file could not be renamed, otherwise()
copyFile
function copyFile(string sourcePath, string destinationPath, CopyOptions? options) returns CopyInfo|ErrorCopies a file within the watched share. The copy is asynchronous; inspect the returned
CopyInfo.copyStatus for its state.
Parameters
- sourcePath string - The source share-relative path
- destinationPath string - The destination share-relative path
- options CopyOptions? (default ()) - Optional copy options (metadata, permission handling)
checkCopyStatus
function checkCopyStatus(string path) returns CopyStatusInfo?|ErrorChecks the state of the most recent copy operation that targeted a file.
Parameters
- path string - The destination share-relative path of the copy
Return Type
- CopyStatusInfo?|Error - The
CopyStatusInfo,()if the file has never been the destination of a copy operation, or anError
abortCopy
Aborts a pending asynchronous copy operation.
Parameters
- path string - The destination share-relative path of the copy
- copyId string - The identifier of the copy to abort (from
CopyInfo.copyId)
Return Type
- Error? - An
Errorif the copy could not be aborted, otherwise()
createDirectory
function createDirectory(string directoryPath, DirectoryCreateOptions? options) returns Error?Creates a directory in the watched share.
Parameters
- directoryPath string - The share-relative path of the directory to create
- options DirectoryCreateOptions? (default ()) - Optional creation options (metadata, permission, SMB properties)
Return Type
- Error? - An
Errorif the directory could not be created, otherwise()
deleteDirectory
Deletes a directory from the watched share. The directory must be empty.
Parameters
- directoryPath string - The share-relative path of the directory to delete
Return Type
- Error? - An
Errorif the directory could not be deleted, otherwise()
list
Lists the entries (files and subdirectories) under a directory of the watched share.
Parameters
- directoryPath string - The share-relative path of the directory to list
- options ListOptions? (default ()) - Optional listing options (prefix, recursion, extended info)
azure.storage.files: Client
Share-scoped client for Azure Files, operating on a single share and the directories and files within it.
Constructor
Initializes the client and binds it to a single share.
init (string shareName, *ClientConfiguration config)- shareName string - The name of the share this client operates on
- config *ClientConfiguration - The client configuration (authentication, retry, transport)
getShareProperties
function getShareProperties() returns ShareProperties|ErrorGets the properties of the bound share.
Return Type
- ShareProperties|Error - The
ShareProperties, or anError
setShareMetadata
Replaces the metadata of the bound share.
Return Type
- Error? - An
Errorif the metadata could not be set, otherwise()
getShareUsage
Gets the approximate amount of data stored on the bound share, in bytes.
createDirectory
function createDirectory(string directoryPath, DirectoryCreateOptions? options) returns Error?Creates a directory in the bound share.
Parameters
- directoryPath string - The share-relative path of the directory to create
- options DirectoryCreateOptions? (default ()) - Optional creation options (metadata, permission, SMB properties)
Return Type
- Error? - An
Errorif the directory could not be created, otherwise()
deleteDirectory
Deletes a directory from the bound share. The directory must be empty.
Parameters
- directoryPath string - The share-relative path of the directory to delete
Return Type
- Error? - An
Errorif the directory could not be deleted, otherwise()
hasDirectory
Checks whether a directory exists in the bound share. Returns false only when Azure
confirms the directory is absent; an Error means the check itself failed.
Parameters
- directoryPath string - The share-relative path of the directory
getDirectoryProperties
function getDirectoryProperties(string directoryPath) returns DirectoryProperties|ErrorGets the properties of a directory.
Parameters
- directoryPath string - The share-relative path of the directory
Return Type
- DirectoryProperties|Error - The
DirectoryProperties, or anError
setDirectoryMetadata
Replaces the metadata of a directory.
Parameters
- directoryPath string - The share-relative path of the directory
Return Type
- Error? - An
Errorif the metadata could not be set, otherwise()
list
Lists the entries (files and subdirectories) under a directory.
Parameters
- directoryPath string - The share-relative path of the directory to list
- options ListOptions? (default ()) - Optional listing options (prefix, recursion, extended info)
renameDirectory
function renameDirectory(string sourcePath, string destinationPath, RenameOptions? options) returns Error?Renames or moves a directory within the bound share, together with its entire contents.
Parameters
- sourcePath string - The current share-relative path of the directory
- destinationPath string - The new share-relative path
- options RenameOptions? (default ()) - Optional rename options (overwrite, permission, metadata)
Return Type
- Error? - An
Errorif the directory could not be renamed, otherwise()
createFile
function createFile(string path, int sizeInBytes, CreateOptions? options) returns Error?Creates an empty file of a fixed size.
Parameters
- path string - The share-relative path of the file to create
- sizeInBytes int - The size of the file, in bytes
- options CreateOptions? (default ()) - Optional creation options (headers, metadata, permission, SMB properties)
Return Type
- Error? - An
Errorif the file could not be created, otherwise()
deleteFile
Deletes a file from the bound share.
Parameters
- path string - The share-relative path of the file to delete
Return Type
- Error? - An
Errorif the file could not be deleted, otherwise()
hasFile
Checks whether a file exists in the bound share. Returns false only when Azure
confirms the file is absent; an Error means the check itself failed.
Parameters
- path string - The share-relative path of the file
getFileProperties
function getFileProperties(string path) returns FileProperties|ErrorGets the properties of a file.
Parameters
- path string - The share-relative path of the file
Return Type
- FileProperties|Error - The
FileProperties, or anError
setFileMetadata
Replaces the metadata of a file.
Parameters
- path string - The share-relative path of the file
Return Type
- Error? - An
Errorif the metadata could not be set, otherwise()
setContentHeaders
function setContentHeaders(string path, ContentHeaders headers) returns Error?Sets the content headers of a file, such as Content-Type and Cache-Control.
Any header omitted from headers is cleared on the file.
Parameters
- path string - The share-relative path of the file
- headers ContentHeaders - The full set of content headers the file should carry
Return Type
- Error? - An
Errorif the headers could not be set, otherwise()
renameFile
function renameFile(string sourcePath, string destinationPath, RenameOptions? options) returns Error?Renames or moves a file within the bound share. An existing destination file is
overwritten only when RenameOptions.replaceIfExists is set.
Parameters
- sourcePath string - The current share-relative path of the file
- destinationPath string - The new share-relative path
- options RenameOptions? (default ()) - Optional rename options (overwrite, permission, metadata)
Return Type
- Error? - An
Errorif the file could not be renamed, otherwise()
uploadFile
function uploadFile(string sourcePath, string destinationPath, UploadOptions? options) returns Error?Uploads a local file to the bound share.
// ./reports/q1.pdf (local disk) --> /2026/q1/report.pdf (on the share) check fileClient->uploadFile("./reports/q1.pdf", "/2026/q1/report.pdf");
Parameters
- sourcePath string - The path of the local file to upload, including the file name
- destinationPath string - The share-relative path the file is written to, including the file name
- options UploadOptions? (default ()) - Optional upload options (headers, metadata, permission, SMB properties)
Return Type
- Error? - An
Errorif the upload failed, otherwise()
uploadContent
function uploadContent(byte[]|string|xml|map<json>|string[][] content, string destinationPath, UploadOptions? options) returns Error?Uploads in-memory content to the bound share. A byte[] is written as-is, a string
as raw text, an xml value as its textual form, a map<json> as a JSON document, and
a string[][] as CSV rows.
check fileClient->uploadContent({revenue: 1250000, growth: 0.12}, "/2026/q1/metrics.json");
Parameters
- destinationPath string - The share-relative path the content is written to, including the file name
- options UploadOptions? (default ()) - Optional upload options (headers, metadata, permission, SMB properties)
Return Type
- Error? - An
Errorif the upload failed, otherwise()
uploadFromStream
function uploadFromStream(stream<byte[], error?> content, int contentLength, string destinationPath, UploadOptions? options) returns Error?Uploads a byte stream to the bound share. The total content length must be known up front.
Parameters
- contentLength int - The total length of the content, in bytes
- destinationPath string - The share-relative path the content is written to, including the file name
- options UploadOptions? (default ()) - Optional upload options (headers, metadata, permission, SMB properties)
Return Type
- Error? - An
Errorif the upload failed, otherwise()
downloadFile
function downloadFile(string sourcePath, string destinationPath, DownloadOptions? options) returns Error?Downloads a file to a local path. An existing local file at destinationPath fails
the download.
// /2026/q1/report.pdf (on the share) --> ./reports/q1.pdf (local disk) check fileClient->downloadFile("/2026/q1/report.pdf", "./reports/q1.pdf");
Parameters
- sourcePath string - The share-relative path of the file to download, including the file name
- destinationPath string - The local path to write the downloaded file to (must not exist)
- options DownloadOptions? (default ()) - Optional download options (range)
Return Type
- Error? - An
Errorif the download failed, otherwise()
getFileContent
function getFileContent(string path, DownloadOptions? options) returns stream<byte[], Error?>|ErrorOpens a file's content as a byte stream.
stream<byte[], files:Error?> contentStream = check fileClient->getFileContent("/2026/q1/data.json"); byte[] content = []; check contentStream.forEach(function(byte[] chunk) { content.push(...chunk); });
Parameters
- path string - The source share-relative path
- options DownloadOptions? (default ()) - Optional download options (range)
getFileText
function getFileText(string path, DownloadOptions? options) returns string|ErrorReads a file's full content as UTF-8 text.
Parameters
- path string - The source share-relative path
- options DownloadOptions? (default ()) - Optional download options (range, snapshot)
getFileJson
function getFileJson(string path, DownloadOptions? options, typedesc<json|record {}> targetType) returns targetType|ErrorReads a file's full content and binds it as JSON to the target type. Binding is strict: the content must match the target type exactly.
Parameters
- path string - The source share-relative path
- options DownloadOptions? (default ()) - Optional download options (range, snapshot)
- targetType typedesc<json|record {}> (default <>) - The type to bind the content to, a
jsonform or a record
Return Type
- targetType|Error - The bound value, or an
Error
getFileXml
function getFileXml(string path, DownloadOptions? options, typedesc<xml|record {}> targetType) returns targetType|ErrorReads a file's full content and binds it as XML: to an xml value, or to a record
projected from the document. Binding is strict.
Parameters
- path string - The source share-relative path
- options DownloadOptions? (default ()) - Optional download options (range, snapshot)
- targetType typedesc<xml|record {}> (default <>) - The type to bind the content to,
xmlor a record
Return Type
- targetType|Error - The bound value, or an
Error
getFileCsv
function getFileCsv(string path, DownloadOptions? options, typedesc<string[][]|record {}[]> targetType) returns targetType|ErrorReads a file's full content and binds it as CSV: to string[][] rows, or to a record
array whose field names are taken from the header row. Binding is strict.
Parameters
- path string - The source share-relative path
- options DownloadOptions? (default ()) - Optional download options (range, snapshot)
- targetType typedesc<string[][]|record {}[]> (default <>) - The type to bind the content to,
string[][]or a record array
Return Type
- targetType|Error - The bound value, or an
Error
copyFile
function copyFile(string sourcePath, string destinationPath, CopyOptions? options) returns CopyInfo|ErrorCopies a file within the bound share. The copy is asynchronous; inspect the returned
CopyInfo.copyStatus for its state.
Parameters
- sourcePath string - The source share-relative path
- destinationPath string - The destination share-relative path
- options CopyOptions? (default ()) - Optional copy options (metadata, permission handling)
copyFileFromUrl
function copyFileFromUrl(string sourceUrl, string destinationPath, CopyOptions? options) returns CopyInfo|ErrorCopies a file from an external URL into the bound share. A source outside this storage account must carry its own authorization in the URL (typically a SAS token).
Parameters
- sourceUrl string - The URL of the source file
- destinationPath string - The destination share-relative path
- options CopyOptions? (default ()) - Optional copy options (metadata, permission handling)
checkCopyStatus
function checkCopyStatus(string path) returns CopyStatusInfo?|ErrorChecks the state of the most recent copy operation that targeted a file.
Parameters
- path string - The destination share-relative path of the copy
Return Type
- CopyStatusInfo?|Error - The
CopyStatusInfo,()if the file has never been the destination of a copy operation, or anError
abortCopy
Aborts a pending asynchronous copy operation.
Parameters
- path string - The destination share-relative path of the copy
- copyId string - The identifier of the copy to abort (from
CopyInfo.copyId)
Return Type
- Error? - An
Errorif the copy could not be aborted, otherwise()
uploadRange
Writes a range of bytes into a file at a given offset. A single range write is capped at 4 MiB by the service.
Parameters
- path string - The share-relative path of the file
- offset int - The zero-based byte offset at which to begin writing
- content byte[] - The bytes to write (at most 4 MiB)
Return Type
- Error? - An
Errorif the range could not be written, otherwise()
clearRange
Clears a range of bytes in a file.
Parameters
- path string - The share-relative path of the file
- offset int - The zero-based byte offset at which to begin clearing
- length int - The number of bytes to clear
Return Type
- Error? - An
Errorif the range could not be cleared, otherwise()
listRanges
function listRanges(string path, RangeListOptions? options) returns Range[]|ErrorLists the valid (written) byte ranges of a file.
Parameters
- path string - The share-relative path of the file
- options RangeListOptions? (default ()) - Optional range-listing options
createShareSnapshot
function createShareSnapshot(map<string>? metadata) returns ShareSnapshotInfo|ErrorCreates a point-in-time, read-only snapshot of the bound share.
Parameters
Return Type
- ShareSnapshotInfo|Error - The
ShareSnapshotInfofor the new snapshot, or anError
listShareSnapshots
function listShareSnapshots() returns ShareSnapshotInfo[]|ErrorLists the snapshots of the bound share. Requires account-level credentials.
Return Type
- ShareSnapshotInfo[]|Error - The share's snapshots, or an
Error
deleteShareSnapshot
Deletes one snapshot of the bound share. Requires account-level credentials.
Parameters
- snapshotId string - The identifier of the snapshot to delete
Return Type
- Error? - An
Errorif the snapshot could not be deleted, otherwise()
listRangesDiff
function listRangesDiff(string path, string previousSnapshotId, RangeListOptions? options) returns RangeDiff|ErrorLists how a file's byte ranges changed since a share snapshot.
Parameters
- path string - The share-relative path of the file
- previousSnapshotId string - The identifier of the baseline snapshot to diff against
- options RangeListOptions? (default ()) - Optional range-listing options
acquireShareLease
Acquires a lease on the bound share, locking it against deletion by anyone not holding the lease id.
Parameters
- leaseDurationSeconds int - The lease duration: 15 to 60 seconds, or -1 for an infinite lease
- proposedLeaseId string? (default ()) - A proposed lease id (a UUID string); when absent, the service generates one
renewShareLease
Renews a fixed-duration lease on the bound share, restarting its duration.
Parameters
- leaseId string - The id of the lease to renew
Return Type
- Error? - An
Errorif the lease could not be renewed, otherwise()
releaseShareLease
Releases a lease on the bound share, unlocking it immediately.
Parameters
- leaseId string - The id of the lease to release
Return Type
- Error? - An
Errorif the lease could not be released, otherwise()
breakShareLease
Breaks the lease on the bound share without needing its id.
Parameters
- breakPeriodSeconds int? (default ()) - How long the lease keeps running before it is broken; when absent, the lease's own remaining time applies (0 for infinite)
changeShareLease
Changes the id of the active lease on the bound share.
Parameters
- leaseId string - The current lease id
- proposedLeaseId string - The new lease id (a UUID string)
acquireLease
Acquires a lease on a file, locking it against writes and deletion by anyone not holding the lease id. A file lease is always infinite.
Parameters
- path string - The share-relative path of the file
- proposedLeaseId string? (default ()) - A proposed lease id (a UUID string); when absent, the service generates one
releaseLease
Releases a lease on a file, unlocking it immediately.
Parameters
- path string - The share-relative path of the file
- leaseId string - The id of the lease to release
Return Type
- Error? - An
Errorif the lease could not be released, otherwise()
breakLease
Breaks the lease on a file without needing its id. The break is immediate.
Parameters
- path string - The share-relative path of the file
Return Type
- Error? - An
Errorif the lease could not be broken, otherwise()
changeLease
Changes the id of the active lease on a file.
Parameters
- path string - The share-relative path of the file
- leaseId string - The current lease id
- proposedLeaseId string - The new lease id (a UUID string)
listFileHandles
function listFileHandles(string path) returns HandleInfo[]|ErrorLists the open SMB handles on a file.
Parameters
- path string - The share-relative path of the file
Return Type
- HandleInfo[]|Error - The open handles, or an
Error
forceCloseFileHandles
function forceCloseFileHandles(string path, string? handleId) returns CloseHandlesInfo|ErrorForce-closes open SMB handles on a file.
Parameters
- path string - The share-relative path of the file
- handleId string? (default ()) - The id of one handle to close (from
listFileHandles); when absent, all handles on the file are closed
Return Type
- CloseHandlesInfo|Error - The
CloseHandlesInfo(closed and failed counts), or anError
listDirectoryHandles
function listDirectoryHandles(string directoryPath) returns HandleInfo[]|ErrorLists the open SMB handles on a directory.
Parameters
- directoryPath string - The share-relative path of the directory
Return Type
- HandleInfo[]|Error - The open handles, or an
Error
forceCloseDirectoryHandles
function forceCloseDirectoryHandles(string directoryPath, string? handleId, boolean recursive) returns CloseHandlesInfo|ErrorForce-closes open SMB handles on a directory.
Parameters
- directoryPath string - The share-relative path of the directory
- handleId string? (default ()) - The id of one handle to close (from
listDirectoryHandles); when absent, all handles on the directory are closed
- recursive boolean (default false) - Also close handles on the directory's files and subdirectories
Return Type
- CloseHandlesInfo|Error - The
CloseHandlesInfo(closed and failed counts), or anError
setShareProperties
function setShareProperties(ShareSetPropertiesOptions options) returns Error?Changes the bound share's quota or access tier. Requires account key credentials.
Parameters
- options ShareSetPropertiesOptions - The properties to change; only what is set is changed
Return Type
- Error? - An
Errorif the properties could not be changed, otherwise()
setFileProperties
function setFileProperties(string path, FileSetPropertiesOptions options) returns Error?Updates a file's properties after creation. Only what is set is changed.
Parameters
- path string - The share-relative path of the file
- options FileSetPropertiesOptions - The properties to change
Return Type
- Error? - An
Errorif the properties could not be changed, otherwise()
setDirectoryProperties
function setDirectoryProperties(string directoryPath, DirectorySetPropertiesOptions options) returns Error?Updates a directory's properties after creation. Only what is set is changed.
Parameters
- directoryPath string - The share-relative path of the directory
- options DirectorySetPropertiesOptions - The properties to change
Return Type
- Error? - An
Errorif the properties could not be changed, otherwise()
getShareAccessPolicy
function getShareAccessPolicy() returns SignedIdentifier[]|ErrorGets the bound share's stored access policies.
Return Type
- SignedIdentifier[]|Error - The share's stored access policies, or an
Error
setShareAccessPolicy
function setShareAccessPolicy(SignedIdentifier[] identifiers) returns Error?Replaces the bound share's stored access policies. Removing or editing a policy immediately affects every SAS token minted against it.
Parameters
- identifiers SignedIdentifier[] - The complete set of policies the share should carry
Return Type
- Error? - An
Errorif the policies could not be set, otherwise()
getSharePermission
Gets a security descriptor (SDDL string) from the bound share's permission store.
Parameters
- permissionKey string - The key of the stored permission
createSharePermission
Stores a security descriptor (SDDL string) in the bound share's permission store and returns its key.
Parameters
- sddlPermission string - The SDDL (Security Descriptor Definition Language) string to store
createHardLink
Creates a hard link to an existing file (NFS shares only).
Parameters
- path string - The share-relative path of the new link
- targetPath string - The share-relative path of the existing file to link to
Return Type
- Error? - An
Errorif the link could not be created, otherwise()
createSymbolicLink
Creates a symbolic link (NFS shares only). The target need not exist.
Parameters
- path string - The share-relative path of the new link
- linkTarget string - The path the link points to
Return Type
- Error? - An
Errorif the link could not be created, otherwise()
getSymbolicLink
Reads the target of a symbolic link (NFS shares only).
Parameters
- path string - The share-relative path of the link
generateShareSas
function generateShareSas(ShareSasSignatureValues values) returns string|ErrorGenerates a SAS (Shared Access Signature) token scoped to the bound share. Requires shared key credentials.
Parameters
- values ShareSasSignatureValues - What the SAS grants: validity window and permissions, or a stored policy reference
generateSas
function generateSas(string path, FileSasSignatureValues values) returns string|ErrorGenerates a SAS (Shared Access Signature) token scoped to a single file. Requires shared key credentials.
Parameters
- path string - The share-relative path of the file the SAS grants access to
- values FileSasSignatureValues - What the SAS grants: validity window and permissions, or a stored policy reference
generateShareUserDelegationSas
function generateShareUserDelegationSas(ShareSasSignatureValues values, UserDelegationKey key) returns string|ErrorGenerates a user-delegation SAS token scoped to the bound share.
Parameters
- values ShareSasSignatureValues - What the SAS grants: validity window and permissions
- key UserDelegationKey - The user-delegation key to sign with
generateUserDelegationSas
function generateUserDelegationSas(string path, FileSasSignatureValues values, UserDelegationKey key) returns string|ErrorGenerates a user-delegation SAS token scoped to a single file.
Parameters
- path string - The share-relative path of the file the SAS grants access to
- values FileSasSignatureValues - What the SAS grants: validity window and permissions
- key UserDelegationKey - The user-delegation key to sign with
Service types
azure.storage.files: Service
The service type attached to a Listener.
Constants
azure.storage.files: DEFAULT_AZURE_CREDENTIAL
The credential-kind discriminator value selecting DefaultEntraIdConfig.
azure.storage.files: DELETE
The auto-consume action that deletes the file after the handler runs.
azure.storage.files: MANAGED_IDENTITY
The credential-kind discriminator value selecting ManagedIdentityConfig.
Enums
azure.storage.files: CopyStatus
The status of an asynchronous copy operation.
Members
azure.storage.files: ErrorLogContentType
The content of a fail safe CSV error log entry.
Members
azure.storage.files: LeaseDuration
The duration category of a lease.
Members
azure.storage.files: LeaseState
The lifecycle state of a share's or file's lease.
Members
azure.storage.files: LeaseStatus
Whether a lease currently locks the share or file: LOCKED while a lease is in force,
UNLOCKED otherwise.
Members
azure.storage.files: NfsFileType
The type of an NFS file-system entry: a regular file (Regular), a directory
(Directory), or a symbolic link (SymLink).
Members
azure.storage.files: NfsRootSquash
The NFS root-squash behaviour applied to a share.
Members
azure.storage.files: NtfsFileAttribute
An NTFS attribute of a file or directory. A file or directory can carry several attributes
at once, as an NtfsFileAttribute[].
Members
azure.storage.files: PermissionCopyMode
How file permissions are handled when copying a file.
Members
azure.storage.files: ProxyType
The proxy protocol kinds.
Members
azure.storage.files: RetryPolicyType
The retry policy kinds: EXPONENTIAL grows the delay between tries exponentially;
FIXED keeps the same delay between every try.
Members
azure.storage.files: SasProtocol
The protocols a request presenting a SAS token may use.
Members
azure.storage.files: ShareAccessTier
The billing and performance tier of a file share.
Members
azure.storage.files: ShareProtocol
The file-access protocol(s) enabled on a share.
Members
azure.storage.files: ShareSnapshotsDeleteOption
How a share's snapshots are handled when the share is deleted.
Members
Listeners
azure.storage.files: Listener
A polling watcher for a single Azure Files share path.
Constructor
Initializes the listener for a share.
init (string shareName, *ListenerConfiguration config)- shareName string - The name of the share to watch
- config *ListenerConfiguration - The listener configuration (authentication, polling cadence, retry, transport)
attach
Attaches a service to the listener. One service attaches per listener; a second attach fails.
Parameters
- serviceRef Service - The service to attach
Return Type
- error? - An
errorif the service could not be attached, otherwise()
detach
Detaches a service from the listener.
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 and dispatching to the attached service.
Return Type
- error? - An
errorif the listener could not start, otherwise()
gracefulStop
function gracefulStop() returns error?Stops polling. In-flight handler invocations run to completion.
Return Type
- error? - An
errorif the listener could not stop, otherwise()
immediateStop
function immediateStop() returns error?Stops polling immediately. In-flight handler invocations run to completion.
Return Type
- error? - An
errorif the listener could not stop, otherwise()
Annotations
azure.storage.files: FunctionConfig
Declares the configuration of a listener handler.
azure.storage.files: ServiceConfig
Declares the optional filters of a listener service.
Records
azure.storage.files: AccessPolicy
A stored access policy's validity window and permissions.
Fields
- startsOn? Utc - The start of the policy's validity period (UTC); omit for immediately valid
- expiresOn? Utc - The end of the policy's validity period (UTC); omit for no expiry
- permissions string - The permission string, in the service's fixed letter order (e.g.
rwdlfor read, write, delete, list)
azure.storage.files: 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, and list entries
- write boolean(default false) - Write content, properties, and metadata
- delete boolean(default false) - Delete resources
- list boolean(default false) - List shares and directory contents
- add boolean(default false) - Add content (append-style operations of other storage services)
- create boolean(default false) - Create new resources
- update boolean(default false) - Update stored entities (of other storage services)
- process boolean(default false) - Process stored messages (of other storage services)
azure.storage.files: AccountSasResourceTypes
The resource types an account-level SAS applies to. Every type is off unless enabled.
Fields
- 'service boolean(default false) - Service-level operations (e.g. list shares, service properties)
- container boolean(default false) - Container-level operations (the share level: share properties, metadata)
- 'object boolean(default false) - Object-level operations (files and directories)
azure.storage.files: AccountSasSignatureValues
The inputs for generating an account-level SAS via AdminClient.generateAccountSas.
Fields
- expiryTime Utc - The end of the SAS validity period (UTC)
- permissions AccountSasPermissions - The permissions the SAS grants
- resourceTypes AccountSasResourceTypes - The resource types the SAS applies to
- startTime? Utc - The start of the SAS validity period (UTC); omit for immediately valid
- protocol? SasProtocol - The protocols a request presenting the SAS may use; omit to allow HTTPS and HTTP
- ipRange? string - An IP address or range the requests must come from (e.g.
168.1.5.60-168.1.5.70)
azure.storage.files: CertKey
A client certificate and private key pair, as files.
Fields
- certFile string - The path to the certificate file
- keyFile string - The path to the private key file
- keyPassword? string - The password protecting the private key, when it has one
azure.storage.files: 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 (directory) id
- clientId string - The application (client) id of the service principal
- certificatePath string - The path to the certificate file (PEM, or PFX when
certificatePasswordis set)
- certificatePassword? string - The password protecting the certificate file, when it has one
- serviceUrl? string - The file service endpoint URL, including the scheme. Omit to use the default
https://{accountName}.file.core.windows.net
azure.storage.files: ClientConfiguration
Configuration for an azure.storage.files client (Client or AdminClient).
Fields
- auth AuthConfig - The authentication configuration (see
AuthConfig)
- retryConfig? RetryConfig - Retry behaviour for service requests; omit for the service defaults
- transportConfig? TransportConfig - HTTP transport settings (proxy, connection pool, TLS); omit for the defaults
azure.storage.files: 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 (directory) id
- clientId string - The application (client) id of the service principal
- clientSecret string - The client secret of the service principal
- serviceUrl? string - The file service endpoint URL, including the scheme. Omit to use the default
https://{accountName}.file.core.windows.net
azure.storage.files: CloseHandlesInfo
The result of force-closing SMB handles.
Fields
- closedHandles int - The number of handles that were closed
- failedHandles int - The number of handles that could not be closed
azure.storage.files: ConnectionPoolConfig
Tunes the connector's HTTP connection pool.
Fields
- maxConnections int(default 50) - The maximum number of concurrent connections
- idleTimeoutSeconds decimal(default 60) - How long an idle connection is kept before being closed, in seconds
- connectTimeoutSeconds decimal(default 10) - The timeout for establishing a connection, in seconds
- readTimeoutSeconds decimal(default 60) - The timeout for reading a response, in seconds
azure.storage.files: 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.files: ContentHeaders
The standard content headers that can be set on a file.
Fields
- contentType? string - The MIME type of the content (e.g.
application/pdf), served asContent-Typeon downloads
- contentEncoding? string - Any encoding applied to the stored content (e.g.
gzip)
- contentLanguage? string - The natural language of the content (e.g.
en-US)
- contentDisposition? string - How receivers should present the content (e.g.
attachmentorinline)
- cacheControl? string - Caching directives served with the file (e.g.
max-age=3600, private)
- contentMd5? string - Base64-encoded MD5 of the content, for integrity verification
azure.storage.files: CopyInfo
The result of starting a copy operation. Copies are asynchronous.
Fields
- copyId string - The copy operation identifier; pass to
Client.abortCopyto cancel a pending copy
- copyStatus CopyStatus - The copy status at the moment the copy started,
PENDINGwhile the copy is still in progress
- eTag string - The entity tag of the destination after the copy started
- lastModified Utc - The last-modified time of the destination (UTC)
azure.storage.files: CopyOptions
Options for Client.copyFile and Client.copyFileFromUrl.
Fields
- filePermission? string - An SDDL permission string to apply to the destination; setting it requires
permissionCopyModeto beOVERRIDE
- smbProperties? SmbProperties - SMB properties to apply to the destination
- permissionCopyMode? PermissionCopyMode - How the destination file's permission is determined; when absent, the security
descriptor is copied from the source file (
SOURCEbehaviour)
- ignoreReadOnly boolean(default false) - Copy even if the destination has the read-only attribute set; when
false, a read-only file at the destination fails the copy
azure.storage.files: CopyProgress
Progress of an asynchronous copy operation.
Fields
- copiedBytes int - The number of bytes copied so far
- totalBytes int - The total number of bytes to be copied
azure.storage.files: CopyStatusInfo
The state of the most recent copy operation that targeted a file, as returned by
Client.checkCopyStatus. A point-in-time snapshot; call checkCopyStatus again to
observe the progress of a pending copy.
Fields
- copyId string - The identifier of the copy operation; pass to
Client.abortCopyto cancel a pending copy
- copyStatus CopyStatus - The status of the copy
- copyProgress? CopyProgress - Progress of the copy (bytes copied so far out of the total)
azure.storage.files: CorsRule
One CORS (Cross-Origin Resource Sharing) rule of the file service. The string fields are
comma-separated lists; * allows all.
Fields
- allowedOrigins string - The origin domains allowed to make requests
- allowedMethods string - The HTTP methods an allowed origin may use
- allowedHeaders string - The request headers an allowed origin may send
- exposedHeaders string - The response headers exposed to the browser
- maxAgeInSeconds int - How long, in seconds, a browser may cache the preflight response
azure.storage.files: CreateOptions
Options for Client.createFile (creating an empty file of a given size).
Fields
- contentHeaders? ContentHeaders - Content headers to set on the file, such as
Content-TypeandCache-Control
- filePermission? string - An SDDL permission string to apply
- smbProperties? SmbProperties - SMB properties to apply
- posixProperties? PosixProperties - POSIX owner, group, and mode to apply (NFS shares only)
azure.storage.files: DefaultEntraIdConfig
Microsoft Entra ID authentication through the default credential chain. The chain tries the environment, a managed identity, and developer sign-ins (Azure CLI, IDE accounts) in turn, so one configuration works both locally and when deployed.
Fields
- kind DEFAULT_AZURE_CREDENTIAL - Selects the default credential chain
- accountName string - The storage account name (determines the service URL unless
serviceUrloverrides it)
- serviceUrl? string - The file service endpoint URL, including the scheme. Omit to use the default
https://{accountName}.file.core.windows.net
azure.storage.files: DirectoryCreateOptions
Options for Client.createDirectory.
Fields
- filePermission? string - An SDDL (Security Descriptor Definition Language) permission string to apply
- smbProperties? SmbProperties - SMB properties to apply
- posixProperties? PosixProperties - POSIX owner, group, and mode to apply (NFS shares only)
azure.storage.files: DirectoryProperties
Properties of a directory. A point-in-time snapshot; call getDirectoryProperties again
for current state.
Fields
- eTag string - The entity tag for optimistic concurrency
- lastModified Utc - The last-modified time (UTC)
- isServerEncrypted boolean - Whether the service has encrypted the directory at rest
- smbProperties? SmbProperties - SMB-specific properties; populated on SMB shares, absent on NFS shares
- posixProperties? PosixProperties - POSIX/NFS-specific properties (NFS shares only)
azure.storage.files: DirectorySetPropertiesOptions
Options for Client.setDirectoryProperties. Only what is set is changed.
Fields
- smbProperties? SmbProperties - SMB properties to apply
- filePermission? string - An SDDL (Security Descriptor Definition Language) permission string to apply
- posixProperties? PosixProperties - POSIX owner, group, and mode to apply (NFS shares only)
azure.storage.files: DownloadOptions
Options for the download operations (downloadFile, getFileContent).
Fields
- range? Range - Download only this byte range instead of the whole file
- snapshotId? string - Read from the share snapshot with this id instead of the live share
azure.storage.files: Entry
One entry returned by Client.list.
Fields
- path string - The share-relative path of the entry, e.g.
/dir1/dir2/file.ext
- name string - The entry name (file or directory), without the directory component
- isDirectory boolean -
trueif the entry is a directory,falseif it is a file
- sizeBytes? int - The file size in bytes; not present for directories
- id string - The entry identifier
- eTag? string - The entity tag; present only when the listing requests extended info
(
ListOptions.includeExtendedInfo)
- lastModified? Utc - The last-modified time (UTC); present only when the listing requests extended info
(
ListOptions.includeExtendedInfo)
azure.storage.files: ErrorDetail
Structured detail carried by every connector error.
Fields
- httpStatus? int - The HTTP status code returned by Azure. Absent when the failure happened without a
server exchange (e.g. a
ProcessingErrorraised client-side).
- errorCode string - The Azure error code (e.g.
ShareNotFound), or a connector-defined identifier for client-side failures
azure.storage.files: FailSafeOptions
Configuration for fail safe CSV content processing.
Fields
- contentType ErrorLogContentType(default METADATA) - What each skipped CSV record's error log entry carries
azure.storage.files: FileInfo
The listing-derived payload delivered to a listener service's handlers, identifying the file
an event is about. It carries what a directory listing provides; for full properties
(content type, metadata, headers), construct a Client and call getFileProperties.
Fields
- shareName string - The name of the share the file lives on
- path string - The share-relative path of the file, e.g.
/dir1/dir2/file.ext
- name string - The file name only, without the directory component
- sizeBytes int - The file size in bytes
- eTag string - The entity tag of the file
- lastModified Utc - The last-modified time (UTC)
azure.storage.files: FileProperties
Properties of a file. A point-in-time snapshot; call getFileProperties again for
current state.
Fields
- eTag string - The entity tag for optimistic concurrency
- lastModified Utc - The last-modified time (UTC)
- contentLength int - The size of the file in bytes
- contentType string(default "application/octet-stream") - The MIME type of the content (e.g.
application/pdf), served asContent-Typeon downloads.application/octet-streamwhen no content type was ever set
- contentEncoding? string - The encoding applied to the stored content (e.g.
gzip)
- contentDisposition? string - How receivers should present the content (e.g.
attachmentorinline)
- cacheControl? string - Caching directives served with the file (e.g.
max-age=3600, private)
- contentMd5? string - Base64-encoded MD5 of the content, for integrity verification
- isServerEncrypted boolean - Whether the service has encrypted the file at rest (server-side encryption, covering the file data and its metadata)
- leaseState? LeaseState - Where the lease stands in its lifecycle; present only while a lease exists
- leaseStatus? LeaseStatus -
LOCKEDwhile a lease is in force,UNLOCKEDotherwise; present only while a lease exists
- leaseDuration? LeaseDuration - Whether the active lease is infinite or fixed-duration; present only while a lease exists
- copyStatus? CopyStatus - The status of the most recent copy operation, if any
- copyId? string - The identifier of the most recent copy operation, if any
- copyProgress? CopyProgress - Progress of the most recent copy operation, if any
- smbProperties? SmbProperties - SMB-specific properties
- posixProperties? PosixProperties - POSIX/NFS-specific properties (NFS shares only)
azure.storage.files: FileSasPermissions
The permissions granted by a file-scoped SAS. Every permission is off unless enabled.
Fields
- read boolean(default false) - Read the file's content, properties, and metadata
- create boolean(default false) - Create the file
- write boolean(default false) - Write the file's content, properties, and metadata
- delete boolean(default false) - Delete the file
azure.storage.files: FileSasSignatureValues
The inputs for generating a file-scoped SAS via Client.generateSas or
Client.generateUserDelegationSas.
Fields
- expiryTime Utc - The end of the SAS validity period (UTC). May be omitted only when
identifierreferences a stored access policy that carries an expiry
- permissions FileSasPermissions - The permissions the SAS grants
- startTime? Utc - The start of the SAS validity period (UTC); omit for immediately valid
- protocol? SasProtocol - The protocols a request presenting the SAS may use; omit to allow HTTPS and HTTP
- ipRange? string - An IP address or range the requests must come from (e.g.
168.1.5.60-168.1.5.70)
- identifier? string - The identifier of a stored access policy on the share, as an alternative to spelling out expiry and permissions here
azure.storage.files: FileSetPropertiesOptions
Options for Client.setFileProperties. Only what is set is changed; every omitted field
leaves the file's current value in place.
Fields
- contentHeaders? ContentHeaders - Content headers to set on the file
- smbProperties? SmbProperties - SMB properties to apply
- filePermission? string - An SDDL (Security Descriptor Definition Language) permission string to apply
- newFileSizeBytes? int - A new size for the file, in bytes
- posixProperties? PosixProperties - POSIX owner, group, and mode to apply (NFS shares only)
azure.storage.files: FunctionConfiguration
The per-handler configuration, supplied through the @files:FunctionConfig annotation. It
routes files to a handler by name pattern and auto-consumes a file after the handler runs.
Fields
- fileNamePattern? string - A regular expression matched against the file name that routes matching files to this handler
azure.storage.files: HandleInfo
One open SMB handle on a file or directory.
Fields
- handleId string - The handle identifier; pass to the force-close operations to close just this handle
- path string - The share-relative path the handle is open on
- fileId? string - The identifier of the file or directory the handle is open on
- sessionId? string - The SMB session identifier the handle belongs to
- clientIp? string - The IP address of the client holding the handle
- openTime? Utc - When the handle was opened (UTC)
- lastReconnectTime? Utc - When the client last reconnected the handle (UTC)
azure.storage.files: ListenerConfiguration
Configuration for an azure.storage.files Listener
Fields
- auth AuthConfig - The authentication configuration (see
AuthConfig)
- pollingInterval decimal(default 60) - How often the watched path is polled, in seconds
- retryConfig? RetryConfig - Retry behaviour for service requests; omit for the service defaults
- transportConfig? TransportConfig - HTTP transport settings (proxy, connection pool, TLS); omit for the defaults
- laxDataBinding boolean(default false) - Relaxed data binding for the typed content handlers: JSON, XML, and CSV record binding treat a null value as an optional field and an absent field as a nilable field
- csvFailSafe? FailSafeOptions - Fail safe CSV processing: a malformed CSV record is skipped and appended to an error log file, instead of failing the whole binding.
azure.storage.files: ListOptions
Options for Client.list.
Fields
- prefix? string - Return only entries whose name begins with this prefix
- recursive boolean(default false) - List entries in subdirectories as well
- pageSize int(default 5000) - The number of entries fetched per service round-trip, up to the service maximum of 5,000. Does not cap the total number of results
- includeExtendedInfo boolean(default false) - Include the ETag and timestamps on each entry
- snapshotId? string - List from the share snapshot with this id instead of the live share
azure.storage.files: ManagedIdentityConfig
Microsoft Entra ID authentication as an Azure managed identity, for workloads running on Azure compute (VMs, App Service, AKS, Functions).
Fields
- kind MANAGED_IDENTITY - Selects the managed-identity credential
- 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 identity
- serviceUrl? string - The file service endpoint URL, including the scheme. Omit to use the default
https://{accountName}.file.core.windows.net
azure.storage.files: Metrics
A metrics-collection setting of the file service.
Fields
- enabled boolean - Whether metrics are collected
- version? string - The storage-analytics version the setting applies to
- includeApis? boolean - Whether metrics cover called API operations as well as storage capacity
- retentionDays? int - How many days collected metrics are retained
azure.storage.files: Move
The auto-consume action that moves the file after the handler runs.
Fields
- moveTo string - The target directory the file is moved into (the file keeps its name); the directory is created if it does not exist
- preserveSubDirs boolean(default true) - Recreate the file's sub-path (relative to the watched path) under
moveTo, on recursive watches
azure.storage.files: PosixProperties
POSIX/NFS-specific properties of a file or directory. Present only on NFS shares.
Fields
- owner? string - The owner user id (UID)
- group? string - The owning group id (GID)
- fileMode? string - The file mode (permissions), octal or symbolic
- fileType? NfsFileType - The NFS file type (regular file, directory, or symbolic link)
- linkCount? int - The number of hard links to the file (number of references to the file)
azure.storage.files: ProtocolSettings
Protocol-level settings of the file service.
Fields
- smbMultichannelEnabled? boolean - Whether SMB multichannel (multiple parallel network channels per SMB session) is enabled for the account
azure.storage.files: ProxyConfig
Routes the connector's traffic through a proxy server.
Fields
- proxyType ProxyType - The proxy protocol
- host string - The proxy host name or IP 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[](default []) - Hosts reached directly, bypassing the proxy
azure.storage.files: Range
A single byte range within a file. Both bounds are inclusive (a range starting at offset
o with length l is startByte = o, endByte = o + l - 1).
Fields
- startByte int - The zero-based inclusive start offset
- endByte int - The zero-based inclusive end offset
azure.storage.files: RangeDiff
The result of Client.listRangesDiff: how a file's ranges changed since a share snapshot.
Fields
- ranges Range[] - The ranges written since the baseline snapshot
- clearRanges Range[] - The ranges cleared since the baseline snapshot
azure.storage.files: RangeListOptions
Options for Client.listRanges and Client.listRangesDiff.
Fields
- range? Range - Restrict the listing to this byte range
azure.storage.files: RenameOptions
Options for Client.renameFile and Client.renameDirectory.
Fields
- replaceIfExists boolean(default false) - If a file already occupies the destination path, delete it and give its path to the renamed entry. A directory occupying the destination always fails the operation regardless of this flag
- ignoreReadOnly boolean(default false) - Rename even if the destination has the read-only attribute set (requires
replaceIfExists)
- filePermission? string - An SDDL permission string to apply to the renamed entry; when absent, the existing permission is preserved
azure.storage.files: RetryConfig
Retry behaviour for service requests.
Fields
- retryPolicyType RetryPolicyType(default EXPONENTIAL) - How the delay between tries grows
- maxTries int(default 4) - The maximum number of tries (the first attempt plus retries)
- tryTimeoutSeconds decimal(default 60) - The timeout applied to each individual try, in seconds
- retryDelaySeconds decimal(default 4) - The base delay between tries, in seconds
- maxRetryDelaySeconds decimal(default 120) - The upper bound on the delay between tries, in seconds
- secondaryHostUrl? string - A secondary endpoint to retry reads against (geo-redundant accounts)
azure.storage.files: SasConfig
Shared Access Signature (SAS) authentication with a bare SAS token, as issued by
az storage share 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.files: 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 file-service SAS URL, including the scheme and the SAS query string
(e.g.
https://{account}.file.core.windows.net/?sv=...&sig=...)
azure.storage.files: SecureSocket
Custom TLS settings for the connection to the service.
Fields
- cert? TrustStore|string - The trust material for verifying the server: a PKCS12 or JKS truststore, or the path to a PEM certificate file. Omit to trust the platform's default certificate authorities
- tlsVersions? string[] - The TLS versions offered during the handshake (e.g.
TLSv1.3,TLSv1.2). Omit to use the platform defaults
- ciphers? string[] - The cipher suites offered during the handshake. Omit to use the platform defaults
- verifyHostName boolean(default true) - Verify that the server certificate matches the host being called. Disabling this removes protection against man-in-the-middle attacks, so it is meant for testing only
- shareSession boolean(default true) - Allow TLS sessions to be reused across connections
- validateRevocation boolean(default false) - Check the server certificate against revocation information: a stapled OCSP response
when the server sends one, otherwise an OCSP or CRL fetch. Requires
certto be set
- serverName? string - The SNI (Server Name Indication) host name presented during the handshake; omit to use the host being called
- handshakeTimeoutSeconds? decimal - The TLS handshake timeout, in seconds
- sessionTimeoutSeconds? decimal - How long a TLS session stays reusable, in seconds
azure.storage.files: ServiceConfiguration
Optional per-service filters, supplied through the @files:ServiceConfig annotation. The
watched path itself is the service's attach point (for example service /invoices on lsn),
and a service with no attach point watches the share root.
Fields
- recursive boolean(default true) - Watch subdirectories under the watched path
- fileNamePattern? string - A regular expression matched against the file name (not the path); non-matching files are never dispatched
- minFileAgeSeconds? decimal - Skip files younger than this many seconds
azure.storage.files: ServiceProperties
The account's file-service configuration: request-metrics collection and cross-origin resource sharing rules.
Fields
- hourMetrics? Metrics - Metrics aggregated per hour
- minuteMetrics? Metrics - Metrics aggregated per minute
- cors? CorsRule[] - The CORS (Cross-Origin Resource Sharing) rules, evaluated in order; at most five
- protocol? ProtocolSettings - Protocol-level settings
azure.storage.files: ShareCreateOptions
Options for AdminClient.createShare.
Fields
- quotaInGb? int - The provisioned capacity of the share, in GiB; when absent, the account kind's default quota applies
- accessTier? ShareAccessTier - The access tier for the share; when absent, the account kind's default tier applies
(
TRANSACTION_OPTIMIZEDon pay-as-you-go accounts,PREMIUMon premium accounts)
- enabledProtocols ShareProtocol[](default [SMB]) - The protocols to enable on the share (SMB and/or NFS)
- rootSquash? NfsRootSquash - The NFS root-squash setting (NFS shares only); when absent, NFS shares default to
NO_ROOT_SQUASH
azure.storage.files: ShareDeleteOptions
Options for AdminClient.deleteShare.
Fields
- deleteSnapshots? ShareSnapshotsDeleteOption - How the share's snapshots are handled; when absent, only the share itself is deleted (the delete fails if snapshots exist)
- snapshotId? string - Delete a specific snapshot rather than the share itself
- leaseId? string - The active lease id, required when the share is leased
azure.storage.files: SharedKeyConfig
Shared Key authentication using one of the storage account's 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 file service endpoint URL, including the scheme. Omit to use the default
https://{accountName}.file.core.windows.net
azure.storage.files: ShareInfo
One share as returned by AdminClient.listShares.
Fields
- name string - The share name
- properties ShareProperties - The share's properties
- snapshotId? string - The snapshot identifier, present only for snapshot listings
- isDeleted? boolean -
truewhen this entry is a soft-deleted share (requiresincludeDeleted)
- version? string - The share version; pass to
AdminClient.undeleteShareto restore a deleted share
azure.storage.files: ShareListOptions
Options for AdminClient.listShares.
Fields
- prefix? string - Return only shares whose name begins with this prefix
- includeMetadata boolean(default false) - Include each share's metadata in the results
- includeSnapshots boolean(default false) - Include share snapshots in the results
- includeDeleted boolean(default false) - Include soft-deleted shares in the results
azure.storage.files: ShareProperties
Properties of a file share. A point-in-time snapshot; call getShareProperties again for
current state.
Fields
- quotaInGb int - The provisioned capacity of the share, in GiB
- accessTier ShareAccessTier - The share's access tier. Shares on premium (FileStorage) accounts always report
PREMIUM
- eTag string - The entity tag for optimistic concurrency
- lastModified Utc - The last-modified time (UTC)
- enabledProtocols? ShareProtocol[] - The enabled protocols (SMB and/or NFS)
- rootSquash? NfsRootSquash - The NFS root-squash setting (NFS shares only)
- leaseState? LeaseState - Where the lease stands in its lifecycle; present only while a lease exists
- leaseStatus? LeaseStatus -
LOCKEDwhile a lease is in force,UNLOCKEDotherwise; present only while a lease exists
- leaseDuration? LeaseDuration - Whether the active lease is infinite or fixed-duration; present only while a lease exists
- provisionedIops? int - Provisioned IOPS (premium shares only)
- provisionedBandwidthMibps? int - Provisioned bandwidth in MiB/s (premium shares only)
azure.storage.files: ShareSasPermissions
The permissions granted by a share-scoped SAS. Every permission is off unless enabled.
Fields
- read boolean(default false) - Read file content, properties, and metadata
- create boolean(default false) - Create files and directories
- write boolean(default false) - Write file content, properties, and metadata
- delete boolean(default false) - Delete files and directories
- list boolean(default false) - List files and directories
azure.storage.files: ShareSasSignatureValues
The inputs for generating a share-scoped SAS via Client.generateShareSas or
Client.generateShareUserDelegationSas.
Fields
- expiryTime Utc - The end of the SAS validity period (UTC). May be omitted only when
identifierreferences a stored access policy that carries an expiry
- permissions ShareSasPermissions - The permissions the SAS grants
- startTime? Utc - The start of the SAS validity period (UTC); omit for immediately valid
- protocol? SasProtocol - The protocols a request presenting the SAS may use; omit to allow HTTPS and HTTP
- ipRange? string - An IP address or range the requests must come from (e.g.
168.1.5.60-168.1.5.70)
- identifier? string - The identifier of a stored access policy on the share, as an alternative to spelling out expiry and permissions here
azure.storage.files: ShareSetPropertiesOptions
Options for Client.setShareProperties: administrative quota and tier changes.
Fields
- quotaInGb? int - The new provisioned capacity of the share, in GiB; when absent, the quota is unchanged
- accessTier? ShareAccessTier - The new access tier for the share; when absent, the tier is unchanged
- leaseId? string - The active lease id, required when the share is leased
azure.storage.files: ShareSnapshotInfo
One share snapshot, as returned by Client.createShareSnapshot and
Client.listShareSnapshots.
Fields
- snapshotId string - The snapshot identifier, an opaque UTC-timestamp-formatted string. Pass it as the
snapshotIdof the download and list options to read from the snapshot
- eTag string - The entity tag of the share at the moment of the snapshot
- lastModified Utc - The last-modified time of the share at the moment of the snapshot (UTC)
azure.storage.files: SignedIdentifier
A stored access policy with its identifier. Share SAS tokens can reference the policy
by id.
Fields
- id string - The policy identifier referenced by SAS tokens (at most 64 characters)
- accessPolicy AccessPolicy - The policy itself: validity window and permissions
azure.storage.files: SmbProperties
SMB-specific properties of a file or directory. Populated on SMB shares and absent on NFS shares.
Fields
- ntfsFileAttributes? NtfsFileAttribute[] - The NTFS attributes of the file or directory. More than one attribute can be set at a time (e.g. read-only and hidden)
- filePermissionKey? string - The key of a permission (SDDL string) stored in the share's permission store
- fileCreationTime? Utc - The creation time (UTC)
- fileLastWriteTime? Utc - The last-write time (UTC): the last time data was written to the file, excluding metadata changes
- fileChangeTime? Utc - The change time (UTC): the last time the file's content or metadata (permissions, size, attributes) was modified
- fileId? string - The file identifier
- parentId? string - The parent directory identifier
azure.storage.files: 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.files: UploadOptions
Options for the upload operations (uploadFile, uploadContent, uploadFromStream).
Fields
- contentHeaders? ContentHeaders - Content headers to set on the file, such as
Content-TypeandCache-Control
- filePermission? string - An SDDL permission string to apply
- smbProperties? SmbProperties - SMB properties to apply
- posixProperties? PosixProperties - POSIX owner, group, and mode to apply (NFS shares only)
azure.storage.files: UserDelegationKey
A key for signing user-delegation SAS tokens, obtained via
AdminClient.getUserDelegationKey.
Fields
- signedObjectId string - The object id of the Entra ID principal the key was issued to
- signedTenantId string - The Entra ID tenant the key was issued in
- signedStart Utc - The start of the key's validity period (UTC)
- signedExpiry Utc - The end of the key's validity period (UTC)
- signedService string - The service the key is valid for
- signedVersion string - The storage service version the key was issued for
- value string - The key itself, base64-encoded
azure.storage.files: 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 (directory) id
- clientId string - The application (client) id federated with the workload
- tokenFilePath string - The path to the file holding the federated service-account token
- serviceUrl? string - The file service endpoint URL, including the scheme. Omit to use the default
https://{accountName}.file.core.windows.net
Errors
azure.storage.files: AuthorizationError
Authentication or authorization failed, e.g. an invalid key or insufficient SAS permissions (HTTP 403).
azure.storage.files: ConflictError
The operation conflicts with the current state of the resource, e.g. creating a share that already exists (HTTP 409).
azure.storage.files: Error
The root error type for the connector. Every error raised by an azure.storage.files
operation is a subtype of this type and carries an ErrorDetail.
azure.storage.files: NotFoundError
The requested share, directory, or file was not found (HTTP 404).
azure.storage.files: PreconditionFailedError
A precondition such as an ETag If-Match/If-None-Match condition or a lease-id
requirement on a file operation was not met (HTTP 412).
azure.storage.files: ProcessingError
A client-side failure occurred while preparing the request or decoding the response (no server round-trip, or a failure outside Azure's control).
azure.storage.files: QuotaExceededError
The share is full: a write was rejected because the share's provisioned capacity is exhausted (HTTP 403).
azure.storage.files: RangeNotSatisfiableError
The requested byte range cannot be satisfied for the target file (HTTP 416).
Union types
azure.storage.files: EntraIdConfig
EntraIdConfig
Microsoft Entra ID authentication: one record per credential kind. The identity must hold the
Storage File Data Privileged Reader or Storage File Data Privileged Contributor role.
azure.storage.files: AuthConfig
AuthConfig
The authentication configuration: one credential-artifact record (an account key, a bare SAS token, a full SAS URL, a connection string, or a Microsoft Entra ID identity).
Import
import ballerinax/azure.storage.files;Other versions
0.9.0
Metadata
Released date: 7 days ago
Version: 0.9.0
License: Apache-2.0
Compatibility
Platform: java21
Ballerina version: 2201.12.0
GraalVM compatible: Yes
Pull count
Total: 3
Current verison: 3
Weekly downloads
Keywords
Type/Connector
Area/Storage & File Management
Cost/Paid
Vendor/Microsoft
Contributors