I need to get a Dropbox folder / one drive watch , and any file update or change gets FTP'd to output. To get familiar with I tried C# code shared by
but I get the following error message :- Process a file using Azure Function ======Update C# code that I have used ======
My run.csx is as below: using System;
public static void Run(string input, out string output, TraceWriter log)
{
log.Info($"C# SaaS trigger function processed a file!!");
output = input;
}
==========================
My function.json is as below :
{
"bindings": [
{
"type": "apiHubFileTrigger",
"name": "input",
"direction": "in",
"path": "/Docs/{name}",
"connection": "dropbox_DROPBOX"
},
{
"type": "apiHubFile",
"name": "output",
"direction": "out",
"path": "{name}",
"connection": "googledrive_GOOGLEDRIVE"
}
],
"disabled": false
}
where paths are modified because I was getting the below error:
Host Error: Microsoft.Azure.WebJobs.Extensions.ApiHub: Path 'input-cs' is invalid. IFolderItem.RootPath must be set to a valid directory location.
I played around, and removed the 'input-cs' and 'output-cs' in my function.json above,the above error goes away and compilation is succeeding but again in logs I dont find it proper. Log is as below:
2016-07-25T12:52:07.957 Script for function 'SaasFileTriggerCSharp1' changed. Reloading.
2016-07-25T12:52:07.957 Compiling function script.
2016-07-25T12:52:08.020 Compilation succeeded.
2016-07-25T12:52:29.137 Exception while executing function: Functions.SaasFileTriggerCSharp1. Microsoft.Azure.WebJobs.Host: One or more errors occurred. Exception binding parameter 'input'. Microsoft.Azure.ApiHub.Sdk: /apim/dropbox/8b82684e13e44f499752a742adc4d30d/datasets/default/GetFileContentByPath?path=%7B%0A%20%20%20%20%22name%22:%20%22IMG-20140517-WA0001.jpg%22%0A%7D.
Tried with C# and Node.js Saasfiletriggers and same exception. Below are the invocation log:
==================================================================== Failure: Exception binding parameter 'input'
input : /apim/dropbox/8b82684e13e44f499752a742adc4d30d/datasets/default/GetFileContentByPath?path=%7B%0A%20%22name%22%20:%20%22%22%0A%7D
ilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.Azure.WebJobs.Extensions.ApiHub.Common.GenericFileBinding
2.<BindAsync>d__11.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.WebJobs.Extensions.ApiHub.Common.GenericFileTriggerBindingProvider
2.GenericTriggerbinding.d__9.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.WebJobs.Host.Triggers.TriggeredFunctionBinding`1.d__7.MoveNext() --- End of inner exception stack trace --- at Microsoft.Azure.WebJobs.Host.Executors.DelayedException.Throw() at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.d__33.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.d__2e.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) at Microsoft.Azure.WebJobs.Host.Executors.FunctionExecutor.d__15.MoveNext() --- End of inner exception stack trace ---
====================================================================
Would there be any samples I could read or refer to adapt for my needs. Request suggestions and help.