Open mrdenny opened 6 months ago
@mrdenny Thank you for your report, we will follow up this issue with the advisor team.
@mojayara @jportugal0 Can you take a look at this issue?
@Alex-wdy could you please share how it was before? where it used to have a bunch of recommendations in the ExtendedProperties value.
I believe ExtendedProperties is working as excepted in the response shared above. It is an object that contains more info about the recommendation, and the fields/ details in this object vary from recommendation to recommendation.
@mrdenny Can you provide feedback on what you saw on your side ?
If you pull down the list of Azure recommendations $a = Get-AzAdvisorRecommendation Then pull the extended Metadata Properties (or the Extended Properties) $a[0].ExposedMetadataProperty
All you get back is an empty recordset.
Keys Values Count AdditionalProperties
{} {} 0 {}
Several months ago this would bring back values. If I look in the portal and find the same advisor recommendation there's data there, but there isn't when returning the data from powershell, and I'm not seeing a way to tell the cmdlet to return these values.
Debugging the issue. $a = Get-AzAdvisorRecommendation when I do $a[0].ToJsonstring() -> this shows all the data in the response when converted to json string. and I can also see that $a[0] has properties named -ExposedMetadataProperty, ExtendedProperty, etc but when I do $a[0].ExtendedProperty its empty
As a workaround, please use toJsonString() method on the response to retrieve the necessary data. Alternatively, you can also utilize the advisor's get recommendations API call directly.
Example: $z = Get-AzAdvisorRecommendation $z[0].toJsonstring() -> this will have the data Parse it to get the fields - $a = $z[0].toJsonstring() | convertFrom-Json $a.properties.extendedProperties
As a workaround, please use toJsonString() method on the response to retrieve the necessary data. Alternatively, you can also utilize the advisor's get recommendations API call directly.
Example: $z = Get-AzAdvisorRecommendation $z[0].toJsonstring() -> this will have the data Parse it to get the fields - $a = $z[0].toJsonstring() | convertFrom-Json $a.properties.extendedProperties
I would like to ask if you have plans to integrate this workaround into the PowerShell command line so that users do not need to write complex scripts.
Or in the documentation, highlight this point in the document.
Description
I’ve got a PowerShell script that uses Get-AzAdvisorRecommendation to pull down the list of recommendations from Azure Advisor. It used to have a bunch of recommendations in the ExtendedProperties value.
From conversations with the PG, this isn't expected.
Issue script & Debug output
Environment data
Module versions
Error output