Get-​Azure​Rm​Usage

Gets the usage metrics for a resource.

Syntax

Get-AzureRmUsage
   [-ResourceId] <String>
   [-ApiVersion <String>]
   [-EndTime <DateTime>]
   [-MetricNames <String[]>]
   [-StartTime <DateTime>]
   [<CommonParameters>]

Description

The Get-AzureRmUsage cmdlet gets the usage metrics for a specified resource.

Examples

Example 1: Get usage metrics by resource ID

PS C:\>Get-AzureRmUsage -ResourceId "/subscriptions/bcdeb07f-1c43-20be-1f3b-4f0febc10f5b/resourceGroups/Default-Web-EastUS/providers/microsoft.web/sites/pattifuller"

This command gets the usage metrics for the specified website.

Required Parameters

-ResourceId

Specifies the ID of the resource for the metric.

Type:String
Position:0
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False

Optional Parameters

-ApiVersion

Specifies an API version string, for example, 2014-04-01, which is accepted by the resource provider.

Type:String
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-EndTime

Specifies the latest time and date to search.

You can use the Get-Date cmdlet to get a DateTime object.

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-MetricNames

Specifies an array of names of metrics.

Type:String[]
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False
-StartTime

Specifies the earliest time and date to search.

You can use the Get-Date cmdlet to get a DateTime object.

Type:DateTime
Position:Named
Default value:None
Accept pipeline input:True (ByPropertyName)
Accept wildcard characters:False