当文件上传到sftp时,我们可以触发功能应用吗?

时间:2018-04-04 08:14:24

标签: c# azure azure-functions

当文件上传到sftp时,我们可以触发功能应用程序吗?我检查了整合 - >扳机 - >外部文件。我们有一个SFTP选项,我在那里创建了sftp连接。但是当文件上传到sftp时,我的函数没有被触发。你能帮帮我吗?

using System;

public static string Run(string inputFile, string name, TraceWriter log)
{
log.Info($"C# External trigger function processed file: " + name);
return inputFile;
}

结合

{
"bindings": [
{
  "type": "apiHubFileTrigger",
  "name": "inputFile",
  "direction": "in",
  "path": "sample/{name}",
  "connection": "sftp_SFTP"
}

],
"disabled": false
}

由于

1 个答案:

答案 0 :(得分:0)

如果我们创建外部文件触发器,我们可以知道外部文件触发器仍然是预览触发器

如果可以使用Logic App,我建议你现在可以使用Logic App而不是Azure functon外部文件触发器

根据我的测试,触发器不适用于默认模板。有时它以下列方式对我有用。

注意:以下方式有时适用于我

创建SFTP连接后,我们可以在资源组中获取SFTP API连接。有关详细信息,请参阅屏幕截图。

1.编辑SFTP连接API(添加密码)

enter image description here

2.使用Azure门户进行调试。也许得到错误信息绑定数据不包含预期值'name'

enter image description here

3.将绑定名称更改为其他名称并再次更改。

4.将新文件上传到SFTP路径,然后触发

enter image description here

相关问题