Skip to content

PeterDowdy/Adlg2Helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecated - Azure SDK now supports Azure Data Lake Gen2

I recommend that you use the NuGet package that Microsoft publishes: https://www.nuget.org/packages/Azure.Storage.Files.DataLake

Azure DataLake Gen2 Helper

Build status

This is a library wrapping calls to Azure DataLake Gen2's REST API (docs here).

This first release is just a helper that makes it easier to make correct calls to the API. Later releases will provide helpers to assist with more complex tasks, such as automatically segmenting and uploading large files.

This library depends on Newtonsoft.Json becuase all libraries do, and on Polly to provide retry semantics.

Getting started

This release supports shared key authentication or oauth.. Install in your application like this:

var host = new HostBuilder()
    .ConfigureServices(svc =>
        {
            svc.AddAzureDataLakeGen2Client(options =>
            {
                options.AuthorizeWithAccountNameAndKey("account name", "shared key");
                // or //
                options.AuthorizeWithAccountNameAndAzureOauth("account name", "tenant id", "client id", "client secret");
				// or //
				options.AuthorizeWithSharedAccessSignature("account name", "shared access signature");
            });
        })
    .Build();
//later in your code
var pathClient = services.GetRequiredService<Adlg2PathClient>();
var filesystemClient = services.GetRequiredService<Adlg2FilesystemClient>();

Or create it directly using the factory:

var pathClient = Adlg2ClientFactory.BuildPathClient("account name", "shared key");
// or //
var pathClient = Adlg2ClientFactory.BuildPathClient("account name", "tenant id", "client id", "client secret");

var filesystemClient = Adlg2ClientFactory.BuildFilesystemClient("account name", "shared key");
// or //
var filesystemClient = Adlg2ClientFactory.BuildFilesystemClient("account name", "tenant id", "client id", "client secret");

Path client

The path client wraps the path API.

Filesystem client

The filesystem client wraps the filesystem API.

Finally

Let me know if this was useful for you or if you have suggestions or feature requests (issues welcome). The current roadmap is:

  • Allow configuration of retry policies.
  • Create helpers to segment upload and download of large files.
  • Clean up some of the tech debt in the 0.X release and get ready for a 1.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages