C# 具有输入数据存储绑定的Azure函数按队列触发
我正在尝试为队列触发函数创建一个输入数据存储绑定 VTRequest是推送到队列的对象,VTEntity是保存在db中的对象 如果function.jsonC# 具有输入数据存储绑定的Azure函数按队列触发,c#,azure,azure-storage,azure-functions,C#,Azure,Azure Storage,Azure Functions,我正在尝试为队列触发函数创建一个输入数据存储绑定 VTRequest是推送到队列的对象,VTEntity是保存在db中的对象 如果function.json { "bindings": [ { "name": "vtAPIRequest", "type": "queueTrigger", "direction": "in", "queueName": "vtqueue", "connection": "vt_STORAGE"
{
"bindings": [
{
"name": "vtAPIRequest",
"type": "queueTrigger",
"direction": "in",
"queueName": "vtqueue",
"connection": "vt_STORAGE"
},
{
"type": "table",
"name": "outVTAPIDataTable",
"tableName": "data",
"connection": "vt_STORAGE",
"direction": "out"
},
{
"type": "table",
"name": "vtDataRow",
"tableName": "VTData",
"partitionKey": "VT",
"rowKey": "{queueTrigger}.{hash}",
"take": 1,
"connection": "vt_STORAGE",
"direction": "in"
}
],
"disabled": false
}
using System;
public class VTEntity {
public string PartitionKey { get; set; }
public String RowKey { get; set; }
public string hash { get; set; }
public string userID { get; set; }
}
public class VTRequest {
public string hash { get; set; }
public string userID { get; set; }
}
public static void Run(VTRequest vtAPIRequest, VTEntity vtDataRow,
TraceWriter log, IAsyncCollector<VTEntity> outVTAPIDataTable) {
if(null != vtDataRow) {
.....
}
}
我在相关数据库中有此记录:
我想在DB中查询队列对象传递的哈希值vtAPIRequest.hash
有办法吗?您就快到了,只需将
rowKey
的绑定更改为
"rowKey": "{hash}",
哇!我几乎什么都试过了:)谢谢你的帮助!
"rowKey": "{hash}",