Azure retail prices API

Rafal Fraczek 60 Reputation points
2023-08-03T20:51:19.9866667+00:00

Hi,

how I can make api query to azure retail prices for service Microsoft Defender for Cloud, and resource 'servers Plan 1' and 'SQL Database on Azure' pricing.

I was trying to find anything using:

https://prices.azure.com:443/api/retail/prices?$filter=serviceName eq 'Azure Defender' and contains(productName, 'SQL')

but no result.

Thanks in advance

Microsoft Security | Microsoft Defender | Microsoft Defender for Cloud
{count} votes

3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. James Hamil 27,221 Reputation points Microsoft Employee Moderator
    2023-08-08T19:45:46.32+00:00

    Hi @Rafal Fraczek , have you tried something like this?

    For Microsoft Defender for Cloud:

    https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Microsoft Defender for Cloud'

    For 'Servers Plan 1':

    https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Windows Server' and skuName eq 'Standard'

    For 'SQL Database on Azure':

    https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Azure SQL Database' and skuName eq 'Basic'

    Please let me know if that works.

    Best,

    James

    0 comments No comments

  3. Jesse Olson 0 Reputation points
    2023-09-12T22:33:47.0333333+00:00

    hey Folks - FYI 'Azure Defender' worked for me, and I think the issue might be the productName filter.

    https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Azure Defender'
    

    Pulling almost 500 records, I'm showing the following choices for productName field:

    • Defender External Attack Surface Management
    • Microsoft Defender for Azure Cosmos DB
    • Microsoft Defender for Containers
    • Microsoft Defender for MariaDB

    In case it helps, here's my Power Query script for pulling Sentinel cost rates:

    let
        Source = (skip as number) =>
            let
                apiUrl = "https://prices.azure.com/api/retail/prices?$filter=serviceName eq 'Sentinel' or serviceName eq 'Log Analytics' or serviceName eq 'Azure Monitor' and skuName ne 'Voice Calls'&$skip=" & Text.From(skip),
                jsonContent = Json.Document(Web.Contents(apiUrl)),
                items = jsonContent[Items]
            in
                items,
        Pagination = List.Skip(List.Generate(() => 0, each _ < 7000, each _ + 100), 0),
        GetData = List.Transform(Pagination, each Source(_)),
        CombineData = Table.FromList(GetData, Splitter.SplitByNothing()),
        ExpandColumn1 = Table.ExpandListColumn(CombineData, "Column1"),
        ExpandRecord = Table.ExpandRecordColumn(ExpandColumn1, "Column1", {"currencyCode", "tierMinimumUnits", "retailPrice", "unitPrice", "armRegionName", "location", "effectiveStartDate", "meterId", "meterName", "productId", "skuId", "productName", "skuName", "serviceName", "serviceId", "serviceFamily", "unitOfMeasure", "type", "isPrimaryMeterRegion", "armSkuName"}, {"currencyCode", "tierMinimumUnits", "retailPrice", "unitPrice", "armRegionName", "location", "effectiveStartDate", "meterId", "meterName", "productId", "skuId", "productName", "skuName", "serviceName", "serviceId", "serviceFamily", "unitOfMeasure", "type", "isPrimaryMeterRegion", "armSkuName"}),
        FilteredRows = Table.SelectRows(ExpandRecord, each [armRegionName] <> null and [armRegionName] <> ""),
        #"Reordered Columns" = Table.ReorderColumns(FilteredRows,{"productName", "meterName", "skuName", "location", "armRegionName", "tierMinimumUnits", "retailPrice", "unitPrice", "currencyCode", "unitOfMeasure", "serviceName", "effectiveStartDate", "meterId", "productId", "skuId", "serviceId", "serviceFamily", "type", "isPrimaryMeterRegion", "armSkuName"}),
        #"Sorted Rows" = Table.Sort(#"Reordered Columns",{{"armRegionName", Order.Ascending}, {"meterName", Order.Ascending}})
    in
        #"Sorted Rows"
    

    Cheers, Jesse

    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.