Retrieve Azure Billing Data

You can configure Commander to retrieve Azure billing data. Retrieving billing data improves the accuracy of costing reports and Cost Analytics, because these reports include metered usage costs such as Storage and Network I/O. Billing data is retrieved immediately after you configure the billing data location. During a nightly scheduled task, the billing data is merged with the existing billing data in the VM billing records.

Azure provides daily billing reports and Commander retrieves a maximum of 60 days worth of billing data. Commander can retrieve data from before the Azure account was added as a cloud account. Commander also retrieves Azure billing data for VMs that have never been managed by Commander. For example, if an Azure account was added as a cloud account 90 days ago, and you configure Commander to retrieve billing data today, Commander retrieves the last 60 days worth of billing data for all Azure VMs that have existed at any point over the last 60 days. As another example, if you add an Azure account as a cloud account today, and you configure Commander to retrieve billing data today, Commander retrieves the last 60 days worth of billing data for all Azure VMs that have existed at any point over the last 60 days, including VMs that were never managed by Commander.

For more information on how Commander handles services it has not managed, see Billing data for VMs not managed by Commander.

The method of retrieving Azure billing data depends on whether you have an Azure Enterprise Agreement (EA) account.

For more information on Offer Types, see Microsoft Azure Offer Details.

If you have an EA account, but you configure the system for a non-EA account, the billing data retrieval may fail, or the resulting reports may show values that differ from your actual payments.

Commander billing data are stored and queried in a universal date without time or time zone. For example, if you're retrieving or injecting billing data for November 30, 2021, Commander interprets this date without any time zone shift, regardless of where you're located. Cost information retrieved from this public cloud provider is split at midnight in the GMT time zone and then stored in Commander with a universal date without time or time zone.

Retrieve Azure billing data for a Pay-As-You-Go account

Access:

Views > Inventory > Infrastructure or Applications

Available to:

Commander Roles of Superuser and Enterprise Admin; Administrator Access Rights

If you set up a Pay-As-You-Go account package when you registered with Azure, use these steps to retrieve Azure billing data.

  1. From the Inventory tree, select an Azure cloud account.
  2. Select Actions > Retrieve Billing Data.
  3. In the Retrieve Azure Usage and Cost Data dialog, select Enable Azure billing data retrieval.
  4. For Offer Type, select Pay-As-You-Go.
  5. Click OK.

    AWS Billing Data Settings Azure

    Sixty days of billing data is retrieved immediately, and a nightly task will update future records.

After you've chosen an offer type for Azure Billing Retrieval, changing to a different offer type requires a billing data reset using REST API.

Retrieve Azure billing data for Azure Plan accounts

Before you can retrieve Azure billing data for an account under the Azure Plan, you must set up a number of prerequisites.

Prerequisites for retrieving Azure Plan billing data

Follow these steps for each new subscription under the Azure Plan:

  1. Using an automation tool, such as Azure Lighthouse, create a subscription for each of the customers you wish to onboard.
  2. For each of these subscriptions, create a dedicated service principle (an app) with an API key.
  3. This app needs to have an IAM role on the subscription, with read permission on Microsoft.Commerce, specifically the "Read Rate Card" and "Read Usage Aggregates" permissions.

  4. Using the subscription ID and API key, add this subscription as a cloud account in Commander.

Retrieve billing data for Azure Plan

Access:

Views > Inventory > Infrastructure or Applications

Available to:

Commander Roles of Superuser and Enterprise Admin; Administrator Access Rights

  1. From the Inventory tree, select an Azure cloud account.
  2. Select Actions > Retrieve Billing Data.
  3. In the Retrieve Azure Usage and Cost Data dialog, select Enable Azure billing data retrieval.
  4. For Offer Type, select Azure Plan.
  5. Click OK.

    AWS Billing Data Settings Azure Plan

    Sixty days of billing data is retrieved immediately and a nightly task will update future records.

After you've chosen an offer type for Azure Billing Retrieval, changing to a different offer type requires a billing data reset using REST API.

Retrieve Azure billing data for Enterprise Agreement accounts

