[英]Input binding to custom class doesn't seem to work for blob
My Azure Function has two input parameters: 我的Azure函数有两个输入参数:
I am trying to bind both parameters to custom type (F# record in my case). 我试图将两个参数都绑定到自定义类型(在我的情况下为F#记录)。 Binding works fine for the trigger, but not for blog binding, which gives the following error: 绑定对于触发器有效,但不适用于博客绑定,这会产生以下错误:
Microsoft.Azure.WebJobs.Host: Error indexing method 'Functions.MailboxFanOut'.
Microsoft.Azure.WebJobs.Host: Can't bind Blob to type 'Run+CustomerName'.
Here is the code: 这是代码:
[<CLIMutable>]
type CustomerName = {
UserName: string
}
let Run(item: CustomerName, userNames: CustomerName, log: TraceWriter) =
log.Verbose("F# function executing")
Replacing F# record with a class doesn't help... 用类替换F#记录无济于事...
Here is the function definition: 这是函数定义:
{
"bindings": [
{
"type": "eventHubTrigger",
"name": "item",
"direction": "in",
"path": "blabla",
"connection": "eventhubs",
"consumerGroup": "$Default"
},
{
"type": "blob",
"name": "userNames",
"path": "tada/123",
"connection": "foo",
"direction": "in"
}
],
"disabled": false
}
The blob bindings unfortunately don't currently support POCO bindings as you'd expect. 不幸的是,blob绑定当前不像您期望的那样支持POCO绑定。 We have an open issue in our repo tracking this here . 我们的回购中有一个未解决的问题,我们在此处进行跟踪。
To work around that, I recommend binding to a Stream, string, or one of the other supported types and doing the deserialization into your POCO type in your method. 要解决此问题,建议您绑定到Stream,字符串或其他受支持的类型之一,并在方法中将反序列化为POCO类型。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.