使用带有Dropbox连接器的azure功能输出参数

时间:2017-04-11 13:06:37

标签: azure dropbox azure-functions azure-logic-apps

我的流程非常简单:我希望每天运行一次azure函数,并使用其输出在Dropbox中创建文件。

该函数执行一些处理并返回一个具有2个属性的对象,即FileName和FileContent,两者都是字符串:

return new AzureFunctionResponse
{
    FileName = $"TestFile-{DateTimeOffset.UtcNow.ToUnixTimeMilliseconds()}",
    FileContent = "This is the file content"
};

我的问题是我不知道如何使用这两个属性来设置我的Dropbox连接器

这是我的LogicApp流程:

enter image description here

我想使用从AzureFunction返回的FileName和FileContent来填充Dropbox连接器中的相应字段,但我不知道如何设置它。我找了文档,但也许我找不到合适的地方,因为我找不到任何东西。

此处还有我的function.json文件中的绑定,如果有任何帮助的话。

{
  "disabled": false,
  "bindings": [
  {
      "type": "httpTrigger",
      "direction": "in",
      "webHookType": "genericJson",
      "name": "req"
    },
    {
      "type": "http",
      "direction": "out",
      "name": "res"
    }
}

2 个答案:

答案 0 :(得分:2)

在函数之后使用Parse JSON操作应该完全符合您的需要。将解析输出并在下一步中为您提供它们。

答案 1 :(得分:1)

另外,您可以在不使用Logic Apps的情况下实现整个功能。

使用计时器输入触发器和Api Hub文件输出绑定创建Azure功能。不需要HTTP绑定。

有关示例,请参阅If you don't override the method, then the last overriden method will be used.