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.
Get it From Nuget
(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;Add the following attributes that include the account FQDN, ApplicationId, Client Secret and Tenant Id.
[AdlsWatcherTrigger(FolderName ="/")]AdlsFileChangeEvent myfileEventView a sample function using output 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.
- Azure Data Lake Store
- Setup Service to Service Auth using Azure AD
- Azure Functions and Webjobs tools extension
- Add the application settings noted below.
{
"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>"
}
}
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.
This project is under the benevolent umbrella of the .NET Foundation and is licensed under the MIT License
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.