![]() |
VOOZH | about |
dotnet add package Azure.Storage.Files.DataLake --version 12.27.0
NuGet\Install-Package Azure.Storage.Files.DataLake -Version 12.27.0
<PackageReference Include="Azure.Storage.Files.DataLake" Version="12.27.0" />
<PackageVersion Include="Azure.Storage.Files.DataLake" Version="12.27.0" />Directory.Packages.props
<PackageReference Include="Azure.Storage.Files.DataLake" />Project file
paket add Azure.Storage.Files.DataLake --version 12.27.0
#r "nuget: Azure.Storage.Files.DataLake, 12.27.0"
#:package Azure.Storage.Files.DataLake@12.27.0
#addin nuget:?package=Azure.Storage.Files.DataLake&version=12.27.0Install as a Cake Addin
#tool nuget:?package=Azure.Storage.Files.DataLake&version=12.27.0Install as a Cake Tool
Server Version: 2021-02-12, 2020-12-06, 2020-10-02, 2020-08-04, 2020-06-12, 2020-04-08, 2020-02-10, 2019-12-12, 2019-07-07, and 2019-02-02
Azure Data Lake includes all the capabilities required to make it easy for developers, data scientists, and analysts to store data of any size, shape, and speed, and do all types of processing and analytics across platforms and languages. It removes the complexities of ingesting and storing all of your data while making it faster to get up and running with batch, streaming, and interactive analytics.
Source code | Package (NuGet) | API reference documentation | REST API documentation | Product documentation
Install the Azure Storage Files Data Lake client library for .NET with NuGet:
dotnet add package Azure.Storage.Files.DataLake
You need an Azure subscription and a Storage Account to use this package.
To create a new Storage Account, you can use the Azure Portal, Azure PowerShell, or the Azure CLI. Here's an example using the Azure CLI:
az storage account create --name MyStorageAccount --resource-group MyResourceGroup --location westus --sku Standard_LRS
DataLake Storage Gen2 was designed to:
Key Features of DataLake Storage Gen2 include:
A fundamental part of Data Lake Storage Gen2 is the addition of a hierarchical namespace to Blob storage. The hierarchical namespace organizes objects/files into a hierarchy of directories for efficient data access.
In the past, cloud-based analytics had to compromise in areas of performance, management, and security. Data Lake Storage Gen2 addresses each of these aspects in the following ways:
Data Lake Storage Gen2 offers two types of resources:
| ADLS Gen2 | Blob |
|---|---|
| Filesystem | Container |
| Path (File or Directory) | Blob |
Note: This client library does not support hierarchical namespace (HNS) disabled storage accounts.
We guarantee that all client instance methods are thread-safe and independent of each other (guideline). This ensures that the recommendation of reusing client instances is always safe, even across threads.
Client options | Accessing the response | Long-running operations | Handling failures | Diagnostics | Mocking | Client lifetime
StorageSharedKeyCredential sharedKeyCredential = new StorageSharedKeyCredential(storageAccountName, storageAccountKey);
// Create DataLakeServiceClient using StorageSharedKeyCredentials
DataLakeServiceClient serviceClient = new DataLakeServiceClient(serviceUri, sharedKeyCredential);
StorageSharedKeyCredential sharedKeyCredential = new StorageSharedKeyCredential(storageAccountName, storageAccountKey);
// Create DataLakeServiceClient using StorageSharedKeyCredentials
DataLakeServiceClient serviceClient = new DataLakeServiceClient(serviceUri, sharedKeyCredential);
// Create a DataLake Filesystem
DataLakeFileSystemClient filesystem = serviceClient.GetFileSystemClient("sample-filesystem");
filesystem.Create();
StorageSharedKeyCredential sharedKeyCredential = new StorageSharedKeyCredential(storageAccountName, storageAccountKey);
// Create DataLakeServiceClient using StorageSharedKeyCredentials
DataLakeServiceClient serviceClient = new DataLakeServiceClient(serviceUri, sharedKeyCredential);
// Get a reference to a filesystem named "sample-filesystem-append" and then create it
DataLakeFileSystemClient filesystem = serviceClient.GetFileSystemClient("sample-filesystem-append");
filesystem.Create();
// Create
DataLakeDirectoryClient directory = filesystem.GetDirectoryClient("sample-file");
directory.Create();
Create DataLakeFileClient from a DataLakeDirectoryClient
// Create a DataLake Directory
DataLakeDirectoryClient directory = filesystem.CreateDirectory("sample-directory");
directory.Create();
// Create a DataLake File using a DataLake Directory
DataLakeFileClient file = directory.GetFileClient("sample-file");
file.Create();
Create DataLakeFileClient from a DataLakeFileSystemClient
// Create a DataLake Filesystem
DataLakeFileSystemClient filesystem = serviceClient.GetFileSystemClient("sample-filesystem");
filesystem.Create();
// Create a DataLake file using a DataLake Filesystem
DataLakeFileClient file = filesystem.GetFileClient("sample-file");
file.Create();
// Create a file
DataLakeFileClient file = filesystem.GetFileClient("sample-file");
file.Create();
// Append data to the DataLake File
file.Append(File.OpenRead(sampleFilePath), 0);
file.Flush(SampleFileContent.Length);
Response<FileDownloadInfo> fileContents = file.Read();
Response<DataLakeFileReadStreamingResult> fileContents = file.ReadStreaming();
Stream readStream = fileContents.Value.Content;
Response<DataLakeFileReadResult> fileContents = file.ReadContent();
BinaryData readData = fileContents.Value.Content;
foreach (PathItem pathItem in filesystem.GetPaths())
{
names.Add(pathItem.Name);
}
// Create a DataLake file so we can set the Access Controls on the files
DataLakeFileClient fileClient = filesystem.GetFileClient("sample-file");
fileClient.Create();
// Set the Permissions of the file
PathPermissions pathPermissions = PathPermissions.ParseSymbolicPermissions("rwxrwxrwx");
fileClient.SetPermissions(permissions: pathPermissions);
// Create a DataLake file so we can set the Access Controls on the files
DataLakeFileClient fileClient = filesystem.GetFileClient("sample-file");
fileClient.Create();
// Set Access Control List
IList<PathAccessControlItem> accessControlList
= PathAccessControlExtensions.ParseAccessControlList("user::rwx,group::r--,mask::rwx,other::---");
fileClient.SetAccessControlList(accessControlList);
// Get Access Control List
PathAccessControl accessControlResponse = fileClient.GetAccessControl();
DataLakeFileClient renamedFileClient = fileClient.Rename("sample-file2");
DataLakeDirectoryClient renamedDirectoryClient = directoryClient.Rename("sample-directory2");
// Get Properties on a File
PathProperties filePathProperties = fileClient.GetProperties();
// Get Properties on a Directory
PathProperties directoryPathProperties = directoryClient.GetProperties();
All File DataLake service operations will throw a
RequestFailedException on failure with
helpful ErrorCodes. Many of these errors are recoverable.
If multiple failures occur, an AggregateException will be thrown,
containing each failure instance.
Get started with our DataLake samples:
See the Storage CONTRIBUTING.md for details on building, testing, and contributing to this library.
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit cla.microsoft.com.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 net5.0 was computed. net5.0-windows net5.0-windows was computed. net6.0 net6.0 was computed. net6.0-android net6.0-android was computed. net6.0-ios net6.0-ios was computed. net6.0-maccatalyst net6.0-maccatalyst was computed. net6.0-macos net6.0-macos was computed. net6.0-tvos net6.0-tvos was computed. net6.0-windows net6.0-windows was computed. net7.0 net7.0 was computed. net7.0-android net7.0-android was computed. net7.0-ios net7.0-ios was computed. net7.0-maccatalyst net7.0-maccatalyst was computed. net7.0-macos net7.0-macos was computed. net7.0-tvos net7.0-tvos was computed. net7.0-windows net7.0-windows was computed. net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 was computed. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 netcoreapp2.0 was computed. netcoreapp2.1 netcoreapp2.1 was computed. netcoreapp2.2 netcoreapp2.2 was computed. netcoreapp3.0 netcoreapp3.0 was computed. netcoreapp3.1 netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 netstandard2.0 is compatible. netstandard2.1 netstandard2.1 was computed. |
| .NET Framework | net461 net461 was computed. net462 net462 was computed. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
| MonoAndroid | monoandroid monoandroid was computed. |
| MonoMac | monomac monomac was computed. |
| MonoTouch | monotouch monotouch was computed. |
| Tizen | tizen40 tizen40 was computed. tizen60 tizen60 was computed. |
| Xamarin.iOS | xamarinios xamarinios was computed. |
| Xamarin.Mac | xamarinmac xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos xamarinwatchos was computed. |
Showing the top 5 NuGet packages that depend on Azure.Storage.Files.DataLake:
| Package | Downloads |
|---|---|
|
Aspire.Hosting.Azure.Storage
Azure Storage resource types for Aspire. |
|
|
Aspire.Hosting.Azure.Functions
Azure Functions resource types for Aspire. |
|
|
Aspire.Hosting.Azure.Sql
Azure SQL Database resource types for Aspire. |
|
|
Aspire.Hosting.Azure.EventHubs
Azure Event Hubs resource types for Aspire. |
|
|
Service.Extensions.Azure.DataLake
Extensions to provide consistent configurations and patterns for your service. |
Showing the top 5 popular GitHub repositories that depend on Azure.Storage.Files.DataLake:
| Repository | Stars |
|---|---|
|
microsoft/aspire
Aspire is the tool for code-first, extensible, observable dev and deploy.
|
|
|
Azure/azure-powershell
Microsoft Azure PowerShell
|
|
|
dotnet/extensions
This repository contains a suite of libraries that provide facilities commonly needed when creating production-ready applications.
|
|
|
Azure/azure-mcp
The Azure MCP Server, bringing the power of Azure to your agents.
|
|
|
managedcode/Storage
Storage library provides a universal interface for accessing and manipulating data in different cloud blob storage providers
|
| Version | Downloads | Last Updated |
|---|---|---|
| 12.27.0 | 24,102 | 6/4/2026 |
| 12.27.0-beta.1 | 449 | 3/24/2026 |
| 12.26.0 | 204,770 | 5/13/2026 |
| 12.26.0-beta.1 | 1,262 | 1/20/2026 |
| 12.25.0 | 636,771 | 1/8/2026 |
| 12.25.0-beta.1 | 2,087 | 11/17/2025 |
| 12.24.0 | 486,693 | 10/13/2025 |
| 12.24.0-beta.1 | 5,154 | 6/9/2025 |
| 12.23.0 | 1,496,646 | 7/15/2025 |
| 12.23.0-beta.1 | 2,990 | 5/6/2025 |
| 12.22.0 | 1,003,040 | 3/12/2025 |
| 12.22.0-beta.1 | 1,037 | 2/11/2025 |
| 12.21.0 | 1,343,461 | 11/12/2024 |
| 12.21.0-beta.2 | 691 | 10/10/2024 |
| 12.21.0-beta.1 | 225 | 10/8/2024 |
| 12.20.1 | 547,437 | 10/11/2024 |
| 12.20.0 | 264,414 | 9/19/2024 |
| 12.20.0-beta.1 | 4,004 | 8/7/2024 |
| 12.19.1 | 584,688 | 7/25/2024 |
| 12.19.0 | 68,207 | 7/16/2024 |