Towards GreenOps: Azure Cost Data | Tom Kennes

Towards GreenOps: Azure Cost Data

Data

Now we’re able to get our hands on the data, let’s talk about its structure. What is contained in Azure Usage/Cost data?

Well, quite a lot, it appears. And the values for some fields adhere to quite flexible domains, which might even be changing over time. E.g. over the last 2 years, there has been a lot of consolidation. So nowadays there is generally more consistency in the way usage and cost are reported in the overview. Yet, not all fields are really valuable for most CostManagement aggregations. Hence, there are a couple of things I would like to highlight.





Meter Data

There is clear distinction between SaaS-type services that are billed through Azure and the Azure services itself. Then Azure bills you according to the quantity you consume from a given meter. One Azure Product, or type of resource, typically has multiple meters, denoting different cost-dimensions of the specific resource. For example, you might be billed a standard daily fixed fee and a variable rate based on consumption. These will then be covered by individual rows in your invoice. Though there generally is some consistency within serviceFamilies (compute, storage, networking, etc) and consumedService.

Term Account type Examples Description
ConsumedService All ‘Microsoft.AzureActiveDirectory’, ‘Microsoft.Cache’, ‘Microsoft.Capacity’, ‘Microsoft.Cdn’, ‘Microsoft.ClassicNetwork’, ‘Microsoft.Compute’, ‘Microsoft.Databricks’ Name of the service the charge is associated with.
Location MCA ‘westeurope’, ’northeurope’ Normalized location of the resource, if different resource locations are configured for the same regions. Purchases and Marketplace usage might be shown as blank or unassigned.
MeterCategory All ‘Advanced Data Security’, ‘Advanced Threat Protection’, ‘Azure App Service’, ‘Azure Data Explorer’, ‘Virtual Machines’, ‘Virtual Machines Licenses’, ‘Virtual Network’ Name of the classification category for the meter. For example, Cloud services and Networking.
MeterId All The unique identifier for the meter.
MeterName All ‘B4ms’, ‘Basic Data Stored’, ‘Basic Data Transfer Out’, ‘Basic Gateway’, ‘Basic IPv4 Dynamic Public IP’, ‘Basic IPv4 Static Public IP’,‘Premium HSM-protected Advanced Key’, ‘Premium Jobs Compute DBU’, ‘Premium Jobs Compute Photon DBU’, ‘ZRS Data Stored’, ‘ZRS List Operations’, ‘ZRS Protocol Operations’, ‘ZRS Read Operations’ The name of the meter. Purchases and Marketplace usage might be shown as blank or unassigned.
MeterRegion All ‘EU North’, ‘EU West’, ‘Europe’, ‘Global’, ‘Intercontinental’, ‘UK South’, ‘US East’, ‘US West’, ‘Zone 1’, ‘Zone 2’, ‘Zone 3’ Name of the datacenter location for services priced based on location. See Location.
MeterSubCategory All ‘API Management’, ‘App Configuration’, ‘Application Gateway Standard v2’, ‘Az DB for PostgreSQL Flexible Server Storage’, ‘Azure Active Directory B2X’, ‘Azure Active Directory Premium P2’, ‘Azure App Service Basic Plan’, ‘Azure App Service Basic Plan - Linux’, ‘Azure App Service Free Plan’, ‘Azure App Service Free Plan - Linux’, ‘Azure App Service Premium v2 Plan’, ‘Azure App Service Standard Plan’, ‘Azure Bastion’, ‘Azure CDN from Akamai’,, ‘Virtual Machines Av2 Series’, ‘Virtual Machines BS Series’ Name of the meter subclassification category. Purchases and Marketplace usage might be shown as blank or unassigned.
Product All ‘Azure CDN from Microsoft - Standard - Zone 5’, ‘Azure Cognitive Search - Basic’, ‘Azure Cosmos DB - Free Tier - EU West’, ‘Azure Cosmos DB - Free Tier - US East’, ‘Azure Cosmos DB - PITR - EU West’, ‘Azure Cosmos DB - RUs - EU West’, ‘Azure Cosmos DB serverless - RUs - EU West’, ‘Azure DDOS Protection’, ‘Azure DNS - Azure DNS Private Resolver’, ‘Azure DNS - Private’, ‘Azure DNS - Public’, ‘Azure Data Explorer’, ‘Service Bus - Basic’, ‘Service Bus - Premium’, ‘Service Bus - Standard’, ‘SignalR’, ‘Standard HDD Managed Disks - S10 LRS’, ‘Standard HDD Managed Disks - S10 LRS - EU West’ Name of the product.
ProductId MCA Unique identifier for the product.
ServiceFamily MCA ‘AI + Machine Learning’, ‘Analytics’, ‘Azure Marketplace Services’, ‘Compute’, ‘Containers’, ‘Databases’, ‘Developer Tools’, ‘Integration’, ‘Internet of Things’, ‘Management and Governance’, ‘Networking’, ‘SaaS’, ‘Security’, ‘Storage’, ‘Web’, ‘Windows Intune’ Service family that the service belongs to.




