How to update a Azure table row in Azure function using Bindings?

让人想犯罪 __ 提交于 2019-12-01 07:48:22

问题


I am using node and Azure Functions to update my azure table using Bindings defined in functions.json. I was able to insert rows using out binding but can't find any documentation on how to update them.

Functions.json

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

function definition

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();
    });

Calling the function above again has no effect.

I understand that I can use the sdk to manually update the table but I would like to use the bindings and keep the function as simple as possible.


回答1:


Looks like this is not yet supported by Azure WebJobs SDK so it doesn't work in Azure Functions either.

Found an issue in the github repository backlog requesting the same feature https://github.com/Azure/azure-webjobs-sdk/issues/919



来源:https://stackoverflow.com/questions/42492777/how-to-update-a-azure-table-row-in-azure-function-using-bindings

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!