Fou*_*der 2 azure azure-functions
我正在将 WebApi 转换为 Azure Function 应用程序。它使用标头中的 SecurityToken 进行身份验证。使用 api,我放入了一个属性来调用身份验证逻辑,但这在 Azure 函数中不起作用。
[ApiAuthentication()]
[FunctionName("GetConfig")]
public static async Task<HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Function, "get")]HttpRequestMessage req, TraceWriter log)
{
Run Code Online (Sandbox Code Playgroud)
}
有没有办法让这个工作,或者有更好的方法?
ASP.Net WebAPI 属性在 Azure Functions 中不起作用(它们是两个独立的框架,虽然 AF 目前是在 WebAPI 之上实现的,但它并没有将其暴露给表面)。你有一些选择:
| 归档时间: |
|
| 查看次数: |
5073 次 |
| 最近记录: |