Retail Pricing API for bandwidth costs

Alexander Clouter 1 Reputation point
2022-09-06T08:52:32.873+00:00

I am working on a project where I need to determine the bandwidth costs between different regions and availability zones. I want to be able to ask my project "how much (both for egress and ingress) from uksouth to brazilsoutheast?" and the data for the lot (locations and pricing) comes from machine readable APIs so I do not need to hardcode anything that may change without warning into my project.

For this I am using the Azure Retail Prices REST API with the filter:

serviceFamily eq 'Networking' and serviceName eq 'Bandwidth'

The problem is reconciling this API back to the official pricing list and I am hoping someone here can help tell me what I am doing wrong or if there are gaps/fixes Azure need to do?

What I have found is:

  • productName is unreliable to match to regions/'continents', so I am using meterId
  • I am unable to find meterId described anywhere except for a update post that then links to an XLSX listing all the meterId mappings; is the URL for the XLSX permanent and safe to hardcode into software?
  • this XLSX does not include any meterId's for the primary meters for Inter-continental traffic (ie. 43034668-a244-4031-bb4d-be5bcce22c5f 'Inter Continent Data Transfer Out - LATAM To Any' and beb1457b-1ab8-4e38-8021-bf7e39b1014b 'Inter Continent Data Transfer Out - NAM or EU To Any')
  • for bandwidth the XLSX talks about (Continental) 'Zones' for pricing which I have been unable to find anything about in Azure's documentation 238061-image.png
  • I cannot find any machine-readable listing for a mapping of regions to continents, the only 'official' description is in the pricing FAQ - "Which regions correspond to to each continent?"
  • the FAQ entry unfortunately is incomplete, missing entries include 'Qatar Central', 'Sweden Central' and 'West US 3' (as well as the 'Jio India' and 'EUAP' regions) which are in the 'Subscriptions - List Locations' REST API
  • 'geographyGroup' in the 'List Locations' API is non-mappable to anything I can find in the Pricing API
  • So I have hardcoded the FAQ non-machine-readable region->continent mapping (plus the missing locations) but there is still no official continent->billing continent zone mapping, so I make a few guesses based on the meterId XLSX, the prices on the official inter-region non-machine readable pricing webpage and the Pricing API such that:
    • Zone 1: 'North America' and Europe'
    • Zone 2: 'Asia', 'Middle East', 'Africa' and 'Oceania'
    • Zone 3: 'South America'
  • Looking at the official inter-region pricing 'Middle East (ME)' is listed in the Intra-continental but not the 'Inter-continental' sections List item
  • it is unclear if for Intra, if a region in the Middle East can talk to a region in Africa at the inter-region pricing or is it the Global egress pricing?

The above process is awful, and I suspect unreliable, but I cannot find any other way to programmatically with APIs figure out the pricing between two given regions (and/or availability zones). Can someone help?

I have also found that the inter availability zone pricing is wrong in the Pricing API. It claims it costs $0.01/GB for both egress and ingress since 2021-01-01 whilst the official pricing page is clear this does not start being billed till 2023-07-01. I think the Pricing API should reflect this as two entries for both but with different effectiveStartDate's where the current active price is $0.00/GB whilst the one that starts 2023-07-01 is $0.01/GB; though having two show up in the API would make it impossible to selecting the current pricing for items with tierMinimumUnits present and when there is an update.

[ { "currencyCode": "USD", "tierMinimumUnits": 0, "retailPrice": 0.01, "unitPrice": 0.01, "armRegionName": "Global", "location": "Global", "effectiveStartDate": "2021-01-01T00:00:00Z", "meterId": "507b35f5-9039-4367-9cd2-d3c731e46064", "meterName": "Standard Inter-Availability Zone Data Transfer In", "productId": "DZH318Z0BNVX", "skuId": "DZH318Z0BNVX/005J", "productName": "Rtn Preference: MGN", "skuName": "Standard", "serviceName": "Bandwidth", "serviceId": "DZH318FHKQ5W", "serviceFamily": "Networking", "unitOfMeasure": "1 GB", "type": "Consumption", "isPrimaryMeterRegion": true, "armSkuName": "" }, { "currencyCode": "USD", "tierMinimumUnits": 0, "retailPrice": 0.01, "unitPrice": 0.01, "armRegionName": "Global", "location": "Global", "effectiveStartDate": "2021-01-01T00:00:00Z", "meterId": "4f2f3cd2-24b7-4978-844b-422434c646d9", "meterName": "Standard Inter-Availability Zone Data Transfer Out", "productId": "DZH318Z0BNVX", "skuId": "DZH318Z0BNVX/005J", "productName": "Rtn Preference: MGN", "skuName": "Standard", "serviceName": "Bandwidth", "serviceId": "DZH318FHKQ5W", "serviceFamily": "Networking", "unitOfMeasure": "1 GB", "type": "Consumption", "isPrimaryMeterRegion": true, "armSkuName": "" } ]

Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
2,030 questions
{count} votes