Azure: The access token has been obtained from wrong audience or resource

不羁岁月 提交于 2019-12-05 12:05:57

That is not impacting (its an optional parameter)

Actually, the resource parameter is required in Service to Service Calls Using Client Credentials flow for access token, this parameter tells your application where to get token. As you need to authenticate ARM requests, you need set 'resource': 'https://management.core.windows.net/' in get_token_from_client_credentials()

And we can also get the information from your error message:

The access token has been obtained from wrong audience or resource '00000002-0000-0000-c000-000000000000'. It should exactly match (including forward slash) with one of the allowed audiences 'https://management.core.windows.net/','https://management.azure.com/'

Any concern, please feel free to let me know.

Looks like you have this line commented out?

'resource': 'https://management.core.windows.net/',

this is the audience that you are getting the token for so you are going to need this line.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!