Azure advisor API

%3CLINGO-SUB%20id%3D%22lingo-sub-2535475%22%20slang%3D%22en-US%22%3EAzure%20advisor%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2535475%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20fetch%20cost%20recommendations%20using%20Advisor%20API%20call%20and%20need%20to%20fetch%20data%20from%20this%20category(Optimize%20virtual%20machine%20spend%20by%20resizing%20or%20shutting%20down%20underutilized%20instances).%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fadvisor%2Fadvisor-cost-recommendations%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EReduce%20service%20costs%20using%20Azure%20Advisor%20-%20Azure%20Advisor%20%7C%20Microsoft%20Docs%3C%2FA%3E%3C%2FP%3E%3CP%3EI%20can%20make%20a%20call%20but%20in%20my%20subscription%20there%20is%20no%20data%20and%20for%20that%20I%20started%202VMs%2C%20is%20there%20any%20other%20fast%20way%20to%20generate%20the%20data%3F%20as%20mentioned%20in%20the%20doc%20that%20I%20need%20to%20wait%20for%207%20days%20so%20that%20Advisor%20will%20pick%2C%20generate%20and%20show%20that%20data%20in%20Advisor%20page.%3C%2FP%3E%3CP%3ECan%20I%20get%20the%20response%20json%20of%20that%3F%20So%20that%20I%20can%20complete%20my%20code%20and%20in%20the%20meantime%20data%20will%20generate.%20Any%20words%20on%20this%20would%20be%20really%20appreciated.%20Thank%20you!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2535560%22%20slang%3D%22en-US%22%3ERe%3A%20Azure%20advisor%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2535560%22%20slang%3D%22en-US%22%3EHi%2C%3CBR%20%2F%3EDo%20you%20have%20any%20data%20in%20Azure%20portal%20at%20Advisor%20blade%20%2C%20if%20Yes%20%2C%20definitely%20you%20will%20get%20the%20same%20data%20in%20your%20API%20Call.%3CBR%20%2F%3E%3CBR%20%2F%3EIf%20you%20do%20not%20have%20any%20data%20in%20Azure%20Portal%20Advisor%20blade%20%2C%20dont%20expect%20to%20get%20while%20calling%20the%20API.%3CBR%20%2F%3E%3CBR%20%2F%3EA%20side%20Note%20%3A%20-%20also%20there%20is%20a%20Az%20Module%20to%20get%20Advisor%20not%20only%20Cost%20(%20for%20all%20aspect%20)%20.%3CBR%20%2F%3E%3CBR%20%2F%3Ejust%20have%20a%20look%20to%20all%20synatx%20%3A%20Get-AzAdvisorRecommendation%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

I am trying to fetch cost recommendations using Advisor API call and need to fetch data from this category(Optimize virtual machine spend by resizing or shutting down underutilized instances).

Reduce service costs using Azure Advisor - Azure Advisor | Microsoft Docs

I can make a call but in my subscription there is no data and for that I started 2VMs, is there any other fast way to generate the data? as mentioned in the doc that I need to wait for 7 days so that Advisor will pick, generate and show that data in Advisor page.

Can I get the response json of that? So that I can complete my code and in the meantime data will generate. Any words on this would be really appreciated. Thank you!

3 Replies
Hi,
Do you have any data in Azure portal at Advisor blade , if Yes , definitely you will get the same data in your API Call.

If you do not have any data in Azure Portal Advisor blade , dont expect to get while calling the API.

A side Note : - also there is a Az Module to get Advisor not only Cost ( for all aspect ) .

just have a look to all synatx : Get-AzAdvisorRecommendation

You need to leave the Virtual Machines on long enough for it to detect that you can reduce the cost by resizing, for example turning them off each night won't allow enough time for the advisor to collate and do any recommendations, as they aren't on for long enough, Advisor monitors for 7 days, as far as I am aware there is no way to force this, as it collates data and does some smart machine learning in the backend.

"Advisor monitors your virtual machine usage for 7 days and then identifies low-utilization virtual machines. Virtual machines are considered low-utilization if their CPU utilization is 5% or less and their network utilization is less than 2% or if the current workload can be accommodated by a smaller virtual machine size."

https://docs.microsoft.com/en-us/azure/advisor/advisor-get-started#configure-low-usage-vm-recommenda...

 

Also, take a look at Microsoft Graph Explorer as well, I wrote a brief blog article about it - using the Advisor a few months ago you may be interested in: https://luke.geek.nz/azure-resource-graph-explorer-and-the-powershell-azure-resource-graph

@vneekhra, besides what was already mentioned by other contributors, if you want to increase the chances of getting VM right-size recommendations, you should also raise the CPU threshold to a higher value, by configuring Advisor rules as documented here.