Closed bellstar closed 3 months ago
@msyyc would you help check?
@bellstar according to error message:
(AuthorizationFailed) The client 'xxxx-xxxx' with object id 'xxxx-xxxx' does not have authorization to perform action 'Microsoft.Advisor/recommendations/read' over scope '/subscriptions/xxxx-xxxx' or the scope is invalid. If access was recently granted, please refresh your credentials.
Your subid doesn't have access for Microsoft.Advisor/recommendations/read
. I find https://learn.microsoft.com/en-us/azure/role-based-access-control/role-assignments-portal-subscription-admin about how to grant access to sub and hope it is helpful.
Link to sample
https://learn.microsoft.com/en-us/rest/api/advisor/recommendations/list?tabs=Python
Library name and version
API Version: 2020-01-01
Language of the Sample
Sample Issue Type
Issue details
When I run the Python example in the reference for this API, it returns a scope error. https://learn.microsoft.com/en-us/rest/api/advisor/recommendations/list?tabs=Python
The environment variables (AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET) and subscriptions are set and running. Any other information on the configuration required to register an application?
Expected behavior
I hope that like a "Sample Response" in the documents.
Actual behavior
I write above "Details", I got error.
Reproduction Steps
Environment
Python 3.8 PowerShell 7.2