【发布时间】:2022-01-14 23:48:21
【问题描述】:
我尝试使用 C# 和 .net 3.0.1 (runtime ~3) 和 Visual Studio 2019 开发 HTTP 触发 azure 函数。 在我的函数中,我想将数据写入 blob,并且我希望能够从请求正文中设置目标文件名。 我使用以下代码:
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
[Blob("reports/{reportname}", FileAccess.Write)] TextWriter report,
ILogger log)
{
但是当我运行函数时,我得到了错误:
Unable to resolve binding parameter 'reportname'. Binding expressions must map to either a value provided by the trigger or a property of the value the trigger is bound to, or must be a system binding expression (e.g. sys.randguid, sys.utcnow, etc.).
我已经阅读了有关绑定的内容,但我完全不明白如何创建正确的绑定或如何将绑定添加到 function.json 文件中。
谁能帮助/解释我做错了什么?
谢谢!
【问题讨论】:
标签: c# azure azure-functions azure-functions-runtime