Closed vanillajonathan closed 1 month ago
I'm hitting the same problem, seems to be contrary to the documentation. Looking at the error it seems to be trying to convert to JSON?!
Not working
[Function(nameof(DeliveryFunction))]
[BlobOutput("processed/{name}", Connection = "Storage")]
public async Task<byte[]> Run([BlobTrigger("reporting/{name}", Connection = "Storage")] Stream inputStream, string name)
{ }
Error
Error converting 1 input parameters for Function 'DeliveryFunction': Cannot convert input parameter 'inputStream' to type 'System.IO.Stream' from type 'System.ReadOnlyMemory`1[[System.Byte, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]'.
Error:System.Text.Json.JsonException: '-' is invalid within a number, immediately after a sign character ('+' or '-'). Expected a digit ('0'-'9'). Path: $ | LineNumber: 0 | BytePositionInLine: 1.
If I take off the [BlobOutput]
attribute then it works
[Function(nameof(DeliveryFunction))]
public async Task Run([BlobTrigger("reporting/{name}", Connection = "Storage")] Stream inputStream, string name)
{ }
@vanillajonathan Could you refactor your function to look more like this example? Input bindings shouldn't be combined for one parameter (best practice is to have one binding -> one parameter).
@matt-lethargic I think you are facing a a different issue described here: https://github.com/Azure/azure-functions-dotnet-worker/issues/1969
Closing as answered - @matt-lethargic if the linked issue and explanation does not help solve your problem, please open up a new issue to track. Thanks!
@satvu Yes, I can refactor my function to look more like that example but I think Azure function should either be able to handle multiple attributes on a parameter or it should throw a exception with a friendly error message.
Description
I cannot bind a parameter such as
client
with both theBlobTrigger
and theBlobInput
attributes.Steps to reproduce