Using the Cost Details API or a cost export

The Azure Billing target can collect billing data for your Microsoft Customer Agreement (MCA) or Enterprise Agreement (EA) accounts through the Azure Cost Details API or a cost export that you set up in Azure.

For either global Azure or Azure Government, your choice depends mainly on the size of your billing data.

  • Cost Details API: Microsoft recommends the Cost Details API for billing data that is less than 2 GB in size. Larger sizes will likely result in timeouts.

  • Cost Export: Microsoft recommends a cost export for billing data that is at least 2 GB in size. The data export is in CSV format, and contains all the cost and usage data that Azure Cost Management collects.

Note:

Support for the Cost Details API started in version 8.8.4. New deployments of the product will use this API by default.

For Azure Billing targets added in earlier releases of the product, any associated cost export will automatically carry over to version 8.8.4 or later. You can switch these targets to the Cost Details API any time.

Using the Cost Details API

If you choose the Cost Details API:

  • There is nothing that you need to set up in Azure.

  • If you run Turbonomic behind a firewall, be sure to allow unrestricted access to *.blob.core.windows.net.

  • When you add an Azure Billing target in the Turbonomic user interface in a later task, be sure to turn off the Use a cost export option.

Next Step: Set up an Azure service principal for billing data monitoring. For details, see this topic.

Using a cost export

If you choose a cost export, set up a daily cost export of month-to-date costs in the Azure portal.

The steps for setting up a cost export are slightly different for EA and MCA accounts. The following sections describe the steps.

Setting up a cost export for EA accounts

  1. Sign in to the Azure portal.

  2. Browse to Cost Management + Billing.

  3. (Global Azure only) Set the billing scope.

    1. In the navigation bar, choose Billing scopes.

    2. Select a billing scope with a billing scope type of 'Billing account'.

      Note:

      Turbonomic does not support the subscription, management group, or resource group billing scope type.

  4. In the navigation bar, find Settings and select Exports.

  5. Select Create.

  6. Configure the following settings:

    • Export details

      Setting Instructions
      Name Specify your preferred name.
      Metric

      Choose Cost and usage details (actual).

      Export type

      Choose Daily export of month-to-date costs.

      Start date (UTC time) Specify the current date.
    • File partitioning

      Setting Instructions
      File partitioning

      Turn on file partitioning.

    • Storage

      Setting Instructions
      Storage

      Choose Use existing or Create a new one.

      Subscription

      Select a subscription for the cost export.

      Be sure that you have added the subscription to Turbonomic as an Azure service principal target. If you have not completed this task, first set up a service principal in Azure and then add an add an Azure service principal target.

      Storage account

      This field provides a list of storage accounts for the selected subscription. Select a storage account for the cost export.

      • Be sure to provide Reader and Data Access permissions to the storage account.

      • If the storage account is behind a firewall, add the cluster IP range for Turbonomic to the firewall's allowlist. If Turbonomic is deployed and maintained by your Turbonomic representative, contact that person for the list of IP addresses to add to the allowlist.

        For more information, see the Azure documentation.

      • For Azure Government EA accounts, the storage account must be under an Azure Government subscription.
      Container

      Specify the container name for the cost export.

      Be sure to provide Storage Blob Data Reader permissions to the container.

      Directory

      Specify the directory path for the cost export.

  7. Select Create.

  8. Record the name of the cost export that you just created. You will need this information later when you add an Azure Billing target in the Turbonomic user interface.

    Note:

    When you add the Azure Billing target, be sure to turn on the Use a cost export option.

  9. If you run Turbonomic behind a firewall, allow unrestricted access to the following URLs:

    • Less strict:

      *.blob.core.windows.net

    • Strict:

      {Storage_Account}.blob.core.windows.net

      Replace {Storage_Account} with the name of the storage account that contains the cost export.

Next Step

Set up an Azure service principal for billing data monitoring. For details, see this topic.

Setting up a cost export for MCA accounts

  1. Sign in to the Azure portal.

    https://portal.azure.com

  2. Browse to Cost Management + Billing.

  3. In the navigation bar, find Settings and select Exports.

  4. Set the billing scope.

    1. Select Scope: {Account Name}.

    2. Select a billing scope with a billing scope type of 'billing profile'.

      If you previously set up a cost export with a scope type of billing account, delete the cost export and then create a new one with a scope type of billing profile. Create this cost export for each active billing profile that falls under your MCA billing account. All cost exports you create for your active billing profiles are required to have the same name.

      Note:

      Turbonomic does not support the subscription, management group, or resource group billing scope type.

  5. Select Create.

  6. Configure the following settings:

    • Add export

      Setting Instructions
      Type of data

      Choose Cost and usage details (actual).

      Export name Specify your preferred name.
      Dataset version Choose the latest version.
      Frequency

      Choose Daily export of month-to-date costs.

      Export description (Optional) Specify a description.
    • Destination

      Setting Instructions
      Storage type Accept the default selection Azure blob storage.
      Destination and storage

      Choose Use existing or Create a new one.

      Subscription

      Select a subscription for the cost export.

      Be sure that you have added the subscription to Turbonomic as an Azure service principal target. If you have not completed this task, first set up a service principal in Azure and then add an add an Azure service principal target.

      Storage account

      This field provides a list of storage accounts for the selected subscription. Select a storage account for the cost export.

      • Be sure to provide Reader and Data Access permissions to the storage account.

      • If the storage account is behind a firewall, add the cluster IP range for Turbonomic to the firewall's allowlist. If Turbonomic is deployed and maintained by your Turbonomic representative, contact that person for the list of IP addresses to add to the allowlist.

        For more information, see the Azure documentation.

      Container

      Specify the container name for the cost export.

      Be sure to provide Storage Blob Data Reader permissions to the container.

      Directory

      Specify the directory path for the cost export.

      File partitioning

      Turn on file partitioning.

      Overwrite data Turn off data overwriting.
    • Review + create

      Review your settings and make changes as necessary.

  7. Select Create.

  8. Record the name of the cost export that you just created. You will need this information later when you add an Azure Billing target in the Turbonomic user interface.

    Note:

    When you add the Azure Billing target, be sure to turn on the Use a cost export option.

  9. If you run Turbonomic behind a firewall, allow unrestricted access to the following URLs:

    • Less strict:

      *.blob.core.windows.net

    • Strict:

      {Storage_Account}.blob.core.windows.net

      Replace {Storage_Account} with the name of the storage account that contains the cost export.

Next Step

Set up an Azure service principal for billing data monitoring. For details, see this topic.