< Back

Get-AzureRmMetricDefinition

Tue Jan 29, 2019 9:48 pm

NAME Get-AzureRmMetricDefinition



SYNOPSIS

Gets metric definitions.





SYNTAX

Get-AzureRmMetricDefinition [-ResourceId] <String> [-DefaultProfile <IAzureContextContainer>] [-DetailedOutput] [-MetricName <String[]>]

[<CommonParameters>]





DESCRIPTION

The Get-AzureRmMetricDefinition cmdlet gets metric definitions.





PARAMETERS

-DefaultProfile <IAzureContextContainer>

The credentials, account, tenant, and subscription used for communication with azure



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DetailedOutput [<SwitchParameter>]

Indicates that this operation included detailed output. If you do not specify this parameter, the output is summarized.



Required? false

Position? named

Default value False

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-MetricName <String[]>

Specifies an array of names of metrics.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ResourceId <String>

Specifies the resource ID.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

None

This cmdlet does not accept any input.





OUTPUTS

Microsoft.Azure.Commands.Insights.OutputClasses.PSMetricDefinition[]







NOTES









Example 1: Get metric definitions for a resource



PS C:\\>Get-AzureRmMetricDefinition -ResourceId

"/subscriptions/d33fb0c7-69d3-40be-e35b-4f0deba70fff/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/website2"

Name : CpuTime

Dimensions : {}

MetricAvailabilities : {Microsoft.Azure.Insights.Models.MetricAvailability,

Microsoft.Azure.Insights.Models.MetricAvailability,

Microsoft.Azure.Insights.Models.MetricAvailability}

PrimaryAggregationType : Total

Properties : {}

ResourceUri :

Unit : Seconds

Name : Requests

Dimensions : {}

MetricAvailabilities : {Microsoft.Azure.Insights.Models.MetricAvailability,

Microsoft.Azure.Insights.Models.MetricAvailability,

Microsoft.Azure.Insights.Models.MetricAvailability}

PrimaryAggregationType : Total

Properties : {}

ResourceUri :

Unit : Count



This command gets the metrics definitions for the specified resource.





Example 2: Get metric definitions with detailed output



PS C:\\>Get-AzureRmMetricDefinition -ResourceId

"/subscriptions/d33fb0c7-69d3-40be-e35b-4f0deba70fff/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/website2" -DetailedOutput

Dimensions :

MetricAvailabilities :

Location :

Retention : 2.00:00:00

Values : 00:01:00

Location :

Retention : 30.00:00:00

Values : 01:00:00

Location :

Retention : 90.00:00:00

Values : 1.00:00:00

Name : CpuTime

Properties :

PrimaryAggregationType : Total

ResourceUri :

Unit : Seconds

Dimensions :

MetricAvailabilities :

Location :

Retention : 2.00:00:00

Values : 00:01:00

Location :

Retention : 30.00:00:00

Values : 01:00:00

Location :

Retention : 90.00:00:00

Values : 1.00:00:00

Name : Requests

Properties :

PrimaryAggregationType : Total

ResourceUri :

Unit : Count



This command gets the metric definitions for website2. The output is detailed.





Example 3: Get metric definitions by name



PS C:\\>Get-AzureRmMetricDefinition -ResourceId

"/subscriptions/d33fb0c7-69d3-40be-e35b-4f0deba70fff/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/website2" -DetailedOutput

-MetricNames "BytesSent,CpuTime"

MetricAvailabilities :

Location :

Retention : 2.00:00:00

Values : 00:01:00

Location :

Retention : 30.00:00:00

Values : 01:00:00

Location :

Retention : 90.00:00:00

Values : 1.00:00:00

Name : CpuTime

Properties :

PrimaryAggregationType : Total

ResourceUri :

Unit : Seconds

Dimensions :

MetricAvailabilities :

Location :

Retention : 2.00:00:00

Values : 00:01:00

Location :

Retention : 30.00:00:00

Values : 01:00:00

Location :

Retention : 90.00:00:00

Values : 1.00:00:00

Name : BytesSent

Properties :

PrimaryAggregationType : Total

ResourceUri :

Unit : Bytes



This command gets definitions for the BytesSent and CpuTime metrics. The output is detailed.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... definition

Get-AzureRmMetricDefinition