Azure功能服务服务:应用程序未分配给角色

时间:2018-03-13 18:59:26

标签: azure azure-functions azure-authentication azure-service-runtime

我正在尝试使用azure函数设置服务,以便其他特殊应用程序注册可以调用它并具有读取任何内容的特殊权限。我刚刚开始,所以我想我会让我的服务只是像这样对自己进行身份验证:

var myAppId = "8d87ba47-3b51-4e24-a790-a966a0130ceb";
var authenticationContext = new AuthenticationContext(Settings.AadTenant, false);
var clientAssertionCertificate = new ClientAssertionCertificate(myAppId, ApplicationCertificate);
return authenticationContext.AcquireTokenAsync(myAppId, clientAssertionCertificate).Result.AccessToken;

当我运行它时,我收到以下错误:

Application '8d87ba47-3b51-4e24-a790-a966a0130ceb' is not assigned to a role for the application '8d87ba47-3b51-4e24-a790-a966a0130ceb'. 

我知道我已经将所有内容都正确连接,因为租户会识别所有ID,因此问题可能出现在我的App Registration清单中。但我认为我已经正确设置了我的应用程序清单:

"appId": "8d87ba47-3b51-4e24-a790-a966a0130ceb",
"appRoles": [
    {
        "allowedMemberTypes": [ "Application" ],
        "description": "Some services can have global access",
        "displayName": "ProductivityService Auth",
        "id": "8d87ba47-3b51-4e24-a790-a966a0130ceb",
        "isEnabled": true,
        "value": "GlobalReadAccess"
    }
],

我现在不知道该做什么。我不确定“value”参数应该包含哪些内容,但我找不到有关“appRoles”内部参数的任何详细信息,我发现的示例适用于授权用户。我试过“读者”和“作家”,但结果相同。想法?

0 个答案:

没有答案
相关问题