Skip to content

asthanarht/AzureDataLakeFileWatcherTrigger

Repository files navigation

AzureDataLakeFileWatcherTrigger

Azure data lake file watcher is custom trigger extension for azure function and azure web job

The following binding can be used with Azure Functions v2 C# Class Library.

Instructions to Use

Get it From Nuget

NuGet package

(Install-Package AdlsFileWatcherTriggerExtension -Version 0.0.1(https://www.nuget.org/packages/AdlsFileWatcherTriggerExtension/)

Clone repo and add a reference to the * AdlsFileWatcherTriggerExtension;* project.

using AdlsFileWatcherTriggerExtension;

Output Binding

Add the following attributes that include the account FQDN, ApplicationId, Client Secret and Tenant Id.

[AdlsWatcherTrigger(FolderName ="/")]AdlsFileChangeEvent myfileEvent

View a sample function using output binding.

Input Binding

Add FoldereName property to retrieve a specific file watch from your Datalake Store.

public static class Function1
    {
        static int count = 1;
        [FunctionName("Function1")]
        
        public static void Run([AdlsWatcherTrigger(FolderName ="/")]AdlsFileChangeEvent myfileEvent, ILogger log)
        {
            log.LogInformation($"file found and name is {myfileEvent.FileFullPath} and count is  {count++}");
        }
    }

View a [sample function using input binding.

Binding Requirements

  1. Azure Data Lake Store
  2. Setup Service to Service Auth using Azure AD
  3. Azure Functions and Webjobs tools extension
  4. Add the application settings noted below.

local.settings.json expected content

{
  "IsEncrypted": false,
  "Values": {
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "AzureWebJobsDashboard": "UseDevelopmentStorage=true",
    "DataLakeName": "<your Data Lake Store Name>",
    "TenantId": "<Your Tenant Id>",
    "AppKey": "<your ADLS App Key>",
    "ClientId": "<your SPN Client id>"
  }
}

End to End Testing

If you wish to run and or make modifications to the E2E testing you will need to create an appsettings.json with all the required settings. Use the standard format for values instead of the functions formatting.

License

This project is under the benevolent umbrella of the .NET Foundation and is licensed under the MIT License

Contributing

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

About

Azure data lake file watcher is custom trigger extension for azure function and azure web job

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages