azure.datalake
Module azure.datalake
API
Definitions
ballerinax/azure.datalake Ballerina library
Overview
Azure Data Lake Storage is Microsoft Azure's storage for big data analytics. It adds a hierarchical namespace to Azure Blob Storage, so that data is organized in filesystems, directories and files with POSIX-style permissions and access control lists, and can be used by Hadoop, Spark and other analytics workloads.
The Azure Data Lake connector lets Ballerina programs work with Data Lake Storage through its REST API, version 2019-10-31. It covers filesystems in a storage account, and the files and directories inside them: creating, renaming, listing and deleting paths, uploading and reading file content, managing properties and access control, and leasing files for exclusive access.
Key features
- Create, list, configure and delete filesystems in a storage account
- Create, rename, list and delete files and directories in a hierarchical namespace
- Upload large files in chunks with append and flush, and read whole files or byte ranges
- Read and update path properties, owners, POSIX permissions and access control lists
- Acquire, renew, change, break and release leases for exclusive write access to a file
Setup guide
To use the Azure Data Lake connector, you need a storage account with a hierarchical namespace, permission to use its data, and an application registered in Microsoft Entra ID.
Step 1: Sign in to the Azure portal
- Go to the Azure portal.
- Sign in with an account that has an active subscription.
Step 2: Create a storage account with hierarchical namespace
- Search for Storage accounts and select Create.
- Choose a subscription, resource group, region and a globally unique account name.
- On the Advanced tab, select Enable hierarchical namespace.
- Create the account.
- Note the account's Data Lake endpoint,
https://<storage-account-name>.dfs.core.windows.net. The connector sends every request to this URL.
Step 3: Grant data-plane access
- Open the storage account's Access control (IAM) page.
- Assign one of the following roles to the user account that will sign in during Step 4:
- Storage Blob Data Contributor to read and write data
- Storage Blob Data Owner to also change owners, permissions and access control lists
Step 4: Obtain a refresh token
The connector authenticates with an OAuth 2.0 refresh token from Microsoft Entra ID and renews its access token automatically.
Note: For a walkthrough of the Microsoft Entra ID app registration with screenshots, see Register an application in Microsoft Entra ID in the Microsoft Teams connector setup guide. Add the Azure Storage permission below instead of the Microsoft Graph permissions it describes.
-
Sign in to the Microsoft Entra admin center and go to Entra ID > App registrations > New registration.
-
Enter a name, choose the supported account types, add
https://jwt.msas a Web redirect URI, and select Register. -
On the application's Overview page, note the Application (client) ID and the Directory (tenant) ID.
-
Go to Certificates & secrets > New client secret, add a secret, and copy its Value. The value is shown only once.
-
Go to API permissions > Add a permission > Azure Storage, select the delegated user_impersonation permission, and select Add permissions. Grant admin consent if your tenant requires it.
-
Open the following URL in a browser, with your tenant ID and client ID, and sign in with the user account that has the role from Step 3:
https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/authorize?client_id=<client-id>&response_type=code&redirect_uri=https%3A%2F%2Fjwt.ms&response_mode=query&scope=https%3A%2F%2Fstorage.azure.com%2Fuser_impersonation%20offline_access -
Accept the consent prompt. The browser opens
https://jwt.ms/?code=<authorization-code>. Copy thecodevalue, which is single-use and expires within minutes. -
Exchange the code for a refresh token:
curl -X POST "https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token" \ --data-urlencode "client_id=<client-id>" \ --data-urlencode "client_secret=<client-secret>" \ --data-urlencode "scope=https://storage.azure.com/user_impersonation offline_access" \ --data-urlencode "code=<authorization-code>" \ --data-urlencode "redirect_uri=https://jwt.ms" \ --data-urlencode "grant_type=authorization_code" -
Copy the
refresh_tokenvalue from the JSON response.
Quickstart
To use the Azure Data Lake connector in your Ballerina application, update the .bal file as follows:
Step 1: Import the module
Import the azure.datalake module.
import ballerinax/azure.datalake;
Step 2: Instantiate a new connector
Create a datalake:Client with the storage account's Data Lake endpoint and the credentials from Step 4 of the setup guide.
configurable string storageAccount = ?; configurable string tenantId = ?; configurable string clientId = ?; configurable string clientSecret = ?; configurable string refreshToken = ?; final datalake:Client datalake = check new ({ auth: { clientId, clientSecret, refreshToken, refreshUrl: string `https://login.microsoftonline.com/${tenantId}/oauth2/v2.0/token`, scopes: ["https://storage.azure.com/user_impersonation", "offline_access"] } }, string `https://${storageAccount}.dfs.core.windows.net`);
Note: The connector's default token URL is the multi-tenant
https://login.microsoftonline.com/common/oauth2/v2.0/tokenendpoint. It works only for applications that accept accounts from any organization, so change it to your tenant's endpoint, asrefreshUrldoes above.
Provide the values in a Config.toml file:
storageAccount = "<storage-account-name>" tenantId = "<tenant-id>" clientId = "<client-id>" clientSecret = "<client-secret>" refreshToken = "<refresh-token>"
Step 3: Invoke the connector operation
List the filesystems in the storage account.
public function main() returns error? { datalake:FilesystemList _ = check datalake->listFilesystems(); }
Step 4: Run the Ballerina application
bal run
Examples
The Azure Data Lake connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:
- Daily extract ingestion - Upload a local extract into a dated directory in chunks, then list the directory and read the file back.
Clients
azure.datalake: Client
Azure Data Lake Storage provides storage for Hadoop and other big data workloads.
Constructor
Gets invoked to initialize the connector.
init (ConnectionConfig config, string serviceUrl)- config ConnectionConfig - The configurations to be used when initializing the
connector
- serviceUrl string - URL of the target service
listFilesystems
function listFilesystems(ListFilesystemsHeaders headers, *ListFilesystemsQueries queries) returns FilesystemList|errorList Filesystems
Parameters
- headers ListFilesystemsHeaders (default {}) - Headers to be sent with the request
- queries *ListFilesystemsQueries - Queries to be sent with the request
Return Type
- FilesystemList|error - OK
listPaths
function listPaths(string filesystem, ListPathsHeaders headers, *ListPathsQueries queries) returns PathList|errorList Paths
Parameters
- filesystem string - The filesystem identifier. The value must start and end with a letter or number and must contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All letters must be lowercase. The value must have between 3 and 63 characters
- headers ListPathsHeaders (default {}) - Headers to be sent with the request
- queries *ListPathsQueries - Queries to be sent with the request
createFilesystem
function createFilesystem(string filesystem, CreateFilesystemHeaders headers, *CreateFilesystemQueries queries) returns error?Create Filesystem
Parameters
- filesystem string - The filesystem identifier. The value must start and end with a letter or number and must contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All letters must be lowercase. The value must have between 3 and 63 characters
- headers CreateFilesystemHeaders (default {}) - Headers to be sent with the request
- queries *CreateFilesystemQueries - Queries to be sent with the request
Return Type
- error? - Created
deleteFilesystem
function deleteFilesystem(string filesystem, DeleteFilesystemHeaders headers, *DeleteFilesystemQueries queries) returns error?Delete Filesystem
Parameters
- filesystem string - The filesystem identifier. The value must start and end with a letter or number and must contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All letters must be lowercase. The value must have between 3 and 63 characters
- headers DeleteFilesystemHeaders (default {}) - Headers to be sent with the request
- queries *DeleteFilesystemQueries - Queries to be sent with the request
Return Type
- error? - Accepted
setFilesystemProperties
function setFilesystemProperties(string filesystem, SetFilesystemPropertiesHeaders headers, *SetFilesystemPropertiesQueries queries) returns error?Set Filesystem Properties
Parameters
- filesystem string - The filesystem identifier. The value must start and end with a letter or number and must contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All letters must be lowercase. The value must have between 3 and 63 characters
- headers SetFilesystemPropertiesHeaders (default {}) - Headers to be sent with the request
- queries *SetFilesystemPropertiesQueries - Queries to be sent with the request
Return Type
- error? - Ok
getFilesystemProperties
function getFilesystemProperties(string filesystem, GetFilesystemPropertiesHeaders headers, *GetFilesystemPropertiesQueries queries) returns Response|errorGet Filesystem Properties.
Parameters
- filesystem string - The filesystem identifier. The value must start and end with a letter or number and must contain only letters, numbers, and the dash (-) character. Consecutive dashes are not permitted. All letters must be lowercase. The value must have between 3 and 63 characters
- headers GetFilesystemPropertiesHeaders (default {}) - Headers to be sent with the request
- queries *GetFilesystemPropertiesQueries - Queries to be sent with the request
readFile
function readFile(string filesystem, string path, ReadFileHeaders headers, *ReadFileQueries queries) returns byte[]|errorRead File
Parameters
- filesystem string - The filesystem identifier
- path string - The file or directory path
- headers ReadFileHeaders (default {}) - Headers to be sent with the request
- queries *ReadFileQueries - Queries to be sent with the request
Return Type
- byte[]|error - Ok
createPath
function createPath(string filesystem, string path, CreatePathHeaders headers, *CreatePathQueries queries) returns error?Create File | Create Directory | Rename File | Rename Directory
Parameters
- filesystem string - The filesystem identifier
- path string - The file or directory path
- headers CreatePathHeaders (default {}) - Headers to be sent with the request
- queries *CreatePathQueries - Queries to be sent with the request
Return Type
- error? - The file or directory was created
leasePath
function leasePath(string filesystem, string path, LeasePathHeaders headers, *LeasePathQueries queries) returns error?Lease Path
Parameters
- filesystem string - The filesystem identifier
- path string - The file or directory path
- headers LeasePathHeaders - Headers to be sent with the request
- queries *LeasePathQueries - Queries to be sent with the request
Return Type
- error? - The "renew", "change" or "release" action was successful
deletePath
function deletePath(string filesystem, string path, DeletePathHeaders headers, *DeletePathQueries queries) returns error?Delete File | Delete Directory
Parameters
- filesystem string - The filesystem identifier
- path string - The file or directory path
- headers DeletePathHeaders (default {}) - Headers to be sent with the request
- queries *DeletePathQueries - Queries to be sent with the request
Return Type
- error? - The file was deleted
updatePath
function updatePath(string filesystem, string path, byte[] payload, UpdatePathHeaders headers, *UpdatePathQueries queries) returns error?Append Data | Flush Data | Set Properties | Set Access Control
Parameters
- filesystem string - The filesystem identifier
- path string - The file or directory path
- payload byte[] - Valid only for append operations. The data to be uploaded and appended to the file
- headers UpdatePathHeaders (default {}) - Headers to be sent with the request
- queries *UpdatePathQueries - Queries to be sent with the request
Return Type
- error? - The data was flushed (written) to the file or the properties were set successfully
getPathProperties
function getPathProperties(string filesystem, string path, GetPathPropertiesHeaders headers, *GetPathPropertiesQueries queries) returns Response|errorGet Properties | Get Status | Get Access Control List | Check Access
Parameters
- filesystem string - The filesystem identifier
- path string - The file or directory path
- headers GetPathPropertiesHeaders (default {}) - Headers to be sent with the request
- queries *GetPathPropertiesQueries - Queries to be sent with the request
Records
azure.datalake: ConnectionConfig
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- auth OAuth2ClientCredentialsGrantConfig|BearerTokenConfig|OAuth2RefreshTokenGrantConfig - Configurations related to client authentication
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings ClientHttp1Settings(default {}) - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings(default {}) - Configurations related to HTTP/2 protocol
- timeout decimal(default 30) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded/x-forwardedheader
- followRedirects? FollowRedirects - Configurations associated with Redirection
- poolConfig? PoolConfiguration - Configurations associated with request pooling
- cache CacheConfig(default {}) - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding) header
- circuitBreaker? CircuitBreakerConfig - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig? RetryConfig - Configurations associated with retrying
- cookieConfig? CookieConfig - Configurations associated with cookies
- responseLimits ResponseLimitConfigs(default {}) - Configurations associated with inbound response size limits
- secureSocket? ClientSecureSocket - SSL/TLS-related options
- proxy? ProxyConfig - Proxy server related options
- socketConfig ClientSocketConfig(default {}) - Provides settings related to client socket configuration
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
- laxDataBinding boolean(default true) - Enables relaxed data binding on the client side. When enabled,
nilvalues are treated as optional, and absent fields are handled asnilabletypes. Enabled by default.
azure.datalake: CreateFilesystemHeaders
Represents the Headers record for the operation: createFilesystem
Fields
- xMsVersion string(default "2019-10-31") - Specifies the version of the REST protocol used for processing the request. Required for every authorized request, including those that use a Microsoft Entra ID bearer token. Defaults to 2019-10-31
- xMsDate? string - Specifies the Coordinated Universal Time (UTC) for the request. This is required when using shared key authorization
- xMsProperties? string - User-defined properties to be stored with the filesystem, in the format of a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is a base64 encoded string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set
- xMsClientRequestId? string - A UUID recorded in the analytics logs for troubleshooting and correlation
azure.datalake: CreateFilesystemQueries
Represents the Queries record for the operation: createFilesystem
Fields
- 'resource "filesystem" (default "filesystem") - The value must be "filesystem" for all filesystem operations
- timeout? Signed32 - An optional operation timeout value in seconds. The period begins when the request is received by the service. If the timeout value elapses before the operation completes, the operation fails
azure.datalake: CreatePathHeaders
Represents the Headers record for the operation: createPath
Fields
- xMsUmask? string - Optional and only valid if Hierarchical Namespace is enabled for the account. When creating a file or directory and the parent folder does not have a default ACL, the umask restricts the permissions of the file or directory to be created. The resulting permission is given by p & ^u, where p is the permission and u is the umask. For example, if p is 0777 and u is 0057, then the resulting permission is 0720. The default permission is 0777 for a directory and 0666 for a file. The default umask is 0027. The umask must be specified in 4-digit octal notation (e.g. 0766)
- xMsSourceLeaseId? string - Optional for rename operations. A lease ID for the source path. The source path must have an active lease and the lease ID must match
- xMsLeaseId? string - Optional. A lease ID for the path specified in the URI. The path to be overwritten must have an active lease and the lease ID must match
- xMsSourceIfModifiedSince? string - Optional. A date and time value. Specify this header to perform the rename operation only if the source has been modified since the specified date and time
- xMsProperties? string - Optional. User-defined properties to be stored with the file or directory, in the format of a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is a base64 encoded string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set
- xMsSourceIfMatch? string - Optional. An ETag value. Specify this header to perform the rename operation only if the source's ETag matches the value specified. The ETag must be specified in quotes
- xMsSourceIfUnmodifiedSince? string - Optional. A date and time value. Specify this header to perform the rename operation only if the source has not been modified since the specified date and time
- xMsCacheControl? string - Optional. The service stores this value and includes it in the "Cache-Control" response header for "Read File" operations
- xMsContentLanguage? string - Optional. The service stores this value and includes it in the "Content-Language" response header for "Read File" operations
- contentEncoding? string - Optional. Specifies which content encodings have been applied to the file. This value is returned to the client when the "Read File" operation is performed
- xMsPermissions? string - Optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may be granted read, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are supported
- xMsVersion string(default "2019-10-31") - Specifies the version of the REST protocol used for processing the request. Required for every authorized request, including those that use a Microsoft Entra ID bearer token. Defaults to 2019-10-31
- xMsRenameSource? string - An optional file or directory to be renamed. The value must have the following format: "/{filesystem}/{path}". If "x-ms-properties" is specified, the properties will overwrite the existing properties; otherwise, the existing properties will be preserved. This value must be a URL percent-encoded string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set
- xMsContentType? string - Optional. The service stores this value and includes it in the "Content-Type" response header for "Read File" operations
- xMsContentEncoding? string - Optional. The service stores this value and includes it in the "Content-Encoding" response header for "Read File" operations
- ifNoneMatch? string - Optional. An ETag value or the special wildcard ("*") value. Specify this header to perform the operation only if the resource's ETag does not match the value specified. The ETag must be specified in quotes
- xMsContentDisposition? string - Optional. The service stores this value and includes it in the "Content-Disposition" response header for "Read File" operations
- ifMatch? string - Optional. An ETag value. Specify this header to perform the operation only if the resource's ETag matches the value specified. The ETag must be specified in quotes
- cacheControl? string - Optional. The service stores this value and includes it in the "Cache-Control" response header for "Read File" operations for "Read File" operations
- xMsDate? string - Specifies the Coordinated Universal Time (UTC) for the request. This is required when using shared key authorization
- contentDisposition? string - Optional. The service stores this value and includes it in the "Content-Disposition" response header for "Read File" operations
- ifModifiedSince? string - Optional. A date and time value. Specify this header to perform the operation only if the resource has been modified since the specified date and time
- xMsSourceIfNoneMatch? string - Optional. An ETag value or the special wildcard ("*") value. Specify this header to perform the rename operation only if the source's ETag does not match the value specified. The ETag must be specified in quotes
- xMsClientRequestId? string - A UUID recorded in the analytics logs for troubleshooting and correlation
- contentLanguage? string - Optional. Specifies the natural language used by the intended audience for the file
- ifUnmodifiedSince? string - Optional. A date and time value. Specify this header to perform the operation only if the resource has not been modified since the specified date and time
azure.datalake: CreatePathQueries
Represents the Queries record for the operation: createPath
Fields
- mode? "legacy"|"posix" - Optional. Valid only when namespace is enabled. This parameter determines the behavior of the rename operation. The value must be "legacy" or "posix", and the default value will be "posix".
- 'resource? "directory"|"file" - Required only for Create File and Create Directory. The value must be "file" or "directory"
- continuation? string - Optional. When renaming a directory, the number of paths that are renamed with each invocation is limited. If the number of paths to be renamed exceeds this limit, a continuation token is returned in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the rename operation to continue renaming the directory
- timeout? Signed32 - An optional operation timeout value in seconds. The period begins when the request is received by the service. If the timeout value elapses before the operation completes, the operation fails
azure.datalake: DeleteFilesystemHeaders
Represents the Headers record for the operation: deleteFilesystem
Fields
- xMsVersion string(default "2019-10-31") - Specifies the version of the REST protocol used for processing the request. Required for every authorized request, including those that use a Microsoft Entra ID bearer token. Defaults to 2019-10-31
- xMsDate? string - Specifies the Coordinated Universal Time (UTC) for the request. This is required when using shared key authorization
- ifModifiedSince? string - Optional. A date and time value. Specify this header to perform the operation only if the resource has been modified since the specified date and time
- xMsClientRequestId? string - A UUID recorded in the analytics logs for troubleshooting and correlation
- ifUnmodifiedSince? string - Optional. A date and time value. Specify this header to perform the operation only if the resource has not been modified since the specified date and time
azure.datalake: DeleteFilesystemQueries
Represents the Queries record for the operation: deleteFilesystem
Fields
- 'resource "filesystem" (default "filesystem") - The value must be "filesystem" for all filesystem operations
- timeout? Signed32 - An optional operation timeout value in seconds. The period begins when the request is received by the service. If the timeout value elapses before the operation completes, the operation fails
azure.datalake: DeletePathHeaders
Represents the Headers record for the operation: deletePath
Fields
- ifNoneMatch? string - Optional. An ETag value or the special wildcard ("*") value. Specify this header to perform the operation only if the resource's ETag does not match the value specified. The ETag must be specified in quotes
- xMsVersion string(default "2019-10-31") - Specifies the version of the REST protocol used for processing the request. Required for every authorized request, including those that use a Microsoft Entra ID bearer token. Defaults to 2019-10-31
- ifMatch? string - Optional. An ETag value. Specify this header to perform the operation only if the resource's ETag matches the value specified. The ETag must be specified in quotes
- xMsDate? string - Specifies the Coordinated Universal Time (UTC) for the request. This is required when using shared key authorization
- xMsLeaseId? string - The lease ID must be specified if there is an active lease
- ifModifiedSince? string - Optional. A date and time value. Specify this header to perform the operation only if the resource has been modified since the specified date and time
- xMsClientRequestId? string - A UUID recorded in the analytics logs for troubleshooting and correlation
- ifUnmodifiedSince? string - Optional. A date and time value. Specify this header to perform the operation only if the resource has not been modified since the specified date and time
azure.datalake: DeletePathQueries
Represents the Queries record for the operation: deletePath
Fields
- continuation? string - Optional. When deleting a directory, the number of paths that are deleted with each invocation is limited. If the number of paths to be deleted exceeds this limit, a continuation token is returned in this response header. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the delete operation to continue deleting the directory
- timeout? Signed32 - An optional operation timeout value in seconds. The period begins when the request is received by the service. If the timeout value elapses before the operation completes, the operation fails
- recursive? boolean - Required and valid only when the resource is a directory. If "true", all paths beneath the directory will be deleted. If "false" and the directory is non-empty, an error occurs
azure.datalake: Filesystem
A filesystem in the storage account
Fields
- name? string - The name of the filesystem
- eTag? string - The entity tag (ETag) of the filesystem
- lastModified? string - The date and time the filesystem was last modified, in RFC 1123 format
azure.datalake: FilesystemList
A list of filesystems in the storage account
Fields
- filesystems? Filesystem[] - List of filesystems
azure.datalake: GetFilesystemPropertiesHeaders
Represents the Headers record for the operation: getFilesystemProperties
Fields
- xMsVersion string(default "2019-10-31") - Specifies the version of the REST protocol used for processing the request. Required for every authorized request, including those that use a Microsoft Entra ID bearer token. Defaults to 2019-10-31
- xMsDate? string - Specifies the Coordinated Universal Time (UTC) for the request. This is required when using shared key authorization
- xMsClientRequestId? string - A UUID recorded in the analytics logs for troubleshooting and correlation
azure.datalake: GetFilesystemPropertiesQueries
Represents the Queries record for the operation: getFilesystemProperties
Fields
- 'resource "filesystem" (default "filesystem") - The value must be "filesystem" for all filesystem operations
- timeout? Signed32 - An optional operation timeout value in seconds. The period begins when the request is received by the service. If the timeout value elapses before the operation completes, the operation fails
azure.datalake: GetPathPropertiesHeaders
Represents the Headers record for the operation: getPathProperties
Fields
- ifNoneMatch? string - Optional. An ETag value or the special wildcard ("*") value. Specify this header to perform the operation only if the resource's ETag does not match the value specified. The ETag must be specified in quotes
- xMsVersion string(default "2019-10-31") - Specifies the version of the REST protocol used for processing the request. Required for every authorized request, including those that use a Microsoft Entra ID bearer token. Defaults to 2019-10-31
- ifMatch? string - Optional. An ETag value. Specify this header to perform the operation only if the resource's ETag matches the value specified. The ETag must be specified in quotes
- xMsDate? string - Specifies the Coordinated Universal Time (UTC) for the request. This is required when using shared key authorization
- xMsLeaseId? string - Optional. If this header is specified, the operation will be performed only if both of the following conditions are met: i) the path's lease is currently active and ii) the lease ID specified in the request matches that of the path
- ifModifiedSince? string - Optional. A date and time value. Specify this header to perform the operation only if the resource has been modified since the specified date and time
- xMsClientRequestId? string - A UUID recorded in the analytics logs for troubleshooting and correlation
- ifUnmodifiedSince? string - Optional. A date and time value. Specify this header to perform the operation only if the resource has not been modified since the specified date and time
azure.datalake: GetPathPropertiesQueries
Represents the Queries record for the operation: getPathProperties
Fields
- upn? boolean - Optional. Valid only when Hierarchical Namespace is enabled for the account. If "true", the user identity values returned in the x-ms-owner, x-ms-group, and x-ms-acl response headers will be transformed from Azure Active Directory Object IDs to User Principal Names. If "false", the values will be returned as Azure Active Directory Object IDs. The default value is false. Note that group and application Object IDs are not translated because they do not have unique friendly names
- action? "getAccessControl"|"getStatus"|"checkAccess" - Optional. If the value is "getStatus" only the system defined properties for the path are returned. If the value is "getAccessControl" the access control list is returned in the response headers (Hierarchical Namespace must be enabled for the account), otherwise the properties are returned
- fsAction? string - Required only for check access action. Valid only when Hierarchical Namespace is enabled for the account. File system operation read/write/execute in string form, matching regex pattern '[rwx-]{3}'
- timeout? Signed32 - An optional operation timeout value in seconds. The period begins when the request is received by the service. If the timeout value elapses before the operation completes, the operation fails
azure.datalake: LeasePathHeaders
Represents the Headers record for the operation: leasePath
Fields
- ifNoneMatch? string - Optional. An ETag value or the special wildcard ("*") value. Specify this header to perform the operation only if the resource's ETag does not match the value specified. The ETag must be specified in quotes
- xMsVersion string(default "2019-10-31") - Specifies the version of the REST protocol used for processing the request. Required for every authorized request, including those that use a Microsoft Entra ID bearer token. Defaults to 2019-10-31
- ifMatch? string - Optional. An ETag value. Specify this header to perform the operation only if the resource's ETag matches the value specified. The ETag must be specified in quotes
- xMsProposedLeaseId? string - Required when "x-ms-lease-action" is "acquire" or "change". A lease will be acquired with this lease ID if the operation is successful
- xMsLeaseBreakPeriod? Signed32 - The lease break period duration is optional to break a lease, and specifies the break period of the lease in seconds. The lease break duration must be between 0 and 60 seconds
- xMsDate? string - Specifies the Coordinated Universal Time (UTC) for the request. This is required when using shared key authorization
- xMsLeaseId? string - Required when "x-ms-lease-action" is "renew", "change" or "release". For the renew and release actions, this must match the current lease ID
- ifModifiedSince? string - Optional. A date and time value. Specify this header to perform the operation only if the resource has been modified since the specified date and time
- xMsLeaseDuration? Signed32 - The lease duration is required to acquire a lease, and specifies the duration of the lease in seconds. The lease duration must be between 15 and 60 seconds or -1 for infinite lease
- xMsLeaseAction "acquire"|"break"|"change"|"renew"|"release" - There are five lease actions: "acquire", "break", "change", "renew", and "release". Use "acquire" and specify the "x-ms-proposed-lease-id" and "x-ms-lease-duration" to acquire a new lease. Use "break" to break an existing lease. When a lease is broken, the lease break period is allowed to elapse, during which time no lease operation except break and release can be performed on the file. When a lease is successfully broken, the response indicates the interval in seconds until a new lease can be acquired. Use "change" and specify the current lease ID in "x-ms-lease-id" and the new lease ID in "x-ms-proposed-lease-id" to change the lease ID of an active lease. Use "renew" and specify the "x-ms-lease-id" to renew an existing lease. Use "release" and specify the "x-ms-lease-id" to release a lease
- xMsClientRequestId? string - A UUID recorded in the analytics logs for troubleshooting and correlation
- ifUnmodifiedSince? string - Optional. A date and time value. Specify this header to perform the operation only if the resource has not been modified since the specified date and time
azure.datalake: LeasePathQueries
Represents the Queries record for the operation: leasePath
Fields
- timeout? Signed32 - An optional operation timeout value in seconds. The period begins when the request is received by the service. If the timeout value elapses before the operation completes, the operation fails
azure.datalake: ListFilesystemsHeaders
Represents the Headers record for the operation: listFilesystems
Fields
- xMsVersion string(default "2019-10-31") - Specifies the version of the REST protocol used for processing the request. Required for every authorized request, including those that use a Microsoft Entra ID bearer token. Defaults to 2019-10-31
- xMsDate? string - Specifies the Coordinated Universal Time (UTC) for the request. This is required when using shared key authorization
- xMsClientRequestId? string - A UUID recorded in the analytics logs for troubleshooting and correlation
azure.datalake: ListFilesystemsQueries
Represents the Queries record for the operation: listFilesystems
Fields
- 'resource "account" (default "account") - The value must be "account" for all account operations
- prefix? string - Filters results to filesystems within the specified prefix
- maxResults? Signed32 - An optional value that specifies the maximum number of items to return. If omitted or greater than 5,000, the response will include up to 5,000 items
- continuation? string - The number of filesystems returned with each invocation is limited. If the number of filesystems to be returned exceeds this limit, a continuation token is returned in the response header x-ms-continuation. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the list operation to continue listing the filesystems
- timeout? Signed32 - An optional operation timeout value in seconds. The period begins when the request is received by the service. If the timeout value elapses before the operation completes, the operation fails
azure.datalake: ListPathsHeaders
Represents the Headers record for the operation: listPaths
Fields
- xMsVersion string(default "2019-10-31") - Specifies the version of the REST protocol used for processing the request. Required for every authorized request, including those that use a Microsoft Entra ID bearer token. Defaults to 2019-10-31
- xMsDate? string - Specifies the Coordinated Universal Time (UTC) for the request. This is required when using shared key authorization
- xMsClientRequestId? string - A UUID recorded in the analytics logs for troubleshooting and correlation
azure.datalake: ListPathsQueries
Represents the Queries record for the operation: listPaths
Fields
- upn? boolean - Optional. Valid only when Hierarchical Namespace is enabled for the account. If "true", the user identity values returned in the owner and group fields of each list entry will be transformed from Azure Active Directory Object IDs to User Principal Names. If "false", the values will be returned as Azure Active Directory Object IDs. The default value is false. Note that group and application Object IDs are not translated because they do not have unique friendly names
- 'resource "filesystem" (default "filesystem") - The value must be "filesystem" for all filesystem operations
- maxResults? Signed32 - An optional value that specifies the maximum number of items to return. If omitted or greater than 5,000, the response will include up to 5,000 items
- directory? string - Filters results to paths within the specified directory. An error occurs if the directory does not exist
- continuation? string - The number of paths returned with each invocation is limited. If the number of paths to be returned exceeds this limit, a continuation token is returned in the response header x-ms-continuation. When a continuation token is returned in the response, it must be specified in a subsequent invocation of the list operation to continue listing the paths
- timeout? Signed32 - An optional operation timeout value in seconds. The period begins when the request is received by the service. If the timeout value elapses before the operation completes, the operation fails
- recursive boolean - If "true", all paths are listed; otherwise, only paths at the root of the filesystem are listed. If "directory" is specified, the list will only include paths that share the same root
azure.datalake: OAuth2ClientCredentialsGrantConfig
OAuth2 Client Credentials Grant Configs
Fields
- Fields Included from *OAuth2ClientCredentialsGrantConfig
- tokenUrl string(default "https://login.microsoftonline.com/common/oauth2/v2.0/token") - Token URL
azure.datalake: OAuth2RefreshTokenGrantConfig
OAuth2 Refresh Token Grant Configs
Fields
- Fields Included from *OAuth2RefreshTokenGrantConfig
- refreshUrl string(default "https://login.microsoftonline.com/common/oauth2/v2.0/token") - Refresh URL
azure.datalake: Path
A file or directory in a filesystem
Fields
- owner? string - The owner of the file or directory
- permissions? string - The POSIX access permissions for the owner, the owning group and others
- name? string - The path of the file or directory, relative to the filesystem root
- eTag? string - The entity tag (ETag) of the path
- contentLength? int - The size of the file in bytes
- lastModified? string - The date and time the path was last modified, in RFC 1123 format
- isDirectory boolean(default false) - Whether the path is a directory
- group? string - The owning group of the file or directory
azure.datalake: PathList
A list of paths in a filesystem
Fields
- paths? Path[] - List of paths
azure.datalake: ReadFileHeaders
Represents the Headers record for the operation: readFile
Fields
- ifNoneMatch? string - Optional. An ETag value or the special wildcard ("*") value. Specify this header to perform the operation only if the resource's ETag does not match the value specified. The ETag must be specified in quotes
- xMsVersion string(default "2019-10-31") - Specifies the version of the REST protocol used for processing the request. Required for every authorized request, including those that use a Microsoft Entra ID bearer token. Defaults to 2019-10-31
- ifMatch? string - Optional. An ETag value. Specify this header to perform the operation only if the resource's ETag matches the value specified. The ETag must be specified in quotes
- xMsDate? string - Specifies the Coordinated Universal Time (UTC) for the request. This is required when using shared key authorization
- xMsLeaseId? string - Optional. If this header is specified, the operation will be performed only if both of the following conditions are met: i) the path's lease is currently active and ii) the lease ID specified in the request matches that of the path
- ifModifiedSince? string - Optional. A date and time value. Specify this header to perform the operation only if the resource has been modified since the specified date and time
- range? string - The HTTP Range request header specifies one or more byte ranges of the resource to be retrieved
- xMsRangeGetContentMd5? boolean - Optional. When this header is set to "true" and specified together with the Range header, the service returns the MD5 hash for the range, as long as the range is less than or equal to 4MB in size. If this header is specified without the Range header, the service returns status code 400 (Bad Request). If this header is set to true when the range exceeds 4 MB in size, the service returns status code 400 (Bad Request)
- xMsClientRequestId? string - A UUID recorded in the analytics logs for troubleshooting and correlation
- ifUnmodifiedSince? string - Optional. A date and time value. Specify this header to perform the operation only if the resource has not been modified since the specified date and time
azure.datalake: ReadFileQueries
Represents the Queries record for the operation: readFile
Fields
- timeout? Signed32 - An optional operation timeout value in seconds. The period begins when the request is received by the service. If the timeout value elapses before the operation completes, the operation fails
azure.datalake: SetFilesystemPropertiesHeaders
Represents the Headers record for the operation: setFilesystemProperties
Fields
- xMsVersion string(default "2019-10-31") - Specifies the version of the REST protocol used for processing the request. Required for every authorized request, including those that use a Microsoft Entra ID bearer token. Defaults to 2019-10-31
- xMsDate? string - Specifies the Coordinated Universal Time (UTC) for the request. This is required when using shared key authorization
- ifModifiedSince? string - Optional. A date and time value. Specify this header to perform the operation only if the resource has been modified since the specified date and time
- xMsProperties? string - Optional. User-defined properties to be stored with the filesystem, in the format of a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is a base64 encoded string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set. If the filesystem exists, any properties not included in the list will be removed. All properties are removed if the header is omitted. To merge new and existing properties, first get all existing properties and the current E-Tag, then make a conditional request with the E-Tag and include values for all properties
- xMsClientRequestId? string - A UUID recorded in the analytics logs for troubleshooting and correlation
- ifUnmodifiedSince? string - Optional. A date and time value. Specify this header to perform the operation only if the resource has not been modified since the specified date and time
azure.datalake: SetFilesystemPropertiesQueries
Represents the Queries record for the operation: setFilesystemProperties
Fields
- 'resource "filesystem" (default "filesystem") - The value must be "filesystem" for all filesystem operations
- timeout? Signed32 - An optional operation timeout value in seconds. The period begins when the request is received by the service. If the timeout value elapses before the operation completes, the operation fails
azure.datalake: UpdatePathHeaders
Represents the Headers record for the operation: updatePath
Fields
- xMsGroup? string - Optional and valid only for the setAccessControl operation. Sets the owning group of the file or directory
- xMsVersion string(default "2019-10-31") - Specifies the version of the REST protocol used for processing the request. Required for every authorized request, including those that use a Microsoft Entra ID bearer token. Defaults to 2019-10-31
- xMsLeaseId? string - The lease ID must be specified if there is an active lease
- xMsAcl? string - Optional and valid only for the setAccessControl operation. Sets POSIX access control rights on files and directories. The value is a comma-separated list of access control entries that fully replaces the existing access control list (ACL). Each access control entry (ACE) consists of a scope, a type, a user or group identifier, and permissions in the format "[scope:][type]:[id]:[permissions]". The scope must be "default" to indicate the ACE belongs to the default ACL for a directory; otherwise scope is implicit and the ACE belongs to the access ACL. There are four ACE types: "user" grants rights to the owner or a named user, "group" grants rights to the owning group or a named group, "mask" restricts rights granted to named users and the members of groups, and "other" grants rights to all users not found in any of the other entries. The user or group identifier is omitted for entries of type "mask" and "other". The user or group identifier is also omitted for the owner and owning group. The permission field is a 3-character sequence where the first character is 'r' to grant read access, the second character is 'w' to grant write access, and the third character is 'x' to grant execute permission. If access is not granted, the '-' character is used to denote that the permission is denied. For example, the following ACL grants read, write, and execute rights to the file owner and john.doe@contoso, the read right to the owning group, and nothing to everyone else: "user::rwx,user:john.doe@contoso:rwx,group::r--,other::---,mask=rwx". Invalid in conjunction with x-ms-permissions
- xMsContentMd5? string - Optional and only valid for "Flush & Set Properties" operations. The service stores this value and includes it in the "Content-Md5" response header for "Read & Get Properties" operations. If this property is not specified on the request, then the property will be cleared for the file. Subsequent calls to "Read & Get Properties" will not return this property unless it is explicitly set on that file again
- xMsProperties? string - Optional. User-defined properties to be stored with the file or directory, in the format of a comma-separated list of name and value pairs "n1=v1, n2=v2, ...", where each value is a base64 encoded string. Note that the string may only contain ASCII characters in the ISO-8859-1 character set. Valid only for the setProperties operation. If the file or directory exists, any properties not included in the list will be removed. All properties are removed if the header is omitted. To merge new and existing properties, first get all existing properties and the current E-Tag, then make a conditional request with the E-Tag and include values for all properties
- xMsContentType? string - Optional and only valid for flush and set properties operations. The service stores this value and includes it in the "Content-Type" response header for "Read File" operations
- contentMD5? string - Optional. An MD5 hash of the request content. This header is valid on "Append" and "Flush" operations. This hash is used to verify the integrity of the request content during transport. When this header is specified, the storage service compares the hash of the content that has arrived with this header value. If the two hashes do not match, the operation will fail with error code 400 (Bad Request). Note that this MD5 hash is not stored with the file. This header is associated with the request content, and not with the stored content of the file itself
- xMsContentEncoding? string - Optional and only valid for flush and set properties operations. The service stores this value and includes it in the "Content-Encoding" response header for "Read File" operations
- ifNoneMatch? string - Optional for Flush Data and Set Properties, but invalid for Append Data. An ETag value or the special wildcard ("*") value. Specify this header to perform the operation only if the resource's ETag does not match the value specified. The ETag must be specified in quotes
- xMsContentDisposition? string - Optional and only valid for flush and set properties operations. The service stores this value and includes it in the "Content-Disposition" response header for "Read File" operations
- ifMatch? string - Optional for Flush Data and Set Properties, but invalid for Append Data. An ETag value. Specify this header to perform the operation only if the resource's ETag matches the value specified. The ETag must be specified in quotes
- xMsCacheControl? string - Optional and only valid for flush and set properties operations. The service stores this value and includes it in the "Cache-Control" response header for "Read File" operations
- xMsDate? string - Specifies the Coordinated Universal Time (UTC) for the request. This is required when using shared key authorization
- xMsContentLanguage? string - Optional and only valid for flush and set properties operations. The service stores this value and includes it in the "Content-Language" response header for "Read File" operations
- ifModifiedSince? string - Optional for Flush Data and Set Properties, but invalid for Append Data. A date and time value. Specify this header to perform the operation only if the resource has been modified since the specified date and time
- xMsPermissions? string - Optional and only valid if Hierarchical Namespace is enabled for the account. Sets POSIX access permissions for the file owner, the file owning group, and others. Each class may be granted read, write, or execute permission. The sticky bit is also supported. Both symbolic (rwxrw-rw-) and 4-digit octal notation (e.g. 0766) are supported. Invalid in conjunction with x-ms-acl
- contentLength? int - Required for "Append Data" and "Flush Data". Must be 0 for "Flush Data". Must be the length of the request content in bytes for "Append Data"
- xMsClientRequestId? string - A UUID recorded in the analytics logs for troubleshooting and correlation
- xMsOwner? string - Optional and valid only for the setAccessControl operation. Sets the owner of the file or directory
- ifUnmodifiedSince? string - Optional for Flush Data and Set Properties, but invalid for Append Data. A date and time value. Specify this header to perform the operation only if the resource has not been modified since the specified date and time
azure.datalake: UpdatePathQueries
Represents the Queries record for the operation: updatePath
Fields
- action "append"|"flush"|"setProperties"|"setAccessControl" - The action must be "append" to upload data to be appended to a file, "flush" to flush previously uploaded data to a file, "setProperties" to set the properties of a file or directory, or "setAccessControl" to set the owner, group, permissions, or access control list for a file or directory. Note that Hierarchical Namespace must be enabled for the account in order to use access control. Also note that the Access Control List (ACL) includes permissions for the owner, owning group, and others, so the x-ms-permissions and x-ms-acl request headers are mutually exclusive
- retainUncommittedData? boolean - Valid only for flush operations. If "true", uncommitted data is retained after the flush operation completes; otherwise, the uncommitted data is deleted after the flush operation. The default is false. Data at offsets less than the specified position are written to the file when flush succeeds, but this optional parameter allows data after the flush position to be retained for a future flush operation
- position? int - This parameter allows the caller to upload data in parallel and control the order in which it is appended to the file. It is required when uploading data to be appended to the file and when flushing previously uploaded data to the file. The value must be the position where the data is to be appended. Uploaded data is not immediately flushed, or written, to the file. To flush, the previously uploaded data must be contiguous, the position parameter must be specified and equal to the length of the file after all data has been written, and there must not be a request entity body included with the request
- close? boolean - Azure Storage Events allow applications to receive notifications when files change. When Azure Storage Events are enabled, a file changed event is raised. This event has a property indicating whether this is the final change to distinguish the difference between an intermediate flush to a file stream and the final close of a file stream. The close query parameter is valid only when the action is "flush" and change notifications are enabled. If the value of close is "true" and the flush operation completes successfully, the service raises a file change notification with a property indicating that this is the final update (the file stream has been closed). If "false" a change notification is raised indicating the file has changed. The default is false. This query parameter is set to true by the Hadoop ABFS driver to indicate that the file stream has been closed."
- timeout? Signed32 - An optional operation timeout value in seconds. The period begins when the request is received by the service. If the timeout value elapses before the operation completes, the operation fails
Import
import ballerinax/azure.datalake;Metadata
Released date: 1 day ago
Version: 2.0.0
License: Apache-2.0
Security
No known direct vulnerabilities
Indirect vulnerabilities:
Checked on 2026-11-07 via OSV.dev
Compatibility
Platform: any
Ballerina version: 2201.12.0
GraalVM compatible: Yes
Pull count
Total: 17445
Current verison: 0
Weekly downloads
Keywords
Vendor/Microsoft
Area/Storage & File Management
Type/Connector
Contributors