python - Azure rest API AuthorizationFailed error -


i have tried read alerts via following azure api

endpoint = 'https://management.azure.com/subscriptions/{subscription_id}/providers/microsoft.security/alerts?api-version=2016-03-01' headers = {"authorization": 'bearer ' + access_token} json_output = requests.get(endpoint, headers=headers).json() 

it returns following error message,

{u'error': {u'message': u"the client '8447xxxx-xxxx-xxxx-xxxx-49bb99abxxxx' object id '8447xxxx-xxxx-xxxx-xxxx-49bb99abxxxx' not have authorization perform action 'microsoft.security/alerts/read' on scope '/subscriptions/{subscription_id}'.", u'code': u'authorizationfailed'}}

regarding message, need "security manager" role added credentials:

apply "security manager" role @ subscription scope should solve problem.


Comments

Popular posts from this blog

php - How to add and update images or image url in Volusion using Volusion API -

javascript - jQuery UI Splitter/Resizable for unlimited amount of columns -

javascript - IE9 error '$'is not defined -