How to update a Azure table row in Azure function

2019-02-19 15:31发布

问题:

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