When we login to azure portal and have a look at any resource like VM, we will see some monitoring data in Overview section of each resource which shows us charts for 30 days. (CPU average, network in/out etc)
My requirement is to not make any changes to azure resources via portal or cli. But i am rather looking for a powershell / azure cli command which will pull all this data from azure to my local machine for some analysis.
I am looking for VM, Web apps and Azure SQL to start with.
Thanks
Best Answer
You are right, we can use CLI 2.0 to get the metric data:
Also we can use Azure PowerShell command
Get-AzureRmMetricDefinition
to get metrics.Here are the metrics for Azure VM:
Then we can use the value to get other metrics:
Here a similar case about you, please refer to it.
By the way, difference about Azure Host metrics and Guest metrics, please refer to this link.