如何在java azure函数中使用绑定Cloudtable

时间:2018-03-29 17:04:27

标签: java azure azure-functions azure-functions-runtime

有没有办法在类似于c#

的java azure函数中绑定表
[FunctionName("TableInput")]
public static void Run(
[QueueTrigger("table-items")] string input, 
[Table("MyTable", "Http", "{queueTrigger}", Connection = 
"StorageConnectionAppSetting")] MyPoco poco, 
TraceWriter log)
{
...
}

这样的东西?我不想使用azure存储库来手动获取表。

1 个答案:

答案 0 :(得分:0)

使用TableInput注释:

@TableInput(name = "item", tableName = "MyTable", partitionKey = "Http", 
    rowKey = "{queueTrigger}", connection = "StorageConnectionAppSetting") MyPojo pojo

请参阅example in Building Microsoft Azure Functions in Java