Access:

Views > Inventory > Infrastructure or Applications

Available to:

Commander Roles of Superuser and Enterprise Admin; Administrator Access Rights

  1. From the Inventory tree, select an Azure cloud account.
  2. Select Actions > Retrieve Billing Data.
  3. In the Retrieve Azure Usage and Cost Data dialog, select Enable Azure Enterprise Agreement billing data retrieval.
  4. Azure Billing Retrieval for Enterprise Agreements

  5. Enter the Enrollment Number that you received when you signed the Azure Enterprise Agreement contract.
  6. Enter the Billing API Access Key.
  7. For instructions on how to generate the billing API access key, go to Overview of the Azure Enterprise Reporting APIs.

  8. Specify the Currency of the billing data being retrieved from Azure.
  9. Click Test to validate the enrollment number and check that the billing API access key is valid and hasn't expired.
  10. Click OK.

    Sixty days of billing data is retrieved immediately, and a nightly task will update future records on a daily basis.

After you've chosen an offer type for Azure Billing Retrieval, changing to a different offer type requires a billing data reset using REST API.

Disable the retrieval of Azure billing data

  1. From the Inventory tree, select an Azure cloud account.
  2. Select Actions > Retrieve Billing Data.
  3. In the Retrieve Azure Usage and Cost Data dialog, select Not Configured and click OK.

Commander will no longer retrieve billing data for this cloud account.

Troubleshooting

The following error message may show up on the Retrieve Azure Usage and Cost Data dialog after you enter your billing API access key: "Unable to access the Billing API service. The enrollment number might be incorrect, or the API access key is invalid or has expired." If your key has expired, you'll need to regenerate it. For instructions on how to generate the Billing API Access key, go to Overview of Reporting APIs for Enterprise Customers .

Billing data for VMs not managed by Commander

Commander also retrieves Azure billing data for VMs that have never been managed by Commander, including charges for:

  • VMs that exist only between Commander synchronizations with Azure, such as VMs spawned and torn down by an Auto Scaling Group
  • VMs that existed only before the Azure account was added as a Commander cloud account
  • VMs that existed only when the Commander service was down
  • existing VMs, including for periods before the Azure account was added as a cloud account

When a VM not managed by Commander is discovered in the Azure billing report, the following occurs:

  • Cost Models are applied to VMs, based on their location in the Infrastructure or Applications tree
  • Ownership information is applied by the Default Ownership policy, or is inherited from the parent Resource Group.

The Default Attributes policy doesn't affect VMs discovered in the Azure billing report.

Billing data for all Azure services

When billing data retrieval is configured, Commander's cost analytics data accurately reflects the total cost you'll have to pay on your Azure bill and includes costs for services that Commander doesn't manage. Examples of such services include but are not limited to:

  • data management
  • security center
  • business analytics
  • data services

On your Azure bill, some of the costs for services may be divided into sub-categories. These sub-categories don't show up in Commander's cost analytics data. Only the total cost for a service is displayed.

If you have an Enterprise Agreement account, but configure the system for standard billing data retrieval, the resulting reports may show values that differ from your actual payments.

Ownership of each service will reflect the ownership policy that you set up on the cloud account, region, or resource group level.

Tax and Azure support plan fees are not included in the list of services because they are charged on a monthly basis.

Azure Billing Tags

Billing Tags allow you to group and filter your expenses in more detail. You can use these tags to filter expenses in Cost Analytics, the Service Portal Cost Dashboard, and the Cloud Billing Report. Billing Tag information is part of your Azure account billing data and is automatically imported during billing data retrieval. For information on using Billing Tags in formulas for Additional Line Items, see Additional Line Items page.

  • Before upgrade to 8.1.0, filtering Cost Analytics and the Service Portal Cost Dashboard by Custom Attributes affected the Recommendations. After upgrade, filtering by Billing Tags won't affect the Recommendations.
  • Billing Tags and SKUs will only be retrieved from Version 8.1.0 and forward, unless billing records are reset. Create a case through the Snow Support Portal if you want to perform this activity.