Merge-AzReservation

Merge two reservations into one reservation within the same reservation order.

Syntax

Merge-AzReservation
     -OrderId <String>
     -ReservationId <String[]>
     [-DefaultProfile <PSObject>]
     [-WhatIf]
     [-Confirm]
     [<CommonParameters>]

Description

Merge two reservations into one reservation within the same reservation order.

Examples

Example 1: Merge two reservations into one single reservation

$arr=@("72bc398d-b201-4a2e-a1fa-60fb48a85b23", "34f2474f-b4d7-41ec-a96d-d4bb7c2f85b6")
Merge-AzReservation -ReservationOrderId "79ebddac-4030-4296-ab93-1ad90f032058" -ReservationId $arr

Location   ReservationOrderId/ReservationId                                            Sku           State     BenefitStartTime    ExpiryDate           LastUpdatedDateTime SkuDescription
--------   --------------------------------                                            ---           -----     ----------------    ----------           ------------------- --------------
westeurope 79ebddac-4030-4296-ab93-1ad90f032058/72bc398d-b201-4a2e-a1fa-60fb48a85b23/5 Standard_B1ls Cancelled 7/5/2022 1:24:21 AM 7/5/2025 12:00:00 AM 7/8/2022 1:09:29 AM Reserved VM Instan…
westeurope 79ebddac-4030-4296-ab93-1ad90f032058/34f2474f-b4d7-41ec-a96d-d4bb7c2f85b6/4 Standard_B1ls Cancelled 7/5/2022 1:24:21 AM 7/5/2025 12:00:00 AM 7/8/2022 1:09:29 AM Reserved VM Instan…
westeurope 79ebddac-4030-4296-ab93-1ad90f032058/5a91b7d0-9276-4bc9-adae-2a3f5c2ee076/2 Standard_B1ls Succeeded 7/5/2022 1:24:21 AM 7/5/2025 12:00:00 AM 7/8/2022 1:09:29 AM Reserved VM Instan…

Merge two reservations into one single reservation. The two reservations must have the same reservation order id. ReservationId can be either GUID form or fully qulified reservation id form "providers/Microsoft.Capacity/reservationOrders/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/reservations/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"

Parameters

-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 credentials, account, tenant, and subscription used for communication with Azure.

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

-OrderId

Reservation Order Id.

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

-ReservationId

Reservation Ids.

Type:String[]
Position:Named
Default value:None
Required:True
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

Outputs

IReservationResponse