是否可以(输入)绑定到 http 触发的函数中的表存储?
我正在尝试将输入绑定添加到具有以下属性的常规 http 触发函数内的表存储:
[Table("MyTable", "MyPartition", "{httpTrigger}")] MyPoco poco
Run Code Online (Sandbox Code Playgroud)
但是,当我执行它时,它返回以下错误:
[6/5/2019 5:36:38 PM] 发生了未处理的主机错误。[6/5/2019 5:36:38 PM] Microsoft.Azure.WebJobs.Host:无法从 Azure WebJobs SDK 调用“tableStorageInputBindingHttpTriggered”。是否缺少 Azure WebJobs SDK 属性?。
此外,在启动时,我收到此异常:
[6/5/2019 6:17:17 PM] tableStorageInputBindingHttpTriggered:Microsoft.Azure.WebJobs.Host:错误索引方法“tableStorageInputBindingHttpTriggered”。Microsoft.Azure.WebJobs.Host:无法解析绑定参数“httpTrigger”。绑定表达式必须映射到触发器提供的值或触发器绑定到的值的属性,或者必须是系统绑定表达式(例如 sys.randguid、sys.utcnow 等)。
这是完整的功能:
public class MyPoco
{
public string PartitionKey { get; set; }
public string RowKey { get; set; }
public string Directory { get; set; }
}
public static class tableStorageInputBindingHttpTriggered
{
[FunctionName("tableStorageInputBindingHttpTriggered")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, …Run Code Online (Sandbox Code Playgroud)