question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

C#: Can't use CloudBlockBlob as input parameter

See original GitHub issue

I 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:closed
  • Created 8 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
mathewccommented, Mar 12, 2016

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

0reactions
lindydonnacommented, May 13, 2016

Awesome! Could you let me know when the fix is in staging or prod?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found