Azure Retail Prices REST API, difference prices between API and when seen in the 'create Azure VM' web gui

DaveK 1,871 Reputation points
2022-11-15T15:58:36.763+00:00

So I'm trying to get some prices using the Azure Retail Prices API and I'm a little confused on the results so I'm hoping someone can help clear up what I'm seeing.

If I take a single VM type as a reference point (In this example, E4ds v5) and I use the API to get a hourly price rate (0.2988), the same VM if selected within Azure Virtual Machines and using Create Azure VM and select 'See all Sizes' the pricing seems to differ at a monthly cost of £169.99. With what is being returned, I just can't seem to get the maths to work out to make the hourly price rate match what I'm seeing when using the web GUI.

I'm using the following command to get the pricing info:

(Invoke-RestMethod -Uri "https://prices.azure.com/api/retail/prices?currencyCode='GBP'&`$filter=productName eq 'Virtual Machines Edsv5 Series' and skuName eq 'E4ds v5' and armRegionName eq 'westeurope' and priceType eq 'Consumption'" -Usebasicparsing -Method GET -ContentType "application/json").Items  
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
9,092 questions
Azure Cost Management
Azure Cost Management
A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
3,651 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. kobulloc-MSFT 26,811 Reputation points Microsoft Employee Moderator
    2022-11-16T02:37:12.467+00:00

    Hello, @DaveK !

    How do I compare the retail prices REST API and the portal prices?
    Usually confusion regarding difference in prices when comparing one place with another is a variable that affects the price such as the OS license or forgetting to update the location. This is easy to overlook, especially when default values might not be what you were expecting.

    Below I've used your request in Postman which returned the same 0.2988 GBP that you are seeing. I then compared this to the Azure Pricing Calculator which quoted £0.299 as long as I selected an operating system with no additional cost. Looking at the Azure Portal, we see the same price after a bit of math ($252.58/month or $0.346/hour which converts to £0.2988/hour at the conversion rate listed of 0.8636).

    Let me know if you are seeing something different and I'd be happy to investigate this further. I hope this helps!

    Total for an E4ds v5 VM using the Azure Portal: $252.58/month ($0.346/hour or £0.2988/hour with 730 hours at the conversion rate listed of 0.8636)

    260722-image.png

    260771-image.png

    Total for an E4ds v5 VM using the REST API: £0.2988

    https://prices.azure.com/api/retail/prices?currencyCode='GBP'&$filter=productName eq 'Virtual Machines Edsv5 Series' and skuName eq 'E4ds v5' and armRegionName eq 'westeurope' and priceType eq 'Consumption'

    260736-image.png

    Total for an E4ds v5 VM using the Azure Pricing Calculator: £0.299

    260705-image.png

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.