Edit

Share via


Get-AzReservation

Get specific Reservation details.

Syntax

List1 (Default)

Get-AzReservation
    [-Filter <String>]
    [-Orderby <String>]
    [-SelectedState <String>]
    [-First <UInt64>]
    [-Skip <UInt64>]
    [-DefaultProfile <PSObject>]
    [<CommonParameters>]

GetViaIdentityReservationOrder

Get-AzReservation
    -Id <String>
    -ReservationOrderInputObject <IReservationsIdentity>
    [-Expand <String>]
    [-DefaultProfile <PSObject>]
    [<CommonParameters>]

Get

Get-AzReservation
    -Id <String>
    -OrderId <String>
    [-Expand <String>]
    [-DefaultProfile <PSObject>]
    [<CommonParameters>]

List

Get-AzReservation
    -OrderId <String>
    [-DefaultProfile <PSObject>]
    [<CommonParameters>]

GetViaIdentity

Get-AzReservation
    -InputObject <IReservationsIdentity>
    [-Expand <String>]
    [-DefaultProfile <PSObject>]
    [<CommonParameters>]

Description

Get specific Reservation details.

Examples

Example 1: Get the list of reservation orders in the current tenant

Get-AzReservation
Location   ReservationOrderId/ReservationId                                          Sku                           State     BenefitStartTime ExpiryDate            LastUpdatedDateTime SkuDescription
--------   --------------------------------                                          ---                           -----     ---------------- ----------            ------------------- --------------
centralus  a87c1742-0080-5b4d-b953-8531ad46fdc8/cad6fef7-ae86-4d47-91d0-67c897934bfe Standard_B1s                  Succeeded                  6/1/2024 12:00:00 AM
westeurope c5cf5c26-1920-4895-bf34-098ed1c69b92/6540137e-5a4f-4a14-bd17-3f2ea72b1ff4 premium_ssd_managed_disks_p30 Succeeded                  6/1/2022 12:00:00 AM
centralus  bd82bff8-4d29-9375-8194-ce0709fc1691/f2c3a058-b469-4529-88fa-1bae251c4a47 Standard_B1s                  Cancelled                  6/1/2024 12:00:00 AM

Get the list of reservation orders in the current tenant. By design, some properties do not have data due to the api response(e.g. LastUpdatedDateTime and SkuDescription). In this case please get the single reservation with command in example 2 to get the missing data.

Some data might be truncated due to the width of powershell view, appending this to the end of the command to show the truncated data: | ft -Wrap

Example 2: Get the reservation details given ReservationOrderId and ReservationId

Get-AzReservation -ReservationOrderId a87c1742-0080-5b4d-b953-8531ad46fdc8 -ReservationId cad6fef7-ae86-4d47-91d0-67c897934bfe
Location  ReservationOrderId/ReservationId                                          Sku          State     BenefitStartTime    ExpiryDate           LastUpdatedDateTime SkuDescription
--------  --------------------------------                                          ---          -----     ----------------    ----------           ------------------- --------------
centralus a87c1742-0080-5b4d-b953-8531ad46fdc8/cad6fef7-ae86-4d47-91d0-67c897934bfe Standard_B1s Succeeded 6/1/2021 5:01:58 PM 6/1/2024 12:00:00 AM 6/1/2021 5:02:09 PM Reserved VM Instance, Standard_B1s, US Central, 3 Years

Get the details of a single reservation. Some data might be truncated due to the width of powershell view, appending this to the end of the command to show the truncated data: | ft -Wrap

Parameters

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Parameter properties

Type:PSObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzureRMContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Expand

Supported value of this query is renewProperties

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GetViaIdentityReservationOrder
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Get
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
GetViaIdentity
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Filter

May be used to filter by reservation properties. The filter supports 'eq', 'or', and 'and'. It does not currently support 'ne', 'gt', 'le', 'ge', or 'not'. Reservation properties include sku/name, properties/{appliedScopeType, archived, displayName, displayProvisioningState, effectiveDateTime, expiryDate, expiryDateTime, provisioningState, quantity, renew, reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState}

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

List1
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-First

Gets only the first 'n' objects.

Parameter properties

Type:UInt64
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

List1
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Id

Id of the reservation item

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ReservationId

Parameter sets

GetViaIdentityReservationOrder
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
Get
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-InputObject

Identity Parameter

Parameter properties

Type:IReservationsIdentity
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GetViaIdentity
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-Orderby

May be used to sort order by reservation properties.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

List1
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OrderId

Order Id of the reservation

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False
Aliases:ReservationOrderId

Parameter sets

Get
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False
List
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReservationOrderInputObject

Identity Parameter

Parameter properties

Type:IReservationsIdentity
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

GetViaIdentityReservationOrder
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-SelectedState

The selected provisioning state

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

List1
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Skip

Ignores the first 'n' objects and then gets the remaining objects.

Parameter properties

Type:UInt64
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

List1
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

IReservationsIdentity

Outputs

IReservationResponse