question

badrisrinath-6607 avatar image
0 Votes"
badrisrinath-6607 asked Monalla-MSFT commented

How to get maximum usage of cpu percentage for Appserviceplan and for sql databases using powershell?

Need powershell script to get metrics of azure resources.

azure-monitor
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@badrisrinath-6607 - Did the below answer help resolve your issue, if not please revert back with any questions.
and if it did, please feel free to "accept as answer" so it can be beneficial to the community.

0 Votes 0 ·

1 Answer

TakahitoIwasa avatar image
0 Votes"
TakahitoIwasa answered

Hi, @badrisrinath-6607

You can use the Az-PowerShell module Get-AzMetric to access resource metrics.

Below is a sample getting the SQL Database metrics.
https://docs.microsoft.com/en-us/azure/azure-sql/database/scripts/monitor-and-scale-database-powershell

The Get-AzMetric reference below also gets the App Service metrics.
https://docs.microsoft.com/en-us/powershell/module/az.monitor/get-azmetric?view=azps-7.4.0

If this doesn't work, please tell me why.
If you can't do it well with this, ask additional questions. We will always help you.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.