2

While using WindowsAzure.Storage 7.2.1 one function is fine, but other functions depend on 8.5 and they fail. If I'm using WindowsAzure.Storage 8.5 to upload blob file it throws an error:

Can't bind Blob to type Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob

How would you resolve such conflict?

Here is my code to upload a blob:

public static void Run(other params, IBinder binder)
{
        string fileUrl = $"test-blob/{Guid.NewGuid().ToString()}";                   
        var blob = binder.Bind<Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob>(new BlobAttribute(fileUrl));
        blob.UploadText($"test text file: {fileUrl}");
}
1gn1ter
  • 1,414
  • 2
  • 22
  • 47
  • Related: https://stackoverflow.com/questions/46940492/how-can-i-use-a-blobtrigger-to-bind-to-cloudblockblob-in-an-azure-function – Hackerman Apr 27 '18 at 15:29
  • when I remove dependency other function throws: "Microsoft.WindowsAzure.Storage, Version=8.5.0.0" – 1gn1ter Apr 27 '18 at 15:41

1 Answers1

3

You can't use any version of Microsoft.WindowsAzure.Storage higher than the one used by Functions runtime (7.2.1 for 1.x versions of Functions). Remove that reference from your project.

For further information see Binding redirect support.

Mikhail Shilkov
  • 34,128
  • 3
  • 68
  • 107