ARI icon indicating copy to clipboard operation
ARI copied to clipboard

[Question]: Advisor tab results

Open dchuivalard opened this issue 6 months ago • 5 comments

Have a question about the project? Please write it down under! I'm trying to build a script to compare the results in the Advisor tab generated by ARI on a monthly basis. During debugging I noticed that the advisor report has more entries than the advisor page in the Azure web portal. Additionally, some rows in the advisor had identical costs, Digging in, I noticed that the advisor tab is displaying cost recommendations on the same resource, but over a different lookback period.

StartARIGraphExtraction:121

Search-AzGraph -Query "advisorresources | where properties.impact in~ ('Medium','High') | order by id asc" -Subscription $SubscriptionIDs

Should the Advisor tab either display the lookback period that the recommendation is for, or have a configurable value for what the lookback period should be?

What version are you using? 3.6.8

Any other context information Any additional information that might be helpful to answer your question

dchuivalard avatar May 30 '25 20:05 dchuivalard

Hello @dchuivalard

That is an excellent point, thanks for highlight that.

I'm adding the "term", "qty" and "lookbackperiod" in the advisor tab. Should be included in the release 3.6.9

Claudio-Merola avatar Jun 03 '25 17:06 Claudio-Merola

Great, thanks for the update!

dchuivalard avatar Jun 03 '25 19:06 dchuivalard

Might be worth including some extra filters for suppressed recommendations as well. Have a look at how the Cost Optimization workbook does it:

advisorresources | where type =~ 'microsoft.advisor/recommendations' | where resourceGroup in ({ResourceGroup}) | where properties.category == 'Cost' and properties.lastUpdated >= ago(1d) | extend AffectedResource=tostring(properties.resourceMetadata.resourceId), Category=tostring(properties.category), SubCategory=tostring(properties.impactedField), Impact=tostring(properties.impact),subscriptionId,Recommendation=tostring(properties.shortDescription.problem), id, stableId = name, recommendationTypeId = tostring(properties.recommendationTypeId), maxCpuP95 = properties.extendedProperties.MaxCpuP95,resourceGroup=strcat('/subscriptions/',subscriptionId,'/resourceGroups/',resourceGroup) | join kind = leftouter (advisorresources | where type=~'microsoft.advisor/suppressions' | extend tokens = split(id, '/') | extend stableId = iff(array_length(tokens) > 3, tokens[(array_length(tokens)-3)], '') | extend expirationTimeStamp = todatetime(iff(strcmp(tostring(properties.ttl), '-1') == 0, '9999-12-31', properties.expirationTimeStamp)) | where expirationTimeStamp > now() | project stableId, expirationTimeStamp) on stableId | where isempty(expirationTimeStamp) | project AffectedResource=tostring(properties.resourceMetadata.resourceId), Category=tostring(properties.category), SubCategory=tostring(properties.impactedField), Recommendation=tostring(properties.shortDescription.problem), Impact=tostring(properties.impact),resourceGroup,subscriptionId, id, stableId = name, recommendationTypeId = tostring(properties.recommendationTypeId), maxCpuP95 = properties.extendedProperties.MaxCpuP95 | join kind = leftouter (advisorresources | where type =~ 'microsoft.advisor/configurations' | where isempty(resourceGroup) == true | project subscriptionId, excludeRecomm = properties.exclude, lowCpuThreshold = properties.lowCpuThreshold, AffectedResource=tostring(properties.resourceMetadata.resourceId),Impact=tostring(properties.impact),resourceGroup,AdditionaInfo=properties.extendedProperties,Recommendation=tostring(properties.shortDescription.problem)) on subscriptionId | extend isActive1 = iff(isnull(excludeRecomm), true, tobool(excludeRecomm) == false) | extend isActive2 = iff(recommendationTypeId == 'e10b1381-5f0a-47ff-8c7b-37bd13d7c974', iff((isnotempty(lowCpuThreshold) and isnotempty(maxCpuP95)), toint(maxCpuP95) < toint(lowCpuThreshold), iff((isempty(maxCpuP95) or toint(maxCpuP95) < 5), true, false)), true) | where isActive1 == true and isActive2 == true | join kind = leftouter (advisorresources | where type =~ 'microsoft.advisor/configurations' | where isnotempty(resourceGroup) == true | project subscriptionId, resourceGroup, excludeProperty = properties.exclude) on subscriptionId, resourceGroup | extend isActive3 = iff(isnull(excludeProperty), true, tobool(excludeProperty) == false) | where isActive3 == true | where Category == 'Cost' | where SubCategory has "Microsoft.Compute" or SubCategory has "Container" or SubCategory has "Web" | where SubCategory !has "Microsoft.Compute/disks" | project-away subscriptionId1, subscriptionId2, AffectedResource1, isActive2, isActive3, Impact1, Recommendation1, resourceGroup1, resourceGroup2

arthurclares avatar Jun 04 '25 15:06 arthurclares

@dchuivalard

Just pushed version 3.6.9, can you test it and tell me if the new Advisor tab works?

@arthurclares Thanks for highlighting it, but we also include advisor recommendation for other things, like Reliability, Operational Excellence, and Security. We have to consider that when applying filters to the resources. Let's see how the improvements on version 3.6.9 goes and then we evaluate further improvements in version 3.6.10

Claudio-Merola avatar Jun 06 '25 13:06 Claudio-Merola

@Claudio-Merola I see the updated fields, thanks! On a related note, I noticed that Savings is set as a formula in line 71 of this file: https://github.com/microsoft/ARI/blob/main/Modules/Public/PublicFunctions/Jobs/Start-ARIAdvisoryJob.ps1

but the newly added numerical fields are just set as values. Is there a reason for this? It makes importing the file using Import-Excel a bit tricky

dchuivalard avatar Jun 12 '25 21:06 dchuivalard

This Issue is stale and may be automatically close soon.

github-actions[bot] avatar Jul 13 '25 14:07 github-actions[bot]