【发布时间】:2018-08-11 07:48:46
【问题描述】:
我正在关注this documentation 为服务总线队列创建触发器。
我希望能够访问消息属性。我想我可以像这样简单地将Dictionary<string, object> properties 添加到参数列表中:
public static void Run(
[ServiceBusTrigger(QueueName, Connection = "connectionSetting")]
// Message message,
string myQueueItem,
Int32 deliveryCount,
DateTime enqueuedTimeUtc,
string messageId,
string ContentType,
Dictionary<string,object> properties,
TraceWriter log)
但这会引发:
错误索引方法“Program.Run”。 Microsoft.Azure.WebJobs.Host: 无法将参数“属性”绑定到类型 Dictionary`2。确保 绑定支持参数类型。
这里是a list 可能的参数绑定。我哪里错了?
更新:
我尝试将签名更改为
public static void Run(
[ServiceBusTrigger(QueueName, Connection = "connectionSetting")]
// Message message,
string myQueueItem,
Int32 deliveryCount,
DateTime enqueuedTimeUtc,
string messageId,
string ContentType,
IDictionary<string, object> properties,
TraceWriter log)
它会产生同样的错误:
错误索引方法“Program.Run”。 Microsoft.Azure.WebJobs.Host: 无法将参数“属性”绑定到 IDictionary 类型
【问题讨论】:
标签: azure azure-functions azureservicebus