Measurement Data

The meter and quantity are then charged given a certain time-interval. You might be charge for the usage of one minute given a standard unit of 1/h. In that case, your quantity would be 1/60.

Term Account type Description
Date All The usage or purchase date of the charge.
Quantity All The number of units purchased or consumed.
UnitOfMeasure All The unit of measure for billing for the service. For example, compute services are billed per hour.




Pricing Data

This quantity is then multiplied by the price you would for the standard unit (the UnitOfMeasure), let’s say 600/h. So that would be 1/60*600=10 euros. Note that this price is often given in multiple currency types as well as with and without reservation-, client- and other discounts.

Term Account type Description
BillingCurrency All Currency associated with the billing account.
BillingCurrencyCode All See BillingCurrency.
CostInBillingCurrency EA, MCA Cost of the charge in the billing currency before credits or taxes.
CostInPricingCurrency MCA Cost of the charge in the pricing currency before credits or taxes.
EffectivePrice All Blended unit price for the period. Blended prices average out any fluctuations in the unit price, like graduated tiering, which lowers the price as quantity increases over time.
ExchangeRateDate MCA Date the exchange rate was established.
ExchangeRatePricingToBilling MCA Exchange rate used to convert the cost in the pricing currency to the billing currency.
pay-as-you-goPrice All Retail price for the resource.
PartnerEarnedCreditApplied MPA Indicates whether the partner earned credit has been applied.
PartnerEarnedCreditRate MPA Rate of discount applied if there’s a partner earned credit (PEC), based on partner admin link access.
PricingCurrency MCA Currency used when rating based on negotiated prices.
ReservationName EA, MCA Name of the purchased reservation instance.




Organizational Data

As such, Azure generalizes the way it represents billing to you and the most important fields focus on: the meter, the quantity and the date. Whereas these meters explain the origins of your costs, you probably want to aggregate them such that you can group them and map them to the business. For this purpose we use tags.

Term Account type Description
ResourceGroup All Name of the resource group the resource is in. Not all charges come from resources deployed to resource groups. Charges that don’t have a resource group are shown as null or empty, Others, or Not applicable.
ResourceId All Unique identifier of the Azure Resource Manager resource.
ResourceLocation All Datacenter location where the resource is running. See Location.
ResourceName EA, pay-as-you-go Name of the resource. Not all charges come from deployed resources. Charges that don’t have a resource type are shown as null/empty, Others , or Not applicable.
ResourceType MCA Type of resource instance. Not all charges come from deployed resources. Charges that don’t have a resource type are shown as null/empty, Others , or Not applicable.
SubscriptionId All Unique identifier for the Azure subscription.
SubscriptionName All Name of the Azure subscription.
Tags All Tags assigned to the resource. Doesn’t include resource group tags. Can be used to group or distribute costs for internal chargeback. For more information, see Organize your Azure resources with tags.


  • Note that it’s good practice to define tags on higher levels and have lower level resources inherit those tags. Since a resource-group is used as an abstraction to represent a project, we set tags there.

  • Also note that these are just subsets of the available fields. In total there are about 80. For a complete overview of all the available fields, see here. Below there is a summary of the most important fields given the explanation above: