Azure Retail Price API - list of values for the filters/parameters

SIVAKUMAR MUTHUSAMY 0 Reputation points
2024-07-29T14:39:03.2466667+00:00

Hi All

For Azure API retail pricing, what are the possible values for the filters we have to pass in the Body of Invoke-WebRequest, for choosing different OS like Linux(RHEL, Ubuntu...), Windows, SQL Server, AHUB licensing(is it TYPE: DevTestConsumption ???) option. I am not able to find any suitable parameters to pass these OS values accordingly.

$Parameters = @{

    currencyCode = $currencyCode

    '$filter' = "serviceName eq 'Virtual Machines' and **os eq ???** and **tier eq ???** and type eq '**Consumption**' and etc...."

}

Invoke-WebRequest -UseBasicParsing -Uri "https://prices.azure.com/api/retail/prices" -Body $Parameters -Method Get

Many Thanks.

Cost Management
Cost Management

A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.


1 answer

Sort by: Most helpful
  1. Vinodh247-1375 43,911 Reputation points Volunteer Moderator
    2024-07-29T15:43:30.0366667+00:00

    Hi ,

    Thanks for reaching out to Microsoft Q&A.

    To filter the Azure Retail Price API for specific operating systems and other parameters when retrieving pricing for virtual machines, you can use the $filter parameter in your API request. Below are the possible values and examples for the filters you may want to use, particularly for operating systems like Linux (RHEL/Ubuntu), windows, and sqlserver.

    Possible Filter Values

    1. Operating System (OS):
      • For Linux distributions, you might use values like:
      • os eq 'Linux'
      • os eq 'RHEL'
      • os eq 'Ubuntu'
      • For Windows, you would use:
      • os eq 'Windows'
      • For SQL Server, you can specify:
      • os eq 'SQL Server'
    2. Tier:
      • The tier can vary based on the service and its pricing structure. Common values include:
      • tier eq 'Standard'
      • tier eq 'Premium'
      • tier eq 'Basic'
      • You would need to check the specific tiers available for the service you are querying.
    3. Type:
      • For consumption-based pricing, you would typically use:
      • type eq 'Consumption'
      • For Dev/Test scenarios, you might specify:
      • type eq 'DevTestConsumption'

    sample:

    $Parameters = @{ currencyCode = $currencyCode '$filter' = "serviceName eq 'Virtual Machines' and os eq 'Linux' and tier eq 'Standard' and type eq 'Consumption'" } Invoke-WebRequest -UseBasicParsing -Uri "https://prices.azure.com/api/retail/prices" -Body $Parameters -Method Get
    

    Please 'Upvote'(Thumbs-up) and 'Accept' as an answer if the reply was helpful. This will benefit other community members who face the same issue.

    Was this answer helpful?

    0 comments No comments

Your answer

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