-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Powershell Migrate changes for Capacity Reservation #28754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Powershell Migrate changes for Capacity Reservation #28754
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the Az.Migrate module to support Capacity Reservation functionality and upgrades the underlying API version from 2024-01-01 to 2025-08-01. The changes include new cmdlets for replication protection cluster operations, mobility service reinstallation, and location-based operation results, along with updated type references throughout the codebase.
Key Changes
- Added support for Target Capacity Reservation Group ID parameter in server migration and replication cmdlets
- Upgraded API version from 2024-01-01 to 2025-08-01 for Recovery Services and updated model references throughout
- Added new cmdlets for cluster protection operations and mobility service management
Reviewed Changes
Copilot reviewed 74 out of 74 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/Migrate/Migrate.Autorest/README.md |
Updated API version commit hash and input file paths to reference 2025-08-01 API version |
src/Migrate/Migrate.Autorest/Properties/AssemblyInfo.cs |
Updated assembly version from 2.9.0 to 0.1.0.0 |
src/Migrate/Migrate.Autorest/generate-info.json |
Deleted generation metadata file |
src/Migrate/Migrate.Autorest/custom/*.ps1 |
Updated model type references from Api202401 to Api20250801 and added TargetCapacityReservationGroupId parameter support |
src/Migrate/Migrate.Autorest/docs/*.md |
Updated documentation with new cmdlets and model type references to Api20250801 |
src/Migrate/Migrate.Autorest/test/*.Tests.ps1 |
Added test scaffolding for new cluster and mobility service cmdlets |
src/Migrate/Migrate.Autorest/examples/*.md |
Added placeholder example files for new cmdlets |
src/Migrate/Migrate.Autorest/UX/*.json |
Updated API versions and added UX metadata for new resource types |
| ``` yaml | ||
| skip-semantics-validation: true | ||
| commit: 473d98be4cc2fb14db8bddbba8d3184d0aa49636 | ||
| commit: ca9d05ed67fe556197b01fe795e80e4e2dc41e86 |
Copilot
AI
Oct 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit hash should be documented with a comment explaining why this specific commit was chosen and what API changes it includes. This helps future maintainers understand the reason for the specification update.
| [assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0.0")] | ||
| [assembly: System.Reflection.AssemblyVersionAttribute("0.1.0.0")] |
Copilot
AI
Oct 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The assembly version was downgraded from 2.9.0 to 0.1.0.0, which violates semantic versioning principles. Assembly versions should only increase. This change will cause compatibility issues and break existing references to the assembly.
| [assembly: System.Reflection.AssemblyFileVersionAttribute("0.1.0.0")] | |
| [assembly: System.Reflection.AssemblyVersionAttribute("0.1.0.0")] | |
| [assembly: System.Reflection.AssemblyFileVersionAttribute("2.9.0.0")] | |
| [assembly: System.Reflection.AssemblyVersionAttribute("2.9.0.0")] |
| $ProviderSpecificDetails.TargetCapacityReservationGroupId = $TargetCapacityReservationGroupId | ||
| } | ||
| else { | ||
| $ProviderSpecificDetails.TargetCapacityReservationGroupId = $ReplicationMigrationItem.ProviderSpecificDetail.TargetCapacityReservationGroupId |
Copilot
AI
Oct 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The else block unconditionally sets TargetCapacityReservationGroupId from the existing item, but there's no null check on $ReplicationMigrationItem.ProviderSpecificDetail.TargetCapacityReservationGroupId. Consider adding validation or using a null-coalescing pattern to handle cases where the property might not exist in older API responses.
| $ProviderSpecificDetails.TargetCapacityReservationGroupId = $ReplicationMigrationItem.ProviderSpecificDetail.TargetCapacityReservationGroupId | |
| if ($null -ne $ReplicationMigrationItem.ProviderSpecificDetail -and ` | |
| $ReplicationMigrationItem.ProviderSpecificDetail.PSObject.Properties['TargetCapacityReservationGroupId'] -and ` | |
| $null -ne $ReplicationMigrationItem.ProviderSpecificDetail.TargetCapacityReservationGroupId) { | |
| $ProviderSpecificDetails.TargetCapacityReservationGroupId = $ReplicationMigrationItem.ProviderSpecificDetail.TargetCapacityReservationGroupId | |
| } | |
| else { | |
| $ProviderSpecificDetails.TargetCapacityReservationGroupId = $null | |
| } |
| ``` | ||
| ### -TargetCapacityReservationGroupId | ||
| Specifies the Target Capacity Reservation Group Id within the destination Azure subscription. |
Copilot
AI
Oct 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter documentation should include the expected format of the Capacity Reservation Group ID (e.g., full resource ID path) and any validation requirements. Consider adding an example value in the parameter description.
| Specifies the Target Capacity Reservation Group Id within the destination Azure subscription. | |
| Specifies the Target Capacity Reservation Group ID within the destination Azure subscription. | |
| The value must be the full Azure resource ID path of the Capacity Reservation Group. Example format: | |
| `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/capacityReservationGroups/{capacityReservationGroupName}` | |
| For example: `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.Compute/capacityReservationGroups/myCapacityReservationGroup` | |
| The parameter must be a valid Azure resource ID string. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Description
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.