C#: Can't use CloudBlockBlob as input parameter
See original GitHub issueI want to use a CloudBlockBlob as a binding parameter, but I get an exception from the function script host when I try to do this.
C# function:
public static void Run(CloudBlockBlob blobInput, TraceWriter log)
Binding:
{
"bindings": [
{
"type": "queueTrigger",
"direction": "in",
"queueName": "resizerequest"
},
{
"type": "blob",
"name": "blobInput",
"direction": "in",
"path": "{BlobNameLG}/{FileName}"
}
]
}
Then, in the log stream, I see this:
System.InvalidOperationException: Cannot bind blob to CloudBlockBlob using access Read.
at Microsoft.Azure.WebJobs.Host.Blobs.ConverterArgumentBindingProvider`1.TryCreate(ParameterInfo parameter, Nullable`1 access)
...
I see the same issue if I try to do an output binding with CloudBlockBlob. A Stream binding seems to work fine, however.
Issue Analytics
- State:
- Created 8 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
Cannot use CloudBlockBlob as input parameter for an ...
Net 6 (C#) I'm trying to get a CloudBlockBlob instead of a Stream, whenever a new blob is stored on an azure blob...
Read more >Cannot use CloudBlockBlob as input parameter for an azure ...
I'm trying to get a CloudBlockBlob instead of a Stream, whenever a new blob is stored on an azure blob storage. The reason...
Read more >c# - Azure function - Setting CloudBlockBlob metadata on a ...
I've created an Azure function in which I'd like to retrieve information from an input blob and set metadata on a newly created...
Read more >Azure Function v3 unable to bind blob to CloudBlockBlob
I use Azure Functions v3 based on target framework netcoreapp3.1. For my function with Blob trigger I get the following error message:.
Read more >com.microsoft.azure.storage.blob.CloudBlockBlob.delete ...
upload. Uploads the source stream data to the blob, using the specified lease ID, request options, and opera · deleteIfExists · getProperties ·...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Supported bindings are detailed here: http://go.microsoft.com/fwlink/?LinkID=524028&clcid=0x409
Likely the issue is we’re only binding BlobAttribute using FileAccess.Read (the default), not taking the binding direction into account. If CloudBlockBlob only supports RW as the PDF indicates, we probably need to have direction=inout, and when we bind, we interpret that as FileAccess.ReadWrite
Awesome! Could you let me know when the fix is in staging or prod?