How to extract azure advisor recommendation using powershell

%3CLINGO-SUB%20id%3D%22lingo-sub-2073251%22%20slang%3D%22en-US%22%3EHow%20to%20extract%20azure%20advisor%20recommendation%20using%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2073251%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20to%20extract%20azure%20advisor%20recommendation%20using%20powershell%20or%20cli%20%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2073251%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EAzure%20Automation%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2107758%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20extract%20azure%20advisor%20recommendation%20using%20powershell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2107758%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F668973%22%20target%3D%22_blank%22%3E%40Sagar_Lad%3C%2FA%3E%2C%3C%2FP%3E%3CP%3EYou%20can%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fadvisor%2Fadvisor-azure-resource-graph%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Euse%20MSGraph%3C%2FA%3E%20to%20accomplish%20this.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Frest%2Fapi%2Fadvisor%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3EAzure%20Advisor%20API%20documentation%3C%2FA%3E%20contains%20%3CSTRONG%3EReccomendations%3C%2FSTRONG%3E%20Operation%20Category%20which%20will%20give%20you%20ability%20to%20programmatically%20get%20Azure%20Advisor%20Reccomendations.%3C%2FP%3E%3CP%3EThere%20is%20also%20an%20official%20%3CA%20href%3D%22https%3A%2F%2Fwww.powershellgallery.com%2Fpackages%2FMicrosoft.Graph%2F1.3.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EMicrosoft.Graph%3C%2FA%3E%20module%20available%20on%20the%20PowerShell%20Gallery.%3C%2FP%3E%3CP%3EHope%20that%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Contributor

Hi All,

 

How to extract azure advisor recommendation using powershell or cli ?

 

1 Reply

Hello @Sagar_Lad,

You can use MSGraph to accomplish this.

Azure Advisor API documentation contains Reccomendations Operation Category which will give you ability to programmatically get Azure Advisor Reccomendations.

There is also an official Microsoft.Graph module available on the PowerShell Gallery.

Hope that helps.