代码之家  ›  专栏  ›  技术社区  ›  Kaja

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

  •  0
  • Kaja  · 技术社区  · 7 年前

    我想通过逻辑应用程序中的RESTAPI更改我的Azure分析服务的价格层。 为了完成这项工作,我建立了这个 API

    在逻辑应用程序中,我设置了这样的请求

    {
        "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.
    

    在阿祖瑞德,我看到了以下内容: enter image description here

    我现在的问题是 美国石油学会 我应该在azuread中添加哪个API权限?

    1 回复  |  直到 7 年前
        1
  •  2
  •   Gaurav Mantri    7 年前

    如注释中所述,应为其获取代码/令牌的资源(访问群体)是 https://management.core.windows.net/ .

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

    enter image description here

    一旦您这样做了,您应该能够执行操作。