Query request for Azure Usage/Billing API using Postman

Reference Link to query report.


Generate Bearer Token

Login-AzureRmAccount
$AccountName ="azureauto@AADTenants.onmicrosoft.com"
$Password = "UserPassword"
$PayLoad="resource=https://management.core.windows.net/&client_id=xxxxxxxxxxxxxxxxxxxxx&grant_type=password&username="+$AccountName+"&scope=openid&password="+$Password
$Response=Invoke-WebRequest -Uri "https://login.microsoftonline.com/Common/oauth2/token" -Method POST -Body $PayLoad
$ResponseJSON=$Response|ConvertFrom-Json
$ResponseJSON
Results,

From Postman

Comments

Popular posts from this blog

ADFS WAP: How to configure SSO with RDWeb

Secure RDWeb using Azure Multi-Factor Authentication

Azure: How to unregister and register ADFS Authentication Provider (MFA)