Share via


az reservations reservation-order

Note

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

Command group 'reservations' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Reservations reservation-order.

Commands

Name Description Type Status
az reservations reservation-order calculate

Calculate price for placing a ReservationOrder.

Extension Preview
az reservations reservation-order calculate-refund

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

Extension Preview
az reservations reservation-order change-directory

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

Extension Preview
az reservations reservation-order list

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

Extension Preview
az reservations reservation-order purchase

Create ReservationOrder and create resource under the specified URI.

Extension Preview
az reservations reservation-order return

Return a reservation.

Extension Preview
az reservations reservation-order show

Get the details of the ReservationOrder.

Extension Preview
az reservations reservation-order wait

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

Extension Preview

az reservations reservation-order calculate

Preview

Command group 'reservations' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Calculate price for placing a ReservationOrder.

az reservations reservation-order calculate [--applied-scope]
                                            [--applied-scope-property]
                                            [--applied-scope-type {ManagementGroup, Shared, Single}]
                                            [--billing-plan {Monthly, Upfront}]
                                            [--billing-scope]
                                            [--display-name]
                                            [--instance-flexibility {Off, On}]
                                            [--location]
                                            [--quantity]
                                            [--renew {0, 1, f, false, n, no, t, true, y, yes}]
                                            [--reserved-resource-type {AVS, AppService, AzureDataExplorer, AzureFiles, BlockBlob, CosmosDb, DataFactory, Databricks, DedicatedHost, ManagedDisk, MariaDb, MySql, NetAppStorage, PostgreSql, RedHat, RedHatOsa, RedisCache, SapHana, SqlAzureHybridBenefit, SqlDataWarehouse, SqlDatabases, SqlEdge, SuseLinux, VMwareCloudSimple, VirtualMachineSoftware, VirtualMachines}]
                                            [--review-date-time]
                                            [--sku]
                                            [--term {P1Y, P3Y, P5Y}]

Examples

Calculate price

az reservations reservation-order calculate --applied-scope-type Shared --billing-scope 50000000-aaaa-bbbb-cccc-100000000002 --display-name name1 --quantity 1 --reserved-resource-type VirtualMachines --sku Standard_B1s --term P1Y --billing-plan Monthly --location eastus

Optional Parameters

--applied-scope

Subscription that the benefit will be applied. Required if --applied-scope-type is Single. Do not specify if --applied-scope-type is Shared. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--applied-scope-property

Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--applied-scope-type

Type of the Applied Scope.

Accepted values: ManagementGroup, Shared, Single
--billing-plan

Represent the billing plans.

Accepted values: Monthly, Upfront
--billing-scope

Subscription that will be charged for purchasing Reservation.

--display-name

Friendly name of the Reservation.

--instance-flexibility

Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.

Accepted values: Off, On
--location

The Azure Region where the reserved resource lives.

--quantity

Quantity of the SKUs that are part of the Reservation.

--renew

Setting this to true will automatically purchase a new reservation on the expiration date time.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
Default value: False
--reserved-resource-type

The type of the resource that is being reserved.

Accepted values: AVS, AppService, AzureDataExplorer, AzureFiles, BlockBlob, CosmosDb, DataFactory, Databricks, DedicatedHost, ManagedDisk, MariaDb, MySql, NetAppStorage, PostgreSql, RedHat, RedHatOsa, RedisCache, SapHana, SqlAzureHybridBenefit, SqlDataWarehouse, SqlDatabases, SqlEdge, SuseLinux, VMwareCloudSimple, VirtualMachineSoftware, VirtualMachines
--review-date-time

This is the date-time when the Azure hybrid benefit needs to be reviewed.

--sku

Sku name for purchasing.

--term

Represent the term of Reservation.

Accepted values: P1Y, P3Y, P5Y
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az reservations reservation-order calculate-refund

Preview

Command group 'reservations' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

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

az reservations reservation-order calculate-refund --reservation-order-id
                                                   [--id]
                                                   [--quantity]
                                                   [--reservation-id]
                                                   [--scope]

Examples

Calculate refund

az reservations reservation-order calculate-refund --reservation-order-id 0000000-aaaa-bbbb-cccc-20000000001 --id /providers/microsoft.capacity/reservationOrders/0000000-aaaa-bbbb-cccc-20000000001 --scope Reservation --quantity 1 --reservation-id /providers/microsoft.capacity/reservationOrders/0000000-aaaa-bbbb-cccc-20000000001/reservations/50000000-aaaa-bbbb-cccc-200000000000

Required Parameters

--reservation-order-id

Order Id of the reservation.

Optional Parameters

--id

Fully qualified identifier of the reservation order being returned.

--quantity

Quantity to be returned. Must be greater than zero.

--reservation-id

Fully qualified identifier of the Reservation being returned.

--scope

The scope of the refund, e.g. Reservation.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az reservations reservation-order change-directory

Preview

Command group 'reservations' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

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

az reservations reservation-order change-directory --reservation-order-id
                                                   [--destination-tenant-id]

Examples

Change a reservation order to another tenant

az reservations reservation-order change-directory --reservation-order-id 50000000-aaaa-bbbb-cccc-200000000000 --destination-tenant-id 10000000-aaaa-bbbb-cccc-200000000011

Required Parameters

--reservation-order-id

Order Id of the reservation.

Optional Parameters

--destination-tenant-id

Tenant id GUID that reservation order is to be transferred to.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az reservations reservation-order list

Preview

Command group 'reservations' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

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

az reservations reservation-order list [--max-items]
                                       [--next-token]

Examples

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

az reservations reservation-order list

Optional Parameters

--max-items

Total number of items to return in the command's output. If the total number of items available is more than the value specified, a token is provided in the command's output. To resume pagination, provide the token value in --next-token argument of a subsequent command.

--next-token

Token to specify where to start paginating. This is the token value from a previously truncated response.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az reservations reservation-order purchase

Preview

Command group 'reservations' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Create ReservationOrder and create resource under the specified URI.

az reservations reservation-order purchase --reservation-order-id
                                           [--applied-scope]
                                           [--applied-scope-property]
                                           [--applied-scope-type {ManagementGroup, Shared, Single}]
                                           [--billing-plan {Monthly, Upfront}]
                                           [--billing-scope]
                                           [--display-name]
                                           [--instance-flexibility {Off, On}]
                                           [--location]
                                           [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                           [--quantity]
                                           [--renew {0, 1, f, false, n, no, t, true, y, yes}]
                                           [--reserved-resource-type {AVS, AppService, AzureDataExplorer, AzureFiles, BlockBlob, CosmosDb, DataFactory, Databricks, DedicatedHost, ManagedDisk, MariaDb, MySql, NetAppStorage, PostgreSql, RedHat, RedHatOsa, RedisCache, SapHana, SqlAzureHybridBenefit, SqlDataWarehouse, SqlDatabases, SqlEdge, SuseLinux, VMwareCloudSimple, VirtualMachineSoftware, VirtualMachines}]
                                           [--review-date-time]
                                           [--sku]
                                           [--term {P1Y, P3Y, P5Y}]

Examples

Purchase a single scope reservation

az reservations reservation-order purchase --reservation-order-id 40000000-aaaa-bbbb-cccc-200000000005 --applied-scope-type Single --billing-scope 50000000-aaaa-bbbb-cccc-200000000005 --reserved-resource-type VirtualMachines --display-name name1 --quantity 1 --sku Standard_B1s --term P1Y --billing-plan Monthly --location eastus --applied-scope 50000000-aaaa-bbbb-cccc-200000000010

Purchase a Single scope with resource group reservation

az reservations reservation-order purchase --reservation-order-id 40000000-aaaa-bbbb-cccc-200000000005 --applied-scope-type Single --billing-scope 50000000-aaaa-bbbb-cccc-200000000005 --reserved-resource-type VirtualMachines --display-name testername1 --quantity 1 --sku Standard_B1s --term P1Y --billing-plan Monthly --location eastus --applied-scope '/subscriptions/50000000-aaaa-bbbb-cccc-200000000005/resourceGroups/rg1' --instance-flexibility Off

Required Parameters

--reservation-order-id

Order Id of the reservation.

Optional Parameters

--applied-scope

Subscription that the benefit will be applied. Required if --applied-scope-type is Single. Do not specify if --applied-scope-type is Shared. Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--applied-scope-property

Properties specific to applied scope type. Not required if not applicable. Required and need to provide tenantId and managementGroupId if AppliedScopeType is ManagementGroup Support shorthand-syntax, json-file and yaml-file. Try "??" to show more.

--applied-scope-type

Type of the Applied Scope.

Accepted values: ManagementGroup, Shared, Single
--billing-plan

Represent the billing plans.

Accepted values: Monthly, Upfront
--billing-scope

Subscription that will be charged for purchasing Reservation.

--display-name

Friendly name of the Reservation.

--instance-flexibility

Turning this on will apply the reservation discount to other VMs in the same VM size group. Only specify for VirtualMachines reserved resource type.

Accepted values: Off, On
--location

The Azure Region where the reserved resource lives.

--no-wait

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

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
--quantity

Quantity of the SKUs that are part of the Reservation.

--renew

Setting this to true will automatically purchase a new reservation on the expiration date time.

Accepted values: 0, 1, f, false, n, no, t, true, y, yes
Default value: False
--reserved-resource-type

The type of the resource that is being reserved.

Accepted values: AVS, AppService, AzureDataExplorer, AzureFiles, BlockBlob, CosmosDb, DataFactory, Databricks, DedicatedHost, ManagedDisk, MariaDb, MySql, NetAppStorage, PostgreSql, RedHat, RedHatOsa, RedisCache, SapHana, SqlAzureHybridBenefit, SqlDataWarehouse, SqlDatabases, SqlEdge, SuseLinux, VMwareCloudSimple, VirtualMachineSoftware, VirtualMachines
--review-date-time

This is the date-time when the Azure hybrid benefit needs to be reviewed.

--sku

Sku name for purchasing.

--term

Represent the term of Reservation.

Accepted values: P1Y, P3Y, P5Y
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az reservations reservation-order return

Preview

Command group 'reservations' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Return a reservation.

az reservations reservation-order return --reservation-order-id
                                         [--no-wait {0, 1, f, false, n, no, t, true, y, yes}]
                                         [--quantity]
                                         [--reservation-id]
                                         [--return-reason]
                                         [--scope]
                                         [--session-id]

Examples

Return a reservation

az reservations reservation-order return --reservation-order-id 50000000-aaaa-bbbb-cccc-200000000000 --return-reason mockReason --scope Reservation --quantity 1 --reservation-id /providers/microsoft.capacity/reservationOrders/50000000-aaaa-bbbb-cccc-200000000000/reservations/30000000-aaaa-bbbb-cccc-200000000011 --session-id 40000000-aaaa-bbbb-cccc-200000000020

Required Parameters

--reservation-order-id

Order Id of the reservation.

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
--quantity

Quantity to be returned. Must be greater than zero.

--reservation-id

Fully qualified identifier of the Reservation being returned.

--return-reason

The reason of returning the reservation.

--scope

The scope of the refund, e.g. Reservation.

--session-id

SessionId that was returned by CalculateRefund API.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az reservations reservation-order show

Preview

Command group 'reservations' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Get the details of the ReservationOrder.

az reservations reservation-order show --reservation-order-id
                                       [--expand]

Examples

Get the details of a reservation order

az reservations reservation-order show --reservation-order-id 50000000-aaaa-bbbb-cccc-200000000005

Required Parameters

--reservation-order-id

Order Id of the reservation.

Optional Parameters

--expand

May be used to expand the planInformation.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az reservations reservation-order wait

Preview

Command group 'reservations' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

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

az reservations reservation-order wait --reservation-order-id
                                       [--created]
                                       [--custom]
                                       [--deleted]
                                       [--exists]
                                       [--expand]
                                       [--interval]
                                       [--timeout]
                                       [--updated]

Required Parameters

--reservation-order-id

Order Id of the reservation.

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

Default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

Default value: False
--exists

Wait until the resource exists.

Default value: False
--expand

May be used to expand the planInformation.

--interval

Polling interval in seconds.

Default value: 30
--timeout

Maximum wait in seconds.

Default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.