wiki:connect_azure_rest_api
This is an old revision of the document!
Table of Contents
Connect to Azure REST API
In your account open the azure shell. After connecting create the principal
az ad sp create-for-rbac --role Contributor --scope /subscriptions/<your subscription id>
Subscription id can be obtained from URL when you are logged in to portal.azure.com or with this command
az account show --query id -o tsv
You should get the following similar info
{ "appId": "257xxxxxxxxxxxxxxxxxxxxxx", "displayName": "azure-cli-2022-08-30-10-52-10", "password": "xxxxxxxxxxxxxxxxxxxxx", "tenant": "4aedxxxxxxxxxxxxxxxxxxxxxxxxxxxx" }
This data can now be used to get query the API but you still need the BearerToken which can be obtained via this script, which can be used in Postman as a “Pre-request Script”
Tested on
- Microsoft Azure accessed on 2022-08-30
See also
References
wiki/connect_azure_rest_api.1661859916.txt.gz · Last modified: 2022/08/30 11:45 by antisa