简体   繁体   中英

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://docs.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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM