Skip to content

Commit e8b9234

Browse files
azure-pipelines[bot]azure-powershell-botNickcandy
authored
Migrate Migrate from generation to main (#26407)
* Move Migrate to main * Update ChangeLog.md --------- Co-authored-by: azure-powershell-bot <[email protected]> Co-authored-by: NanxiangLiu <[email protected]>
1 parent 549658a commit e8b9234

File tree

2,614 files changed

+40567
-27245
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,614 files changed

+40567
-27245
lines changed

src/Migrate/Migrate.Autorest/Az.Migrate.format.ps1xml

Lines changed: 1625 additions & 975 deletions
Large diffs are not rendered by default.

src/Migrate/Migrate.Autorest/README.md

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@ In this directory, run AutoRest:
4545
4646
``` yaml
4747
skip-semantics-validation: true
48-
commit: 0dd49a444195fef7f3555cad038cb7665cbd928c
48+
commit: 3b19762dab3c48c857ae2355da351b32dde22eda
4949
require:
5050
- $(this-folder)/../../readme.azure.noprofile.md
5151
input-file:
5252
- $(repo)/specification/migrate/resource-manager/Microsoft.OffAzure/stable/2020-01-01/migrate.json
5353
- $(repo)/specification/migrateprojects/resource-manager/Microsoft.Migrate/preview/2018-09-01-preview/migrate.json
54-
- $(repo)/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/service.json
54+
- $(repo)/specification/recoveryservicessiterecovery/resource-manager/Microsoft.RecoveryServices/stable/2024-01-01/service.json
5555
- $(repo)/specification/recoveryservicesdatareplication/resource-manager/Microsoft.DataReplication/preview/2021-02-16-preview/recoveryservicesdatareplication.json
5656

5757
module-version: 1.0.1
@@ -120,55 +120,55 @@ directive:
120120
- TaskModel
121121
- TaskModelCustomProperties
122122
# Remove variants not in scope
123-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
123+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
124124
where:
125125
verb: Test$
126126
subject: ^ReplicationMigrationItemMigrate
127127
variant: ^TestViaIdentity$|^TestViaIdentityExpanded$|^Test$
128128
remove: true
129-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
129+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
130130
where:
131131
verb: Get$
132132
subject: ReplicationFabric$|ReplicationPolicy$|ReplicationProtectionContainer$|ReplicationMigrationItem$|ReplicationJob$|ReplicationProtectionContainerMapping$|ReplicationRecoveryServicesProvider$
133133
variant: ^GetViaIdentity$
134134
remove: true
135-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
135+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
136136
where:
137137
verb: Remove$
138138
subject: ^ReplicationMigrationItem
139139
variant: ^DeleteViaIdentity$
140140
remove: true
141-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
141+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
142142
where:
143143
verb: Move$
144144
subject: ^ReplicationMigrationItem
145145
variant: ^MigrateViaIdentityExpanded$|^Migrate$|^MigrateViaIdentity$
146146
remove: true
147-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
147+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
148148
where:
149149
verb: Suspend$
150150
subject: ^ReplicationMigrationItemReplication
151151
variant: ^PauseViaIdentityExpanded$|^Pause$|^PauseViaIdentity$
152152
remove: true
153-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
153+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
154154
where:
155155
verb: Resume$
156156
subject: ^ReplicationMigrationItemReplication
157157
variant: ^ResumeViaIdentityExpanded$|^Resume$|^ResumeViaIdentity$
158158
remove: true
159-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
159+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
160160
where:
161161
verb: Invoke$
162162
subject: ^ResyncReplicationMigrationItem
163163
variant: ^ResyncViaIdentityExpanded$|^ResyncViaIdentity$|^Resync$
164164
remove: true
165-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
165+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
166166
where:
167167
verb: New$
168168
subject: ^ReplicationMigrationItem|ReplicationProtectionContainerMapping$|ReplicationPolicy$
169169
variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$|^Create$
170170
remove: true
171-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
171+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
172172
where:
173173
verb: Update$
174174
subject: ^ReplicationMigrationItem
@@ -266,49 +266,49 @@ directive:
266266
verb: Update$
267267
subject: Project$
268268
remove: true
269-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
269+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
270270
where:
271271
subject: ^ReplicationRecoveryPlan|ReplicationRecoveryServiceProvider$|ReplicationEvent$|ReplicationAlertSetting$|ReplicationLogicalNetwork$|^ReplicationProtectedItem|^ReplicationNetwork|^ReplicationStorage|RecoveryPoint$|ProtectableItem$|FabricGateway$|FabricToAad$|ReplicationvCenter$
272272
remove: true
273-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
273+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
274274
where:
275275
verb: Export$|Find$|Switch$|Clear$
276276
remove: true
277-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
277+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
278278
where:
279279
subject: ^Commit|^Renew|^Reprotect|^Unplanned|VaultHealth$|ComputeSize$|FabricConsistency$
280280
remove: true
281-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
281+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
282282
where:
283283
verb: New$|Remove$
284284
subject: Fabric$|ProtectionContainer$|ReplicationRecoveryServicesProvider$
285285
remove: true
286-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
286+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
287287
where:
288288
verb: Remove$
289-
subject: ReplicationPolicy$|ReplicationProtectionContainerMapping$
289+
subject: ReplicationPolicy$|ReplicationProtectionContainerMapping$|ReplicationFabricInfra$
290290
remove: true
291-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
291+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
292292
where:
293293
verb: Update$
294294
subject: Fabric$|Policy$|ProtectionContainer$|ReplicationProtectionContainerMapping$
295295
remove: true
296-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
296+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
297297
where:
298298
verb: Stop$|Resume$|Restart$
299299
subject: Job$
300300
remove: true
301-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
301+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
302302
where:
303303
verb: Get
304304
subject: ^ReplicationAppliance|^ReplicationEligibilityResult|^ReplicationProtectionIntent
305305
remove: true
306-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
306+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
307307
where:
308308
verb: Get
309309
subject: ^ReplicationVaultSetting|^SupportedOperatingSystem|^ReplicationProtectionIntent
310310
remove: true
311-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
311+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
312312
where:
313313
verb: New
314314
subject: ^ReplicationVaultSetting|^SupportedOperatingSystem|^ReplicationProtectionIntent
@@ -358,7 +358,7 @@ directive:
358358
verb: Update
359359
subject: ^Vault
360360
remove: true
361-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
361+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
362362
where:
363363
verb: Invoke
364364
subject: ^PlannedReplication
@@ -376,57 +376,57 @@ directive:
376376
verb: Set$
377377
subject: ^Solution
378378
hide: true
379-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
379+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
380380
where:
381381
verb: Get$
382382
subject: ToAzureMigrate$
383383
hide: true
384-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
384+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
385385
where:
386386
verb: Get$
387387
subject: ReplicationMigrationItem$|ReplicationJob$
388388
hide: true
389-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
389+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
390390
where:
391391
verb: Test$
392392
subject: ^ReplicationMigrationItemMigrate
393393
hide: true
394-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
394+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
395395
where:
396396
verb: New$|Remove$
397397
subject: ^ReplicationMigrationItem
398398
hide: true
399-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
399+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
400400
where:
401401
verb: Move$
402402
subject: ^ReplicationMigrationItem
403403
hide: true
404-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
404+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
405405
where:
406406
verb: Restart$
407407
subject: ^ReplicationJob
408408
hide: true
409-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
409+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
410410
where:
411411
verb: Invoke$
412412
subject: ^ResyncReplicationMigrationItem
413413
hide: true
414-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
414+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
415415
where:
416416
verb: Update$
417417
subject: ^ReplicationMigrationItem
418418
hide: true
419-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
419+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
420420
where:
421421
verb: Suspend$
422422
subject: ^ReplicationMigrationItemReplication
423423
hide: true
424-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
424+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
425425
where:
426426
verb: Resume$
427427
subject: ^ReplicationMigrationItemReplication
428428
hide: true
429-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
429+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
430430
where:
431431
subject: ^Planned
432432
hide: true
@@ -475,17 +475,17 @@ directive:
475475
parameter-name: Name
476476
clear-alias: true
477477
# Table output formatting
478-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
478+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
479479
where:
480480
model-name: MigrationItem
481481
set:
482482
suppress-format: true
483-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
483+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
484484
where:
485485
model-name: Job
486486
set:
487487
suppress-format: true
488-
- from: Microsoft.RecoveryServices/stable/2023-01-01/service.json
488+
- from: Microsoft.RecoveryServices/stable/2024-01-01/service.json
489489
where:
490490
model-name: Fabric
491491
set:

src/Migrate/Migrate.Autorest/UX/Microsoft.RecoveryServices/vaults-replicationFabrics-replicationProtectionContainers-replicationProtectionContainerMappings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "vaults/replicationFabrics/replicationProtectionContainers/replicationProtectionContainerMappings",
3-
"apiVersion": "2023-01-01",
3+
"apiVersion": "2024-01-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.migrate"
66
},

src/Migrate/Migrate.Autorest/UX/Microsoft.RecoveryServices/vaults-replicationFabrics-replicationProtectionContainers.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "vaults/replicationFabrics/replicationProtectionContainers",
3-
"apiVersion": "2023-01-01",
3+
"apiVersion": "2024-01-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.migrate"
66
},

src/Migrate/Migrate.Autorest/UX/Microsoft.RecoveryServices/vaults-replicationFabrics-replicationRecoveryServicesProviders.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "vaults/replicationFabrics/replicationRecoveryServicesProviders",
3-
"apiVersion": "2023-01-01",
3+
"apiVersion": "2024-01-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.migrate"
66
},

src/Migrate/Migrate.Autorest/UX/Microsoft.RecoveryServices/vaults-replicationPolicies.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"resourceType": "vaults/replicationPolicies",
3-
"apiVersion": "2023-01-01",
3+
"apiVersion": "2024-01-01",
44
"learnMore": {
55
"url": "https://learn.microsoft.com/powershell/module/az.migrate"
66
},

src/Migrate/Migrate.Autorest/build-module.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ if(-not $Isolated -and -not $Debugger) {
6767
$binFolder = Join-Path $PSScriptRoot 'bin'
6868
$objFolder = Join-Path $PSScriptRoot 'obj'
6969

70+
$isAzure = [System.Convert]::ToBoolean('true')
71+
7072
if(-not $Debugger) {
7173
Write-Host -ForegroundColor Green 'Cleaning build folders...'
7274
$null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder
@@ -143,7 +145,7 @@ if($NoDocs) {
143145
$null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue
144146
}
145147
$null = New-Item -ItemType Directory -Force -Path $docsFolder
146-
$addComplexInterfaceInfo = ![System.Convert]::ToBoolean('true')
148+
$addComplexInterfaceInfo = !$isAzure
147149
Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid -AddComplexInterfaceInfo:$addComplexInterfaceInfo
148150
}
149151

@@ -178,5 +180,4 @@ if (-not $DisableAfterBuildTasks){
178180
}
179181
}
180182

181-
182-
Write-Host -ForegroundColor Green '-------------Done-------------'
183+
Write-Host -ForegroundColor Green '-------------Done-------------'

src/Migrate/Migrate.Autorest/custom/Get-AzMigrateJob.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The Get-AzMigrateJob cmdlet retrives the status of an Azure Migrate job.
2222
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigratejob
2323
#>
2424
function Get-AzMigrateJob {
25-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.IJob])]
25+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202401.IJob])]
2626
[CmdletBinding(DefaultParameterSetName = 'ListByName', PositionalBinding = $false)]
2727
param(
2828
[Parameter(ParameterSetName = 'GetById', Mandatory)]
@@ -53,7 +53,7 @@ function Get-AzMigrateJob {
5353

5454
[Parameter(ParameterSetName = 'GetByInputObject', Mandatory)]
5555
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
56-
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.IJob]
56+
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202401.IJob]
5757
# Specifies the job object of the replicating server.
5858
${InputObject},
5959

src/Migrate/Migrate.Autorest/custom/Get-AzMigrateServerReplication.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The Get-AzMigrateServerReplication cmdlet retrieves the object for the replicati
2222
https://learn.microsoft.com/powershell/module/az.migrate/get-azmigrateserverreplication
2323
#>
2424
function Get-AzMigrateServerReplication {
25-
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.IMigrationItem])]
25+
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202401.IMigrationItem])]
2626
[CmdletBinding(DefaultParameterSetName = 'ListByName', PositionalBinding = $false)]
2727
param(
2828
[Parameter(ParameterSetName = 'GetBySRSID', Mandatory)]
@@ -53,7 +53,7 @@ function Get-AzMigrateServerReplication {
5353

5454
[Parameter(ParameterSetName = 'GetByInputObject', Mandatory)]
5555
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Category('Path')]
56-
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202301.IMigrationItem]
56+
[Microsoft.Azure.PowerShell.Cmdlets.Migrate.Models.Api202401.IMigrationItem]
5757
# Specifies the machine object of the replicating server.
5858
${InputObject},
5959

src/Migrate/Migrate.Autorest/custom/Initialize-AzMigrateHCIReplicationInfrastructure.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,13 @@ function Initialize-AzMigrateHCIReplicationInfrastructure {
161161
}
162162

163163
if (-not $userObject) {
164-
$userObject = Get-AzADServicePrincipal -ApplicationID $context.Account.Id
164+
if ($context.Account.Id.StartsWith("MSI@")) {
165+
$hostname = $env:COMPUTERNAME
166+
$userObject = Get-AzADServicePrincipal -DisplayName $hostname
167+
}
168+
else {
169+
$userObject = Get-AzADServicePrincipal -ApplicationID $context.Account.Id
170+
}
165171
}
166172

167173
if (-not $userObject) {

0 commit comments

Comments
 (0)