【问题标题】:How to update a Azure table row in Azure function using Bindings?如何使用绑定更新 Azure 函数中的 Azure 表行?
【发布时间】:2017-02-27 18:07:11
【问题描述】:

我正在使用 node 和 Azure Functions 来使用 functions.json 中定义的绑定来更新我的 azure 表。我能够使用出绑定插入行,但找不到任何有关如何更新它们的文档。

Functions.json

{
      "tableName": "myTable",
      "connection": "myTableConnectionString",
      "name": "tableBinding",
      "type": "table",
      "direction": "out"
    }

函数定义

Promise.map(loaders.map(e => e.getData()), (data) => {
    context.log("pushing to azure table");

    context.bindings.tableBinding.push({
      PartitionKey: data.key,
      RowKey: data.key,
      Value: data.Value
    });
  })
    .then(() => {
      context.log("Completed all data retrieveal tasks");
      context.log('JavaScript timer trigger function ran!', timeStamp);
      context.done();
    });

再次调用上面的函数没有效果。

我知道我可以使用 sdk 手动更新表格,但我想使用绑定并尽可能保持功能简单。

【问题讨论】:

    标签: node.js azure azure-functions azure-webjobssdk


    【解决方案1】:

    Azure WebJobs SDK 似乎尚不支持此功能,因此它在 Azure Functions 中也不起作用。

    在请求相同功能的 github 存储库积压中发现问题 https://github.com/Azure/azure-webjobs-sdk/issues/919

    【讨论】:

    • 我已将此帖子链接到您在上面链接的错误。我们会考虑获得这种支持,谢谢:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-04-07
    • 1970-01-01
    • 1970-01-01
    • 2020-08-09
    • 1970-01-01
    • 1970-01-01
    • 2018-03-30
    相关资源
    最近更新 更多