Accessing Azure Advisor using REST API
One of the cool still faily new services in Azure is the Azure Advisor feature. Azure Advisor is a service which provides insight into your subscription based upon high-availability, cost, performance or security (which is using Azure Security Center)
Using the UI (Portal) You can also download recommendations either using Excel or using PDF as well. However logging into each of these portal if you have multiple customers is a bit time consuming.
Luckily Azure Advisor is also accessable using the REST API, which can easily be scripted combined with Azure CLI from any linux host.
In order to use if you first need to send a POST command which will generate the recommendations, which I’m been using curl to achive
This script need two variables which is subscription and token (which is a service principal in Azure AD)
Read the entire article here, Accessing Azure Advisor using REST API
Via Marius Sandbu.