Azure函数自定义方法属性

问题描述 投票:0回答:1

我想要自定义函数属性

[FunctionName("Function1"),Authentication]
 public static IActionResult Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)]HttpRequest req, TraceWriter log)
{
}

[Authentication]是我的定制Authentication实施FunctionInvocationFilterAttribute。如果Authentication失败,我想直接返回IActionResultHttpResponse

我该怎么做呢?

azure-functions azure-webjobs
1个回答
1
投票

我认为还不支持从过滤器调用短路函数。请参阅跟踪此类请求的this issue

© www.soinside.com 2019 - 2024. All rights reserved.