Skip to content

Getting Started with API Integration

Azure Costs offers direct API access to integrate the processed and aggregated data directly in 3rd party applications like Qlick or Tableau. This option allows customers on an enterprise plan or higher to render or analyze the Azure Costs data in existing BI solutions. 

Please contact the Azure Costs support to get access to the API documentation. It's possible to prepare the environment by registering an application in Azure Costs as follows:

  1. Register an application as trustee to control which data can be access from the 3rd party application in the team management view:

  2. The application contains a client_id and a client_secret which can be used for the oAuth2 client credentials flow. Just issue a new security token at least every hour from the Azure Costs STS. We recommend issuing a token whenever you start a new transaction to ensure that permission changes are effective. 
    curl -X POST -d "client_id={{YOUR CLIENT ID}}&client_secret={{YOUR CLIENT SECERT}}&grant_type=client_credentials"

  3. Use the issued token for all subsequent API calls. Please contact the Azure Cost Support to receive the API documentation. 

Issuing Security Token as CSP partner from a customer

Cloud Solution Provider who signed up in Azure Costs is able to issue API tokens for a specific customer they are managing in their Cloud Solution Provider profile. This process requires a token update request which injects the permissions to access a customer team's data. Just update the token by re-issuing an updated token with the following call: 
curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer {{ISSUED TOKEN IN STEP 1}}" -d '{"grant_type":"update_token", "delegate": "{{TEAMID OF CUSTOMER}}"}'
The newly generated token needs to be used in all subsequent API calls. Please contact the Azure Cost Support to receive the API documentation.

Feedback and Knowledge Base