当我使用此函数中func new --name MyHttpTrigger --template "HttpTrigger"没有function.json创建的方法添加新函数时,当我尝试将其添加到当前目录并运行时func start --build,出现此错误:
你可以在这里找到我的function.json内容:
{
"disabled": false,
"bindings": [
{
"authLevel": "anonymous",
"name": "req",
"type": "httpTrigger",
"direction": "in"
},
{
"name": "res",
"type": "http",
"direction": "out"
}
]
}
Run Code Online (Sandbox Code Playgroud)
namespace final
{
public static class httpTrigger
{
[FunctionName("httpTrigger")]
public static async Task<IActionResult> Run(
[HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req,
ILogger log)
{
log.LogInformation("C# HTTP trigger …Run Code Online (Sandbox Code Playgroud)