问题描述
我正在使用 node 和 Azure Functions 来使用 functions.json 中定义的绑定来更新我的 azure 表.我能够使用出绑定插入行,但找不到任何有关如何更新它们的文档.
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"
}
函数定义
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.
我知道我可以使用 sdk 手动更新表格,但我想使用绑定并尽可能保持功能简单.
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.
推荐答案
Azure WebJobs SDK 似乎尚不支持此功能,因此它在 Azure Functions 中也不起作用.
Looks like this is not yet supported by Azure WebJobs SDK so it doesn't work in Azure Functions either.
在请求相同功能的 github 存储库积压中发现问题 https://github.com/Azure/azure-webjobs-sdk/issues/919
Found an issue in the github repository backlog requesting the same feature https://github.com/Azure/azure-webjobs-sdk/issues/919
这篇关于如何使用绑定更新 Azure 函数中的 Azure 表行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!