我刚刚将我的函数应用程序配置为使用 azure Active Directory。之后,我想通过更改 HttpTrigger 属性的枚举来停用功能级身份验证。然后我发现可以切换到“用户”授权级别,其描述为:
允许访问包含有效身份验证令牌的请求
部署函数后,我只收到 401 个未经授权的请求,因此我切换回匿名授权级别。
public enum AuthorizationLevel
{
//
// Summary:
// Allow access to anonymous requests.
Anonymous = 0,
//
// Summary:
// Allow access to requests that include a valid authentication token
User = 1,
//
// Summary:
// Allow access to requests that include a function key
Function = 2,
//
// Summary:
// Allows access to requests that include a system key
System = 3,
//
// Summary:
// Allow …Run Code Online (Sandbox Code Playgroud)