简体   繁体   中英

Azure CLI - Azure Advisor Recommendation - does not have cost data for 'Microsoft.Compute/virtualMachines'

I was using az cli to get the Azure advisor recommendation data

az advisor recommendation list  --category cost  --subscription ************* -o json --query  "[?impactedField == 'Microsoft.Compute/virtualMachines'].{resource: impactedValue, cat: category, cpu:  extendedProperties.MaxCpuP95 , memory:  extendedProperties.MaxMemoryP95, saving:  extendedProperties.savingsAmount, Recommendation: shortDescription.solution }"

While downloading pdf from portal it has "Potential savings/yr". I found az cli is retuning different output for "Reserve Instances Recommendation" but for VM's it does not have cost related information.

You can use the below PowerShell cmdlet to pull the Potential savings of the virtual machine's in the subscription.

Get-AzAdvisorRecommendation -Category Cost | Where-Object {$_.ImpactedField -eq "Microsoft.Compute/virtualMachines"} | Select-Object -ExpandProperty ExtendedProperties

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM