我正在尝试在 Visual Studio 2019 中运行 HTTP 触发的 v2 函数。它应该将其输出写入名为“历史记录”的 Azure 存储表中。
我用以下方法装饰了我的函数
[return: Table("history")]
我让它返回 的子类TableEntity。
这会导致出现“无法将表绑定到 CloudTable”的异常。异常的原因是CloudStorageAccount客户端代码中的检查:
bool bindsToEntireTable = tableAttribute.RowKey == null;
if (bindsToEntireTable)
{
// This should have been caught by the other rule-based binders.
// We never expect this to get thrown.
throw new InvalidOperationException("Can't bind Table to type '" + parameter.ParameterType + "'.");
}
另一个函数绑定到 aCloudTable作为输入参数并遇到相同的异常。
尽管绑定到CloudTable应该有效(https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-table#input---c-example---cloudtable),但它显然不起作用。
这是 Azure 存储客户端 SDK 中的错误还是我做错了什么?我引用这些 Nuget 包:
<PackageReference Include="Microsoft.Azure.Functions.Extensions" Version="1.0.0" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.DurableTask" Version="1.8.3" />
<PackageReference Include="Microsoft.Azure.WebJobs.Extensions.Storage" Version="3.0.6" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Sdk.Functions" Version="1.0.29" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
胡子哥哥
潇潇雨雨
相关分类