az reservations

Note

This reference is part of the reservation extension for the Azure CLI (version 2.45.0 or higher). The extension will automatically install the first time you run an az reservations command. Learn more about extensions.

Azure Reservations.

Commands

az reservations calculate-exchange

Calculates price for exchanging Reservations if there are no policy errors.

az reservations catalog

Reservations catalog.

az reservations catalog show

Get catalog of available reservation.

az reservations exchange

Returns one or more Reservations in exchange for one or more Reservation purchases.

az reservations list

List the reservations that the user has access to in the current tenant.

az reservations reservation

Reservations reservation.

az reservations reservation archive

Archiving a Reservation which is in cancelled/expired state and move it to Archived state.

az reservations reservation list

List Reservations within a single ReservationOrder.

az reservations reservation list-available-scope

List Available Scopes for Reservation.

az reservations reservation list-history

List of all the revisions for the Reservation.

az reservations reservation merge

Merge the specified Reservations into a new Reservation. The two Reservations being merged must have same properties.

az reservations reservation show

Get specific Reservation details.

az reservations reservation split

Split a Reservation into two Reservations with specified quantity distribution.

az reservations reservation unarchive

Unarchiving a Reservation moves it to the state it was before archiving.

az reservations reservation update

Update the applied scopes, renewal, name, instance-flexibility of the Reservation.

az reservations reservation wait

Place the CLI in a waiting state until a condition is met.

az reservations reservation-order

Reservations reservation-order.

az reservations reservation-order calculate

Calculate price for placing a ReservationOrder.

az reservations reservation-order calculate-refund

Calculate price for returning Reservations if there are no policy errors.

az reservations reservation-order change-directory

Change directory (tenant) of ReservationOrder and all Reservation under it to specified tenant id.

az reservations reservation-order list

List of all the ReservationOrders that the user has access to in the current tenant.

az reservations reservation-order purchase

Create ReservationOrder and create resource under the specified URI.

az reservations reservation-order return

Return a reservation.

az reservations reservation-order show

Get the details of the ReservationOrder.

az reservations reservation-order wait

Place the CLI in a waiting state until a condition is met.

az reservations reservation-order-id

Reservations reservation-order-id.

az reservations reservation-order-id list

List applicable Reservations that are applied to this subscription or a resource group under this subscription.

az reservations calculate-exchange

Calculates price for exchanging Reservations if there are no policy errors.

az reservations calculate-exchange [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                   [--ris-to-exchange]
                                   [--ris-to-purchase]
                                   [--sp-to-purchase]

Examples

Calculate exchange

az reservations calculate-exchange --ris-to-exchange "[{reservation-id:/providers/microsoft.capacity/reservationOrders/40000000-aaaa-bbbb-cccc-200000000012/reservations/51000000-aaaa-bbbb-cccc-200000000012,quantity:1},{reservation-id:/providers/microsoft.capacity/reservationOrders/90000000-aaaa-bbbb-cccc-200000000012/reservations/36000000-aaaa-bbbb-cccc-200000000012,quantity:1}]" --ris-to-purchase "[{reserved-resource-type:VirtualMachines,applied-scope-type:Shared,billing-scope:12350000-aaaa-bbbb-cccc-200000000012,display-name:exchangeTest1,quantity:1,sku:Standard_B1s,term:P1Y,billing-plan:Monthly,location:eastus},{reserved-resource-type:VirtualMachines,applied-scope-type:Shared,billing-scope:12350000-aaaa-bbbb-cccc-200000000012,display-name:exchangeTest2,quantity:1,sku:Standard_B1s,term:P1Y,billing-plan:Monthly,location:eastus}]"

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

accepted values: 0, 1, f, false, n, no, t, true, y, yes
--ris-to-exchange

List of reservations that are being returned in this exchange. Support shorthand-syntax, json-file and yaml-file. Try ?? to show more.

--ris-to-purchase

List of reservations that are being purchased in this exchange. Support shorthand-syntax, json-file and yaml-file. Try ?? to show more.

--sp-to-purchase

List of savings plans that are being purchased in this exchange. Support shorthand-syntax, json-file and yaml-file. Try ?? to show more.

az reservations exchange

Returns one or more Reservations in exchange for one or more Reservation purchases.

az reservations exchange [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                         [--session-id]

Examples

Exchange reservations

az reservations exchange --session-id 40000000-aaaa-bbbb-cccc-200000000012

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

accepted values: 0, 1, f, false, n, no, t, true, y, yes
--session-id

SessionId that was returned by CalculateExchange API.

az reservations list

List the reservations that the user has access to in the current tenant.

az reservations list [--filter]
                     [--orderby]
                     [--selected-state]

Examples

List reservations under the current tenant

az reservations list

List reservation which has "Failed" state under the current tenant

az reservations list --selected-state "Failed"

List all "VirtualMachines" reservations under the current tenant

az az reservations list --filter "properties/reservedResourceType eq 'VirtualMachines'"

List reservation and order the result by quantity in descending order

az reservations list --orderby 'properties/quantity desc'

Optional Parameters

--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, provisioningState, quantity, renew, reservedResourceType, term, userFriendlyAppliedScopeType, userFriendlyRenewState}.

--orderby

May be used to sort order by reservation properties.

--selected-state

The selected provisioning state.