A Microsoft offering that enables tracking of cloud usage and expenditures for Azure and other cloud providers.
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
- 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'
- 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.
- 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.