我正在使用 azure 表存储来保存数据。我想将该方法创建为 azure 函数。当我本地调试时,它工作正常。当将其添加到azure函数中时,出现异常错误
找不到方法:' bool 值 Microsoft.WindowsAzure.Storage.Table.CloudTable.CreateIfNotExists。
CloudTableClient tableClient = cloudStorageAccount.CreateCloudTableClient();
if (tableClient != null)
{
CloudTable table = tableClient.GetTableReference(reference);
table.CreateIfNotExists();
TableOperation insertOperation = TableOperation.Insert(entity);
table.Execute(insertOperation);
return true;
}
和 WindowsAzure.Storage 包配置,
<package id="WindowsAzure.Storage" version="7.2.1" targetFramework="net461" />
最佳答案
将 nuget 更新到 WindowsAzure.Storage 9.3.3 https://www.nuget.org/packages/WindowsAzure.Storage/然后发布它应该可以工作的函数,确保在应用程序设置中配置了连接字符串。
关于c# - Azure 函数 - 在 Azure 存储中找不到方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54575130/