I am trying to access the Azure APIs, using postman, for example https://management.azure.com/tenants?api-version=2022-12-01 but completely lost with MS documentation. I went through some threads here and they talk about sending some parameters in the body, such as:
client_id= &client_secret= &grant_type=client_credentials
&resource=
How/Where can I get those details. Is it somewhere in Azure portal?
2
Answers
you would enter your credentials for these:
it depends on what azure services/resources you’re trying to connect to.
go to that resource in the azure portal, and check out connections or access to that resouce under info or connections and enter them.
Different azure services have slightly different look, so you’ll have to dig around.
Initially, I registered Single Tenant Microsoft Entra ID application
Go to portal –> Microsoft Entra ID –>App registration
Added and granted API permission of
Azure Service Management
like below:Also, I added RBAC role of Reader to Service Principal at Subscription level:
Now, Added Client Secret:
Now, Generate access token using Postman or ThunderClient(VS Code Extension) with below parameters:
Now use this generated access token to fetch the below query:
GET https://management.azure.com/tenants?api-version=2022-12-01
Reference:
Tenants-List
Azure-RBAC Roles