-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Add new support for Az.Migrate module for API versioning 2026-02-01 #29333
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -52,7 +52,7 @@ input-file: | |||||
| - $(repo)/specification/migrate/resource-manager/Microsoft.OffAzure/stable/2020-01-01/migrate.json | ||||||
| - $(repo)/specification/migrateprojects/resource-manager/Microsoft.Migrate/preview/2018-09-01-preview/migrate.json | ||||||
| - $(repo)/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/SiteRecovery/stable/2025-08-01/service.json | ||||||
| - $(repo)/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/DataReplication/stable/2024-09-01/recoveryservicesdatareplication.json | ||||||
| - /azure-rest-api-specs-pr/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/DataReplication/stable/2026-02-01/recoveryservicesdatareplication.json | ||||||
|
||||||
| - /azure-rest-api-specs-pr/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/DataReplication/stable/2026-02-01/recoveryservicesdatareplication.json | |
| - $(repo)/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/DataReplication/stable/2026-02-01/recoveryservicesdatareplication.json |
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.
Only local testing for now. Will update back to $(repo) once the new spec is checked in
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,9 @@ | ||
| # region Generated | ||
| # Load the private module dll | ||
| $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.Migrate.private.dll') | ||
| $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.Migrate.private.dll') | ||
|
|
||
| # Load the internal module | ||
| $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.Migrate.internal.psm1' | ||
| $internalModulePath = Join-Path $PSScriptRoot '../internal/Az.Migrate.internal.psm1' | ||
|
Comment on lines
+3
to
+6
|
||
| if(Test-Path $internalModulePath) { | ||
| $null = Import-Module -Name $internalModulePath | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -23,7 +23,7 @@ https://learn.microsoft.com/powershell/module/az.migrate/new-azmigratelocalserve | |||||||||||||
| #> | ||||||||||||||
| function New-AzMigrateLocalServerReplication { | ||||||||||||||
| [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.PreviewMessageAttribute("This cmdlet is based on a preview API version and may experience breaking changes in future releases.")] | ||||||||||||||
| [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20240901.IJobModel])] | ||||||||||||||
| [OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api20260201.IJobModel])] | ||||||||||||||
| [CmdletBinding(DefaultParameterSetName = 'ByIdDefaultUser', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')] | ||||||||||||||
| param( | ||||||||||||||
| [Parameter(ParameterSetName = 'ByIdDefaultUser', Mandatory)] | ||||||||||||||
|
|
@@ -65,6 +65,14 @@ function New-AzMigrateLocalServerReplication { | |||||||||||||
| # Specifies if RAM is dynamic or not. | ||||||||||||||
| ${IsDynamicMemoryEnabled}, | ||||||||||||||
|
|
||||||||||||||
| [Parameter()] | ||||||||||||||
| [ValidateSet("true" , "false")] | ||||||||||||||
| [ArgumentCompleter( { "true" , "false" })] | ||||||||||||||
| [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')] | ||||||||||||||
| [System.String] | ||||||||||||||
|
Comment on lines
+69
to
+72
|
||||||||||||||
| [ValidateSet("true" , "false")] | |
| [ArgumentCompleter( { "true" , "false" })] | |
| [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')] | |
| [System.String] | |
| [Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')] | |
| [switch] |
Copilot
AI
Mar 27, 2026
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.
-MigrateAsArcVM is modeled as a string constrained to true/false, then converted to boolean. For PowerShell UX and pipeline correctness, prefer a [switch] (or [bool]) parameter instead of a string+ValidateSet; it simplifies invocation (-MigrateAsArcVM or -MigrateAsArcVM:$false) and removes the need for manual conversion.
| $migrateAsArcVMEnabled = [System.Convert]::ToBoolean($MigrateAsArcVM) | |
| $migrateAsArcVMEnabled = $MigrateAsArcVM |
Copilot
AI
Mar 27, 2026
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.
New behavior is introduced by conditionally setting CustomProperty.MigrateAsArcVM. Add/update Pester coverage to assert the request payload sets (and omits) MigrateAsArcVM correctly based on the parameter, including validation/conversion behavior.
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.
Good call, will look into adding unit tests.
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.
There are trailing blank lines at the end of the file. Please remove them to keep generated metadata files stable and reduce unnecessary diffs.