简体   繁体   English

Azure Functions V3 中的命名空间或 Nuget 绑定 BlobProperties

[英]Which Namespace or Nuget Binding BlobProperties in Azure Functions V3

Is there a Nuget/Assembly/Library that will allow me to bind BlobProperties for .NET Core Azure 3.x Functions, in both a local environment and in an Azure environment?是否有 Nuget/Assembly/Library 允许我在本地环境和 Azure 环境中为 .NET Core Azure 3.x 函数绑定 BlobProperties?

I have an Azure Function running on .NET Core 3 with a signature that looks like this:我有一个在 .NET Core 3 上运行的 Azure 函数,其签名如下所示:

public async Task DoFunctionWork([BlobTrigger("path/to/{blobName}")] Stream blobStream, 
**Microsoft.Azure.Storage.Blob.BlobProperties Properties**)
{
    //Function Body....
}

The problem is with the Properties parameter.问题出在 Properties 参数上。 If run locally, it can only be resolved if I prefix the BlobProperties parameter with the Microsoft.Azure.Storage.Blob namespace as above.如果在本地运行,则只有在 BlobProperties 参数前面加上 Microsoft.Azure.Storage.Blob 命名空间作为前缀才能解决它。 In Azure, it never seems to work.在 Azure 中,它似乎永远不会奏效。 When it fails - on either Azure or locally - I get one of the following messages:当它失败时 - 在 Azure 或本地 - 我收到以下消息之一:

Can't bind properties to type 'Azure.Storage.Blob.Properties' or Can't bind properties to type 'Microsoft.Azure.Storage.Blob.Properties'

Has anyone encountered this before?有没有人遇到过这个? How did you solve it?你是怎么解决的?

Thanks.谢谢。

It looks like this is because, there is a version mismatch between what your SDK requires and what you have installed.看起来这是因为,您的 SDK 需要的版本与您安装的版本之间存在版本不匹配。

For instance, if you are using 3.0.9 version of Function SDK, then you might have installed Microsoft.Azure.WebJobs other than (>= 3.0.0 && < 3.1.0) versions.例如,如果您使用的是 3.0.9 版本的 Function SDK,那么您可能安装了除(>= 3.0.0 && < 3.1.0)版本之外的Microsoft.Azure.WebJobs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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