Http请求失败,因为获取AD OAuth令牌时出错:'AADSTS50001:名为https://management.azure.windows.net的应用程序

时间:2019-02-10 10:55:05

标签: azure azure-active-directory azure-logic-apps

我想通过逻辑APP中的rest API更改我的天蓝色分析服务的价格等级。 为此,我创建了API

在逻辑APP中,我已经设置了这样的请求

{
    "uri": "https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AnalysisServices/servers/{serverName}?api-version=2017-08-01",
    "method": "PATCH",
    "authentication": {
        "tenant": "GUID, which I get from Azure AD for AzureAS",
        "audience": "https://management.azure.windows.net",
        "clientId": "GUID, which I get from AzureAD for AzureAS",
        "secret": "*sanitized*",
        "type": "ActiveDirectoryOAuth"
    },
    "body": {
        "sku": {
            "capacity": 1,
            "name": "S4",
            "tier": "Standard"
        },
        "tags": {
            "testKey": "testValue"
        }
    }
}

发送此请求后,我收到此消息:

BadRequest. Http request failed as there is an error getting AD OAuth token: 'AADSTS50001: The application named https://management.azure.windows.net was not found in the tenant named xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant.

在AzureAD中,我看到以下内容: enter image description here

我现在的问题是API,我应该在AzureAD中添加哪个API权限?

1 个答案:

答案 0 :(得分:2)

如评论中所述,应为其获取代码/令牌的资源(受众)为https://management.core.windows.net/

此外,您需要具有以下委派的权限才能执行Azure API:执行Windows Azure服务管理API

enter image description here

完成此操作后,您应该可以执行操作了。