Azure.Storage.Files.DataLake.DataLakeServiceClient
The DataLakeServiceClient allows you to manipulate Azure
Data Lake service resources and file systems. The storage account provides
the top-level namespace for the Data Lake service.
Gets the Storage account name corresponding to the file service client.
Determines whether the client is able to generate a SAS.
If the client is authenticated with a StorageSharedKeyCredential.
Gets the Data Lake service's primary Uri endpoint.
protected DataLakeServiceClient()
Initializes a new instance of the DataLakeServiceClient
class for mocking.
Initializes a new instance of the DataLakeServiceClient
class.
Initializes a new instance of the DataLakeServiceClient
class.
Initializes a new instance of the DataLakeServiceClient
class.
Initializes a new instance of the DataLakeServiceClient
class.
Initializes a new instance of the DataLakeServiceClient
class.
public DataLakeServiceClient(Uri serviceUri, StorageSharedKeyCredential credential, DataLakeClientOptions options)
Initializes a new instance of the DataLakeServiceClient
class.
Initializes a new instance of the DataLakeServiceClient
class.
public DataLakeServiceClient(Uri serviceUri, AzureSasCredential credential, DataLakeClientOptions options)
Initializes a new instance of the DataLakeServiceClient
class.
Initializes a new instance of the DataLakeServiceClient
class.
public DataLakeServiceClient(Uri serviceUri, TokenCredential credential, DataLakeClientOptions options)
Initializes a new instance of the DataLakeServiceClient
class.
public virtual Response<DataLakeFileSystemClient> CreateFileSystem(string fileSystemName, DataLakeFileSystemCreateOptions options = null, CancellationToken cancellationToken = default)
The CreateFileSystem
operation creates a new file system under the specified account. If the file systen with the
same name already exists, the operation fails.
For more information, see
Create Container.
public virtual Response<DataLakeFileSystemClient> CreateFileSystem(string fileSystemName, PublicAccessType publicAccessType, IDictionary<string, string> metadata, CancellationToken cancellationToken)
The CreateFileSystem
operation creates a new file system under the specified account. If the file systen with the
same name already exists, the operation fails.
For more information, see
Create Container.
public virtual Task<Response<DataLakeFileSystemClient>> CreateFileSystemAsync(string fileSystemName, DataLakeFileSystemCreateOptions options = null, CancellationToken cancellationToken = default)
The CreateFileSystem
operation creates a new
file system under the specified account. If the file system with the
same name already exists, the operation fails.
For more information, see
Create Container.
public virtual Task<Response<DataLakeFileSystemClient>> CreateFileSystemAsync(string fileSystemName, PublicAccessType publicAccessType, IDictionary<string, string> metadata, CancellationToken cancellationToken)
The CreateFileSystemAsync
operation creates a new file system under the specified account. If the file system with the
same name already exists, the operation fails.
For more information, see
Create Container.
public virtual Response DeleteFileSystem(string fileSystemName, DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The DeleteFileSystem operation marks the
specified file system for deletion.
For more information, see
Delete Container.
public virtual Task<Response> DeleteFileSystemAsync(string fileSystemName, DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The DeleteFileSystemAsync operation marks the
specified file system for deletion.
For more information, see
Delete Container.
public Uri GenerateAccountSasUri(AccountSasPermissions permissions, DateTimeOffset expiresOn, AccountSasResourceTypes resourceTypes)
The GenerateAccountSasUri
returns a Uri that generates a DataLake Account
Shared Access Signature (SAS) based on the Client properties
and parameters passed. The SAS is signed by the
shared key credential of the client.
To check if the client is able to sign a Service Sas see
CanGenerateAccountSasUri.
For more information, see
Constructing an Account SAS.
public Uri GenerateAccountSasUri(AccountSasPermissions permissions, DateTimeOffset expiresOn, AccountSasResourceTypes resourceTypes, out string stringToSign)
The GenerateAccountSasUri
returns a Uri that generates a DataLake Account
Shared Access Signature (SAS) based on the Client properties
and parameters passed. The SAS is signed by the
shared key credential of the client.
To check if the client is able to sign a Service Sas see
CanGenerateAccountSasUri.
For more information, see
Constructing an Account SAS.
The GenerateAccountSasUri returns a Uri
that generates a DataLake Account Shared Access Signature (SAS)
based on the Client properties and builder passed.
The SAS is signed by the shared key credential of the client.
To check if the client is able to sign a Service Sas see
CanGenerateAccountSasUri.
For more information, see
Constructing an Account SAS.
The GenerateAccountSasUri returns a Uri
that generates a DataLake Account Shared Access Signature (SAS)
based on the Client properties and builder passed.
The SAS is signed by the shared key credential of the client.
To check if the client is able to sign a Service Sas see
CanGenerateAccountSasUri.
For more information, see
Constructing an Account SAS.
Create a new DataLakeFileSystemClient object by appending
fileSystemName to the end of Uri.
The new DataLakeFileSystemClient uses the same request
policy pipeline as the DataLakeFileSystemClient.
public virtual Pageable<FileSystemItem> GetFileSystems(FileSystemTraits traits = 0, FileSystemStates states = 0, string prefix = null, CancellationToken cancellationToken = default)
The GetFileSystems
operation returns an async sequence of file systems in the storage account. Enumerating the
file systems may make multiple requests to the service while fetching
all the values. File systems are ordered lexicographically by name.
For more information, see
List Containers.
public virtual Pageable<FileSystemItem> GetFileSystems(FileSystemTraits traits, string prefix, CancellationToken cancellationToken)
The GetFileSystems
operation returns an async sequence of file systems in the storage account.
Enumerating the file systems may make multiple requests to the service while fetching
all the values. File systems are ordered lexicographically by name.
For more information, see
List Containers.
public virtual AsyncPageable<FileSystemItem> GetFileSystemsAsync(FileSystemTraits traits = 0, FileSystemStates states = 0, string prefix = null, CancellationToken cancellationToken = default)
The GetFileSystemsAsync
operation returns an async sequence of file systems in the storage account. Enumerating the
files systems may make multiple requests to the service while fetching
all the values. File systems are ordered lexicographically by name.
For more information, see
List Containers.
public virtual AsyncPageable<FileSystemItem> GetFileSystemsAsync(FileSystemTraits traits, string prefix, CancellationToken cancellationToken)
The GetFileSystemsAsync
operation returns an async sequence of file systems in the storage account.
Enumerating the files systems may make multiple requests to the service while fetching
all the values. File systems are ordered lexicographically by name.
For more information, see
List Containers.
public virtual Response<DataLakeServiceProperties> GetProperties(CancellationToken cancellationToken = default)
The GetProperties operation gets the properties
of a storage account’s Data Lake service, including properties for
Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
For more information, see
Get Blob Service Properties.
public virtual Task<Response<DataLakeServiceProperties>> GetPropertiesAsync(CancellationToken cancellationToken = default)
The GetPropertiesAsync operation gets the properties
of a storage account’s Data Lake service, including properties for
Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
For more information, see
Get Blob Service Properties.
public virtual Response<UserDelegationKey> GetUserDelegationKey(DateTimeOffset? startsOn, DateTimeOffset expiresOn, CancellationToken cancellationToken = default)
The GetUserDelegationKey operation retrieves a
key that can be used to delegate Active Directory authorization to
shared access signatures created with DataLakeSasBuilder.
public virtual Task<Response<UserDelegationKey>> GetUserDelegationKeyAsync(DateTimeOffset? startsOn, DateTimeOffset expiresOn, CancellationToken cancellationToken = default)
The GetUserDelegationKeyAsync operation retrieves a
key that can be used to delegate Active Directory authorization to
shared access signatures created with DataLakeSasBuilder.
public virtual Response SetProperties(DataLakeServiceProperties properties, CancellationToken cancellationToken = default)
The SetProperties operation sets properties for
a storage account’s Data Lake service endpoint, including properties
for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules
and soft delete settings. You can also use this operation to set
the default request version for all incoming requests to the Blob
service that do not have a version specified.
For more information, see
Set Blob Service Properties.
public virtual Task<Response> SetPropertiesAsync(DataLakeServiceProperties properties, CancellationToken cancellationToken = default)
The SetPropertiesAsync operation sets properties for
a storage account’s Data Lake service endpoint, including properties
for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules
and soft delete settings. You can also use this operation to set
the default request version for all incoming requests to the Blob
service that do not have a version specified.
For more information, see
Set Blob Service Properties.
public virtual Response<DataLakeFileSystemClient> UndeleteFileSystem(string deletedFileSystemName, string deleteFileSystemVersion, CancellationToken cancellationToken = default)
Restores a previously deleted file system.
This API is only functional is Container Soft Delete is enabled
for the storage account associated with the filesystem.
public virtual Task<Response<DataLakeFileSystemClient>> UndeleteFileSystemAsync(string deletedFileSystemName, string deleteFileSystemVersion, CancellationToken cancellationToken = default)
Restores a previously deleted file system.
This API is only functional is Container Soft Delete is enabled
for the storage account associated with the filesystem.