我给一个天青功能情形:天青功能应用程序:无法绑定队列为类型 'Microsoft.WindowsAzure.Storage.Queue.CloudQueue'(的IBinder)
- HTTP触发。
- 基于我想读从适当的存储队列中的消息和数据返回HTTP参数。
下面是函数的代码(F#):
let Run(request: string, customerId: int, userName: string, binder: IBinder) =
let subscriberKey = sprintf "%i-%s" customerId userName
let attribute = new QueueAttribute(subscriberKey)
let queue = binder.Bind<CloudQueue>(attribute)
() //TODO: read messages from the queue
编译会成功(适当的NuGet引用开放包),但我得到的运行时异常:
Microsoft.Azure.WebJobs.Host:
Can't bind Queue to type 'Microsoft.WindowsAzure.Storage.Queue.CloudQueue'.
我的代码是基于从this article一个例子。
我在做什么错?
更新:现在我知道我没有指定连接名称的任何地方。我需要对基于IBinder
的队列访问进行绑定吗?
更新2:我function.json
文件:
{
"bindings": [
{
"type": "httpTrigger",
"name": "request",
"route": "retrieve/{customerId}/{userName}",
"authLevel": "function",
"methods": [
"get"
],
"direction": "in"
}
],
"disabled": false
}
当我试图删除的NuGet引用我'无法加载文件或程序集“Microsoft.WindowsAzure.Storage,版本= 8.0.1.0文化=中性公钥= 31bf3856ad364e35' 或它的一个依赖。定位的程序集清单定义与程序集引用不匹配。 (来自HRESULT的异常:0x80131040).' – Mikhail
基于https://docs.microsoft.com/zh-cn/azure/azure-functions/functions-bindings-storage-queue我认为输入绑定不支持队列..谢谢,我会尽力的! – Mikhail
我试着复制粘贴你的第二个代码,但是Portal给我错误,找不到'Microsoft.WindowsAzure.Storage',然后'我们无法访问你的函数应用程序(未找到)。请稍后再试'。 – Mikhail