Automation for partners

Azure Cost Management is natively available for direct partners who have onboarded their customers to a Microsoft Customer Agreement and have purchased an Azure Plan. Partners and their customers can use Cost Management APIs common tasks. For more information about non-automation scenarios, see Cost Management for Partners.

Azure Cost Management APIs - Direct and indirect providers

Partners with access to billing scopes in a partner tenant can use the following APIs to view invoiced costs.

APIs at the subscription scope can be called by a partner regardless of the cost policy, as long as they have access to the subscription. Other users with access to the subscription, like the customer or reseller, can call the APIs only after the partner enables the cost policy for the customer tenant.

To get a list of billing accounts


To get a list of customers


To get a list of subscriptions


To get a list of invoices for a period of time


The API call returns an array of invoices that has elements similar to the following JSON code.

   {      "id": "/providers/Microsoft.Billing/billingAccounts/{billingAccountID}/billingProfiles/{BillingProfileID}/invoices/{InvoiceID}",      "name": "{InvoiceID}",      "properties": {        "amountDue": {          "currency": "USD",          "value": x.xx        },        ...    } 

Use the preceding returned ID field value and replace it in the following example as the scope to query for usage details.


The example returns the usage records associated with the specific invoice.

To get the policy for customers to view costs


To set the policy for customers to view costs


To get Azure service usage for a billing account

We recommend that you configure an Export for these scenarios. For more information, see Retrieve large usage datasets with exports.

To download a customer's Azure service usage

We recommend that you configure an Export for this scenario as well. If you need to download the data on demand, however, you can use the Cost Details API. For more information, see Get small cost datasets on demand.

To get or download the price sheet for consumed Azure services

First, use the following post.

POST{billingAccountName}/billingProfiles/{billingProfileID}/pricesheet/default/download?api-version=2019-10-01-preview&format=csv" -verbose 

Then, call the asynchronous operation property value. For example:


The preceding get call returns the download link containing the price sheet.

To get aggregated costs


Create a budget for a partner


Create a budget for a customer


Delete a budget


Next steps