Hos
Hos

Reputation: 601

Cannot bind BlobProperties in Azure Function

I am trying to create the following Azure Function in C#:

public static async Task Run([BlobTrigger("container/{name}.png", Connection = "StorageConn")]Stream myBlob, string name, Uri uri, BlobProperties properties, TraceWriter log)

but for some reason I keep receiving this error:

A ScriptHost error has occurred Microsoft.Azure.WebJobs.Host: Error indexing method 'TriggerSaveImgReference.Run'. Microsoft.Azure.WebJobs.Host: Can't bind parameter 'properties' to type 'Microsoft.WindowsAzure.Storage.Blob.BlobProperties'.

Error indexing method 'TriggerSaveImgReference.Run'

Microsoft.Azure.WebJobs.Host: Error indexing method 'TriggerSaveImgReference.Run'. Microsoft.Azure.WebJobs.Host: Can't bind parameter 'properties' to type 'Microsoft.WindowsAzure.Storage.Blob.BlobProperties'.

According to the documentation: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob

I should be able to use BlobProperties properties in my binding expression. Am I misunderstanding it? How do I get the BlobProperties?

I am using:

WindowsAzure.Storage version 8.5.0
Microsoft.NET.Sdk.Functions version 1.0.2

and the target .NET framework is 4.6.1

Upvotes: 1

Views: 812

Answers (1)

Mikhail Shilkov
Mikhail Shilkov

Reputation: 35154

Please remove the explicit reference to WindowsAzure.Storage package.

Microsoft.NET.Sdk.Functions has dependency on 7.x version of it, so your 8.x version conflicts.

Maybe upgrade Microsoft.NET.Sdk.Functions to 1.0.6 too, although I guess it doesn't matter in your case.

Upvotes: 0

Related Questions