Search code examples
azurekqlazure-resource-graph

How to get Azure Advisor scores from azure resource graph explorer?


How to get Azure Advisor scores from azure resource graph explorer?

In particular I am looking for the Cost, Reliability, Operational Excellence and Performance total scores.

enter image description here

I know I can get the security score like this:

SecurityResources
| where type == 'microsoft.security/securescores'
| where subscriptionId == "MY-SUBSCRIPTION-ID"
| project percentageScore=properties.score.percentage

I also know it is possible to query the score through the Management REST API like this - but I really want to avoid that.


Solution

  • So unfortunately it is not possible to get Azure Advisor scores from azure resource graph.

    Right now the best way to do this is th call the Azure Management REST API.

    Here's an example. I've left out the authentication. You need to get a token and add itto the Authentication header.:

    https://management.azure.com/subscriptions/{SUBSCRIPTION_ID}/providers/Microsoft.Advisor/advisorScore?api-version=2023-01-01