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.

Can't use ICloudBlob or CloudBlockBlob for output bindings

See original GitHub issue

I’m trying to use ICloudBlob or CloudBlockBlob for blob output bindings. According to docs this should be supported.

I get the error:

Cannot bind blob to CloudBlockBlob using access Write

or

Cannot bind blob to ICloudBlob using access Write

My function is in F#, but I’ve tried C# as well and got the same error. Possibly related to this issue

Example C# repro:

#r "Microsoft.WindowsAzure.Storage"
using Microsoft.WindowsAzure.Storage.Blob;

public static void Run(Stream myBlob, string name, TraceWriter log, CloudBlockBlob outputBlob)
{
    log.Info($"C# Blob trigger function Processed blob\n Name:{name} \n Size: {myBlob.Length} Bytes");
}
{
  "bindings": [
    {
      "name": "myBlob",
      "type": "blobTrigger",
      "direction": "in",
      "path": "samples-workitems/{name}",
      "connection": "AzureWebJobsDashboard"
    },
    {
      "type": "blob",
      "name": "outputBlob",
      "path": "outcontainer/{rand-guid}",
      "connection": "AzureWebJobsDashboard",
      "direction": "out"
    }
  ],
  "disabled": false
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
christopherandersoncommented, Nov 21, 2016

Workaround: If you set direction for the “outputBlob” binding to “inout”, this should be enabled. We’ll be working to make it easier to add inout via the UX to prevent these issues.

0reactions
nzigelcommented, Jul 10, 2017

@leolorenzoluis maybe the container name “x” is too short and you don’t have a markup for the blob name

[Blob(“outputcontainer/{name}”, FileAccess.ReadWrite, Connection = “AzureWebJobsStorage”)]CloudBlockBlob outputBlob

worked for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to bind to ICloudBlob or some other (not string) type
Host: Can't bind BlobTrigger to type 'Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob'. Right now the function I'm trying out, is the one ...
Read more >
Azure Blob storage trigger and bindings for Azure Functions
Learn to use the Azure Blob storage trigger and bindings in Azure Functions. ... Allow a function to write blob storage data, Output...
Read more >
Cannot use CloudBlockBlob as input parameter for an ...
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 >
Adventures with Azure Functions: Blob Storage Triggers and ...
The output binding allows you to modify and delete blob storage data in an Azure Function. I created input binding examples for the...
Read more >
Azure WebJobs Storage Blobs client library for .NET
The output binding allows you to modify and delete blob storage data in an Azure Function. Please follow the input binding tutorial and...
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