Skip to content

Commit 442a042

Browse files
authored
Bug Fix for Update-AzCapacityReservationGroup (#24703)
* bug fix * changelog
1 parent 5100627 commit 442a042

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Compute/Compute/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
-->
2222
## Upcoming Release
2323
* Added cmdlet `Invoke-AzSpotPlacementRecommender`.
24+
* Fixed `Update-AzCapacityReservationGroup` to remove Subscriptions from SharingProfile.
2425

2526
## Version 7.2.0
2627
* Added parameters `-scriptUriManagedIdentity`, `-outputBlobManagedIdentity`, `-errorBlobMangedIdentity`, and `-TreatFailureAsDeploymentFailure` to cmdlets `Set-AzVmRunCommand` and `Set-AzVmssRunCommand`.

src/Compute/Compute/Generated/CapacityReservation/UpdateAzCapacityReservationGroupCommand.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ public override void ExecuteCmdlet()
131131
{
132132
resourceSharingProfile.SubscriptionIds = new List<SubResource>();
133133
}
134-
resourceSharingProfile.SubscriptionIds.Add(subResource);
134+
if (!string.IsNullOrEmpty(item))
135+
{
136+
resourceSharingProfile.SubscriptionIds.Add(subResource);
137+
}
135138
}
136139
capacityReservationGroupUpdate.SharingProfile = resourceSharingProfile;
137140
}

0 commit comments

Comments
 (0)