Azure Resource Graph to retrieve Cost Recommendation with Resource ID and Part Number for both Current and Target SKU

51621659 1 Reputation point
2025-11-21T16:37:45.4833333+00:00

Is there a way to join the advisor resources securityresources

microsoft.advisor/recommendations

with the Resource Part Number so we can easily obtain our EA pricing?

Thank you,

Azure Advisor
Azure Advisor
An Azure personalized recommendation engine that helps users follow best practices to optimize Azure deployments.
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-11-21T16:38:06.81+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To join Azure Advisor resources with security resources in Azure Resource Graph, you can use the join operator in your queries. The microsoft.advisor/recommendations resource type can be joined with the securityResources table to retrieve relevant information, including the Resource ID and Part Number, which may help in obtaining your EA pricing.

    Here’s a basic example of how you might structure your query:

    AdvisorResources
    | join kind=inner SecurityResources on $left.resourceId == $right.resourceId
    | project $left.resourceId, $left.partNumber, $right.currentSku, $right.targetSku
    

    This query joins the AdvisorResources with SecurityResources on the resourceId, allowing you to access both the current and target SKU information along with the resource part number. Adjust the fields in the project clause as necessary to fit your specific needs.

    Keep in mind that the actual structure of your query may vary based on your specific requirements and the data available in your Azure environment.


  2. Siva shunmugam Nadessin 3,340 Reputation points Microsoft External Staff Moderator
    2025-12-11T02:00:02.3133333+00:00

    Hello 51621659,

    There are just a few issues in that URL that will break multi-location filtering with the Retail Prices API:

    What’s going wrong

    1.Bad region names The API matches exact Azure region display names. Several in your list aren’t valid Azure names:

    • EU North → North Europe
    • EU West → West Europe
    • AP Southeast → Australia Southeast (AP is not an Azure region prefix)
    • AU East → Australia East
    • US Central → Central US
    • US East 2 → East US 2
    • US North Central → North Central US
    • US South Central → South Central US
    • US West 2 → West US 2

    2.Smart quotes The curly quotes ‘ ’ will cause parsing errors. Use straight ASCII quotes '.

    3.Missing & before $filter You have meterRegion='primary'$filter=... without an & separator. If you want to use meterRegion, it must be in the filter, not as a separate query parameter.

    4.Prefer filtering on location or armRegionName For region display names, use location. (You can also use armRegionName for ARM region names when needed.)

    5.Parentheses for operator precedence OData evaluates AND before OR. Wrap the OR chain in parentheses to avoid unintended results.

    Corrected URL Example

    This filters Virtual Machines prices for the set of regions you listed, using valid Azure region names and proper OData syntax:

    https://prices.azure.com/api/retail/prices?api-version=2023-01-01-preview&$filter=
    serviceName eq 'Virtual Machines' and
    (
        location eq 'UK South' or
        location eq 'UK West' or
        location eq 'North Europe' or
        location eq 'West Europe' or
        location eq 'Central US' or
        location eq 'East US' or
        location eq 'East US 2' or
        location eq 'North Central US' or
        location eq 'South Central US' or
        location eq 'West US' or
        location eq 'West US 2' or
        location eq 'Australia East' or
        location eq 'Australia Southeast'
    )
    

    Note: When pasting into Power Query or a browser, URL-encode spaces if needed (e.g., North%20Europe). Power Query usually handles this for you, but if you build strings manually, encoding helps.


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.