Get-AzMetric only returns Average but no value for Maximum, Minimum
Description
When using Get-AzMetric following the documentation here, it only returns Average but never for Minimum and Maximum values as below screenshot. Just curious to know how to get Minimum and Maximum values as we can see in the Azure Portal.

My Command is as follows, the resource id is any resource id for an Azure SQL Database
(Get-AzMetric -ResourceId "someAzureSqlDbResourceIdxxxxxxxxxx" -MetricName "dtu_consumption_percent" -TimeGrain "00:01:00" -StartTime "2022-03-12T05:40:40Z").Data
Script or Debug output
No response
Environment data
Name Value
---- -----
PSVersion 7.2.1
PSEdition Core
GitCommitId 7.2.1
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Module versions
No response
Error output
There is no error
@VeryEarly , please help look into it.
May I ask if there's an update on this please? Thanks
@william-li-nintex , metric returns the result according to resource type and metric. You can search dtu_consumption_percent on page https://docs.microsoft.com/en-us/azure/azure-monitor/essentials/metrics-supported#microsoftsqlserversdatabases. The aggregation type is "average". The return result is by design.
@dingmeng-xue Thanks for your reply. The reason I raised this is because the max/min data is available in the app insights metrics per below screenshot, just wondering is there a way to retrieve the data, either using PowerShell or Api. Thanks.

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzMonEssential.
Issue Details
Description
When using Get-AzMetric following the documentation here, it only returns Average but never for Minimum and Maximum values as below screenshot. Just curious to know how to get Minimum and Maximum values as we can see in the Azure Portal.

My Command is as follows, the resource id is any resource id for an Azure SQL Database
(Get-AzMetric -ResourceId "someAzureSqlDbResourceIdxxxxxxxxxx" -MetricName "dtu_consumption_percent" -TimeGrain "00:01:00" -StartTime "2022-03-12T05:40:40Z").Data
Script or Debug output
No response
Environment data
Name Value
---- -----
PSVersion 7.2.1
PSEdition Core
GitCommitId 7.2.1
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Module versions
No response
Error output
There is no error
| Author: | william-li-nintex |
|---|---|
| Assignees: | VeryEarly |
| Labels: |
|
| Milestone: | - |
hello.. wondering if this has been answered already? :)
May be I am late to the party but I got the same issue and seems we have new input parameter called -AggregationType which can be used to get the maximum value of metrics.