看来我不能拥有使用 Blob 绑定的活动功能。以下给出了运行时错误:
[StorageAccount("AzureWebJobsStorage")]
[FunctionName("LoadBlobFromBlobStorage")]
public static async Task<string> Run([ActivityTrigger] string blobName,
[Blob("containerName/directoryName/{blobName}", FileAccess.ReadWrite, Connection = AzureWebJobsStorage")] CloudBlockBlob blob,
ILogger log)
{
...
}
我收到多个失败的绑定错误消息。Durable Functions 不能解析绑定吗?
编辑:添加错误消息(减少冗长......):
Azure Functions Core Tools (2.4.379 Commit hash: ab2c4db3b43f9662b82494800dd770698788bf2d)
Function Runtime Version: 2.0.12285.0
2019-02-21T18:25:32.165 [Error] Error indexing method 'LoadBlobFromBlobStorage'
Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexingException : Error indexing method 'LoadBlobFromBlobStorage' ---> System.InvalidOperationException : Can't bind Blob to type 'Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob'.
Possible causes:
1) Tried binding to 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobDirectory...' but user type assembly was 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobDirectory... .
2) Tried binding to 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobContainer...' but user type assembly was 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobDirectory... .
3) Tried binding to 'Microsoft.Azure.WebJobs.Host.Blobs.Bindings.BlobsExtensionConfigProvider+MultiBlobContext, Microsoft.Azure.WebJobs.Extensions.Storage, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' but user type assembly was 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobDirectory... .
4) Tried binding to 'System.IO.Stream, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' but user type assembly was 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobDirectory... .
5) Tried binding to 'Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob...' but user type assembly was 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobDirectory... .
6) Tried binding to 'Microsoft.WindowsAzure.Storage.Blob.CloudPageBlob...' but user type assembly was 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobDirectory... .
7) Tried binding to 'Microsoft.WindowsAzure.Storage.Blob.CloudAppendBlob...' but user type assembly was 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobDirectory... .
8) Tried binding to 'Microsoft.WindowsAzure.Storage.Blob.ICloudBlob...' but user type assembly was 'Microsoft.WindowsAzure.Storage.Blob.CloudBlobDirectory... .
at async Microsoft.Azure.WebJobs.Host.Bindings.GenericCompositeBindingProvider`1.TryCreateAsync[TAttribute](BindingProviderContext context) at C:\projects\azure-webjobs-sdk-rqm4t\src\Microsoft.Azure.WebJobs.Host\Bindings\BindingProviders\GenericCompositeBindingProvider.cs : 89
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()