azure-webjobs-sdk-extensions
azure-webjobs-sdk-extensions copied to clipboard
ExternalFileTrigger not usable with Visual Studio Functions SDK
While attempting to use the External File Trigger on a locally-developed (VS 2017 Preview) Azure Function, I received error messages I was unable to work around.
Repro steps
Use the following function definition:
public static class FtpToBlobStorageOnFileChanged
{
[FunctionName("FtpToBlobStorageOnFileChanged")]
public static void Run(
[ApiHubFileTrigger(@"ChangeFeedFTPsource", "/", FileWatcherType.Created, pollIntervalInSeconds: 3)]object inputFile,
TraceWriter log,
[Blob(@"blobs-from-ftp/{rand-guid}", Connection = @"ChangeFeedFTPblobsStorage")]out string blobName)
{
log.Info(inputFile?.ToString() ?? @"[NULL]");
log.Info($"C# Timer trigger function executed at: {DateTime.Now}");
blobName = Guid.NewGuid().ToString();
}
}
where the ChangeFeedFTPsource
is an FTP server drop folder and ChangeFeedFTPblobsStorage
is an Azure Blob Storage instance with a container named blobs-from-ftp
.
Hit F5 to debug your Azure Function.
Expected behavior
Azure Function debugging starts, and the function executes when a file is dropped in the FTP folder.
Actual behavior
Function debugging fails to start, errors out with the message:
FtpToBlobStorageOnFileChange: Can't figure out which ctor to call.
Known workarounds
None.
Related information
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.ApiHub" Version="1.0.0-beta6" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DocumentDB" Version="1.1.0-beta4" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.5" />
Looks like you are missing the app setting name which contains the connection string to your FTP server. that should be the first parameter. more samples here: https://github.com/Azure/azure-webjobs-sdk-extensions/blob/v2.x/test/WebJobs.Extensions.Tests/Extensions/ApiHub/ApiHubFileTestJobs.cs
that's on line 5... no?