Multi Cloud Environment Cost Management & Optimization made easy

Main menu

Post navigation

Integrate your applications, welcome oAuth2

The Azure Costs team is happy to announce a simplified way to integrate your applications in Azure Costs. Here is how to integrate an application in Azure Costs, that you are developing . This might for example be your BI dashboard or some other enterprise application integration platform that consumes data Azure Costs provides.

Step 1: Create an application principal

Every application which shall be integrated in Azure Costs needs to be registered as a so called application principal within a team account. The technical reason for this is that the authorisation relies on the oauth2 client credentials flow.

The application principal can be used in the same way as an interactive user. This means it’s possible to assign specific permissions to the application principal. All features of the access rights and permissions system can be used out of the box for application principals as well.

There are no limitations, every enterprise subscription allows to create as many application principals as required. In case of exposing the client secret by accident please remove or reset the application registration to prevent unauthorized access to your spending data.

Step 2: Get an access token with the client credentials grant flow

Based on the client credentials grant flows it’s possible to get the access token which needs to be used to communicate with the Azure Costs API following the “Bearer” schema in the authorisation header. The Token can be issued with the following call: