編輯

共用方式為


Update-AzReservation

Updates the applied scopes of the Reservation.

Syntax

Update-AzReservation
      -Id <String>
      -OrderId <String>
      [-AppliedScope <String[]>]
      [-AppliedScopePropertyDisplayName <String>]
      [-AppliedScopePropertyManagementGroupId <String>]
      [-AppliedScopePropertyResourceGroupId <String>]
      [-AppliedScopePropertySubscriptionId <String>]
      [-AppliedScopePropertyTenantId <String>]
      [-AppliedScopeType <AppliedScopeType>]
      [-InstanceFlexibility <InstanceFlexibility>]
      [-Name <String>]
      [-Renew]
      [-RenewProperty <IPatchPropertiesRenewProperties>]
      [-ReviewDateTime <DateTime>]
      [-DefaultProfile <PSObject>]
      [-AsJob]
      [-NoWait]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzReservation
      -Id <String>
      -OrderId <String>
      -Reservation <IPatch>
      [-DefaultProfile <PSObject>]
      [-AsJob]
      [-NoWait]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzReservation
      -InputObject <IReservationsIdentity>
      [-AppliedScope <String[]>]
      [-AppliedScopePropertyDisplayName <String>]
      [-AppliedScopePropertyManagementGroupId <String>]
      [-AppliedScopePropertyResourceGroupId <String>]
      [-AppliedScopePropertySubscriptionId <String>]
      [-AppliedScopePropertyTenantId <String>]
      [-AppliedScopeType <AppliedScopeType>]
      [-InstanceFlexibility <InstanceFlexibility>]
      [-Name <String>]
      [-Renew]
      [-RenewProperty <IPatchPropertiesRenewProperties>]
      [-ReviewDateTime <DateTime>]
      [-DefaultProfile <PSObject>]
      [-AsJob]
      [-NoWait]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]
Update-AzReservation
      -InputObject <IReservationsIdentity>
      -Reservation <IPatch>
      [-DefaultProfile <PSObject>]
      [-AsJob]
      [-NoWait]
      [-WhatIf]
      [-Confirm]
      [<CommonParameters>]

Description

Updates the applied scopes of the Reservation.

Examples

Example 1: Update Reservation's properties

Update-AzReservation -ReservationOrderId "30000000-aaaa-bbbb-cccc-200000000013" -ReservationId "10000000-aaaa-bbbb-cccc-200000000007" -Name "testName"

Location   ReservationOrderId/ReservationId                                             Sku           State     BenefitStartTime     ExpiryDate            LastUpdatedDateTime  SkuDescription
--------   --------------------------------                                             ---           -----     ----------------     ----------            -------------------  --------------
westeurope 30000000-aaaa-bbbb-cccc-200000000013/10000000-aaaa-bbbb-cccc-200000000007/16 Standard_B4ms Succeeded 6/14/2022 9:41:17 PM 6/14/2025 12:00:00 AM 7/7/2022 11:37:58 PM Reserved VM In…

Update Reservation's properties including name, renew, appliedScopeType, appliedScope

Example 2: Update Reservation's AppliedScopeType

# Shared scope:
Update-AzReservation -ReservationOrderId "30000000-aaaa-bbbb-cccc-200000000013" -ReservationId "10000000-aaaa-bbbb-cccc-200000000007" -AppliedScopeType "Shared"

# Single scope:
Update-AzReservation -ReservationOrderId "30000000-aaaa-bbbb-cccc-200000000013" -ReservationId "10000000-aaaa-bbbb-cccc-200000000007" -AppliedScopeType "Single" -AppliedScope "/subscriptions/30000000-aaaa-bbbb-cccc-200000000018"

# Single scope with resource group:
Update-AzReservation -ReservationOrderId "30000000-aaaa-bbbb-cccc-200000000013" -ReservationId "10000000-aaaa-bbbb-cccc-200000000007" -AppliedScopeType "Single" -AppliedScope "/subscriptions/30000000-aaaa-bbbb-cccc-200000000018/resourcegroups/{your resource group name}"

Similar to example 1

Update Reservation's applied scope type. For Shared scope, don't pass in any applied scope id. For Single scope, pass in applied scope id and for Single scope with resource group, also pass in resource group name in the applied scope id

Parameters

-AppliedScope

List of the subscriptions that the benefit will be applied. Do not specify if AppliedScopeType is Shared. This property will be deprecated and replaced by appliedScopeProperties instead for Single AppliedScopeType.

Type:String[]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AppliedScopePropertyDisplayName

Display name

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AppliedScopePropertyManagementGroupId

Fully-qualified identifier of the management group where the benefit must be applied.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AppliedScopePropertyResourceGroupId

Fully-qualified identifier of the resource group.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AppliedScopePropertySubscriptionId

Fully-qualified identifier of the subscription.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AppliedScopePropertyTenantId

Tenant ID where the savings plan should apply benefit.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AppliedScopeType

Type of the Applied Scope.

Type:AppliedScopeType
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-AsJob

Run the command as a job

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DefaultProfile

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

Type:PSObject
Aliases:AzureRMContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Id

Id of the reservation item

Type:String
Aliases:ReservationId
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.

Type:IReservationsIdentity
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-InstanceFlexibility

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

Type:InstanceFlexibility
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Name

Display name of the reservation

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-NoWait

Run the command asynchronously

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-OrderId

Order Id of the reservation

Type:String
Aliases:ReservationOrderId
Position:Named
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Renew

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

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-RenewProperty

. To construct, see NOTES section for RENEWPROPERTY properties and create a hash table.

Type:IPatchPropertiesRenewProperties
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Reservation

The request for reservation patch To construct, see NOTES section for RESERVATION properties and create a hash table.

Type:IPatch
Position:Named
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-ReviewDateTime

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

Type:DateTime
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

IPatch

IReservationsIdentity

Outputs

IReservationResponse