Azure / Azure/Azure-Functions

Error binding to blob storage output - WindowsAzure.Storage OR Microsoft.Azure.Storage.

Open
#1,404 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PowerShell
Stars
1.1k
Forks
215
Avg merge
4h 2m
Merged PRs (30d)
1

Description

Hello,
I am having problems binding an output to the CloudBlockBlob type using C#.
The http trigger is working, and the input binding is working.
I have no problems If I convert the type to TextWriter and use a type string. I am also able to bind using a Stream (although the output file is empty for some reason, even when the Stream is not)

I have imported the newer packages, but it looks like it is trying to reference the older versions which are no longer accessible through nuget
https://www.nuget.org/packages/WindowsAzure.Storage/

**ERROR MESSAGE:**
Function (azfun-pgpdecrypt-test3/PGPDecrypt) Error: Microsoft.Azure.WebJobs.Host: Error indexing method 'PGPDecrypt'. Microsoft.Azure.WebJobs.Host: Can't bind Blob to type 'Microsoft.Azure.Storage.Blob.CloudBlockBlob'. Possible causes: 1) Tried binding to 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobDirectory, Microsoft.WindowsAzure.Storage, Version=9.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' but user type assembly was 'Microsoft.Azure.Storage.Blob.CloudBlockBlob, Microsoft.Azure.Storage.Blob, Version=10.0.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35. 2) Tried binding to 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer, Microsoft.WindowsAzure.Storage, Version=9.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' but user type assembly was 'Microsoft.Azure.Storage.Blob.CloudBlockBlob...

**CSPROJ FILE:**
```


netstandard2.0
v2












PreserveNewest


PreserveNewest
Never

```

**BINDING ATTRIBUTES**
```
public static void Run( [HttpTrigger(AuthorizationLevel.Function, "post", "get", Route = null)] HttpRequest req,
[Blob("path/test.csv", FileAccess.Write, Connection = "AzureWebJobsStorage")] CloudBlockBlob Output,
[Blob("path/file.csv", FileAccess.Read, Connection = "AzureWebJobsStorage")] Stream myBlob,
ILogger log)

```

Thank you.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.