【发布时间】:2016-08-03 13:26:40
【问题描述】:
由于 Azure OAuth 2 中的更改,我有一个错误:
The client 'xxx' with object id 'xxx' does not have authorization to perform action 'Microsoft.Commerce/RateCard/read' over scope '/subscriptions/xxx'.
我已关注role-based assignment instructions,将我的应用程序的Reader 角色添加到DefaultResourceGroupResource。
我还在我的应用程序清单的appRoles 部分添加了Admin 角色。
并添加所有可能的应用权限:
为了调用 RateCard API,我检索了一个令牌:
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" "https://login.windows.net/xxx.onmicrosoft.com/oauth2/token" -d "grant_type=client_credentials&client_id=xxx&client_secret=xxx"
我在我的请求中使用它:
curl -H "Authorization: Bearer <token>" "https://management.azure.com/subscriptions/xxxproviders/Microsoft.Commerce/RateCard?api-version=2015-06-01-preview&$filter=OfferDurableId eq 'MS-AZR-0003P' and Currency eq 'USD' and Locale eq 'en-US' and RegionInfo eq 'US'"
但我仍然有这个错误。
我应该怎么做才能将此授权添加到我的应用程序中?
这里是我的应用权限的一些截图:
【问题讨论】: