Am getting an error while running cli cmd " access denied".
az monitor metrics list --resource
/subscriptions/xxx/resourceGroups/yyy/providers/Micros
oft.Compute/virtualMachines/TestVM --metric-names "Percentage CPU" --
time-grain "PT1M" >> PercentageCpuData.txt
Best Answer
Assuming your using CLI v2 then the command has a number of incorrect parameter names, it should be:
If that still doesn't work you will need to check that you do actually have the right permissions to query this.