我正在使用node和Azure Functions通过functions.json中定义的绑定(bind)来更新我的azure表。我能够使用 out 绑定(bind)插入行,但找不到任何有关如何更新它们的文档。
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 手动更新表,但我想使用绑定(bind)并保持功能尽可能简单。
最佳答案
看起来 Azure WebJobs SDK 尚不支持此功能,因此它也无法在 Azure Functions 中工作。
在 github 存储库积压中发现一个问题,请求相同的功能 https://github.com/Azure/azure-webjobs-sdk/issues/919
关于node.js - 如何使用绑定(bind)更新 Azure 函数中的 Azure 表行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42492777/