Skip to content

Commit 647f8b1

Browse files
BethanyZhouazurepowershell
authored andcommitted
Merge Az.Migrate OOB release changes from Codegen/Migrate to Master (#14644)
* Move Migrate to master * Az.Migrate OOB release Co-authored-by: azurepowershell <[email protected]> Co-authored-by: Beisi Zhou <[email protected]>
1 parent 0ade558 commit 647f8b1

File tree

44 files changed

+481
-388
lines changed

Some content is hidden

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

44 files changed

+481
-388
lines changed

src/Migrate/Az.Migrate.psd1

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Microsoft Corporation
55
#
6-
# Generated on: 2/19/2021
6+
# Generated on: 3/23/2021
77
#
88

99
@{
@@ -12,7 +12,7 @@
1212
RootModule = './Az.Migrate.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '1.0.0'
15+
ModuleVersion = '1.0.1'
1616

1717
# Supported PSEditions
1818
CompatiblePSEditions = 'Core', 'Desktop'
@@ -124,10 +124,7 @@ PrivateData = @{
124124
# IconUri = ''
125125

126126
# ReleaseNotes of this module
127-
ReleaseNotes = '* Az.Migrate GA
128-
* Incorporated Initialize-AzMigrateReplicationInfrastructure as a cmdlet in the Az.Migrate module, from the external script that is run currently today.
129-
* Made some parameters of New-AzMigrateServerReplication, New-AzMigrateDiskMapping case insensitive.
130-
* Added support for scale appliance change, to handle new V3 keys.'
127+
ReleaseNotes = '* Nullref Bug fixed in get discovered server and initialize replication infrastructure commandlets.'
131128

132129
# Prerelease string of this module
133130
# Prerelease = ''

src/Migrate/Changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
-->
2020
## Upcoming Release
2121

22+
## Version 1.0.1
23+
* Nullref Bug fixed in get discovered server and initialize replication infrastructure commandlets.
24+
2225
## Version 1.0.0
2326
* Az.Migrate GA
2427
* Incorporated Initialize-AzMigrateReplicationInfrastructure as a cmdlet in the Az.Migrate module, from the external script that is run currently today.

src/Migrate/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@
2424
[assembly: ComVisible(false)]
2525
[assembly: CLSCompliant(false)]
2626
[assembly: Guid("49de559e-8965-4e80-ba75-d2f2266a0abd")]
27-
[assembly: AssemblyVersion("1.0.0")]
28-
[assembly: AssemblyFileVersion("1.0.0")]
27+
[assembly: AssemblyVersion("1.0.1")]
28+
[assembly: AssemblyFileVersion("1.0.1")]

src/Migrate/custom/Get-AzMigrateDiscoveredServer.ps1

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,27 @@ function Get-AzMigrateDiscoveredServer {
7676
throw "Server Discovery Solution not found."
7777
}
7878

79-
$appMapV2 = $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV2"] | ConvertFrom-Json
80-
$appMapV3 = $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV3"] | ConvertFrom-Json
8179
$appMap = @{}
8280

83-
# Fetch all appliance from V2 map first. Then these can be updated if found again in V3 map.
84-
foreach ($item in $appMapV2) {
85-
$appMap[$item.ApplianceName] = $item.SiteId
81+
if ($null -ne $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV2"]) {
82+
$appMapV2 = $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV2"] | ConvertFrom-Json
83+
# Fetch all appliance from V2 map first. Then these can be updated if found again in V3 map.
84+
foreach ($item in $appMapV2) {
85+
$appMap[$item.ApplianceName] = $item.SiteId
86+
}
87+
}
88+
89+
if ($null -ne $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV3"]) {
90+
$appMapV3 = $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV3"] | ConvertFrom-Json
91+
foreach ($item in $appMapV3) {
92+
$t = $item.psobject.properties
93+
$appMap[$t.Name] = $t.Value.SiteId
94+
}
8695
}
8796

88-
foreach ($item in $appMapV3) {
89-
$t = $item.psobject.properties
90-
$appMap[$t.Name] = $t.Value.SiteId
97+
if ($null -eq $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV2"] -And
98+
$null -eq $discoverySolution.DetailExtendedDetail["applianceNameToSiteIdMapV3"] ) {
99+
throw "Server Discovery Solution missing Appliance Details. Invalid Solution."
91100
}
92101

93102
# Regex to match site name.

src/Migrate/custom/Initialize-AzMigrateReplicationInfrastructure.ps1

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -182,18 +182,28 @@ public static int hashForArtifact(String artifact)
182182
# Get all appliances and sites in the project
183183
$solution = Get-AzMigrateSolution -MigrateProjectName $ProjectName -ResourceGroupName $ResourceGroupName -Name "Servers-Migration-ServerMigration"
184184
$VaultName = $solution.DetailExtendedDetail.AdditionalProperties.vaultId.Split("/")[8]
185-
$appMapV2 = $solution.DetailExtendedDetail.AdditionalProperties["applianceNameToSiteIdMapV2"] | ConvertFrom-Json
186-
$appMapV3 = $solution.DetailExtendedDetail.AdditionalProperties["applianceNameToSiteIdMapV3"] | ConvertFrom-Json
185+
187186
$appMap = @{}
188187

189-
# Fetch all appliance from V2 map first. Then these can be updated if found again in V3 map.
190-
foreach ($item in $appMapV2) {
191-
$appMap[$item.ApplianceName] = $item.SiteId
188+
if ($null -ne $solution.DetailExtendedDetail["applianceNameToSiteIdMapV2"]) {
189+
$appMapV2 = $solution.DetailExtendedDetail["applianceNameToSiteIdMapV2"] | ConvertFrom-Json
190+
# Fetch all appliance from V2 map first. Then these can be updated if found again in V3 map.
191+
foreach ($item in $appMapV2) {
192+
$appMap[$item.ApplianceName] = $item.SiteId
193+
}
194+
}
195+
196+
if ($null -ne $solution.DetailExtendedDetail["applianceNameToSiteIdMapV3"]) {
197+
$appMapV3 = $solution.DetailExtendedDetail["applianceNameToSiteIdMapV3"] | ConvertFrom-Json
198+
foreach ($item in $appMapV3) {
199+
$t = $item.psobject.properties
200+
$appMap[$t.Name] = $t.Value.SiteId
201+
}
192202
}
193203

194-
foreach ($item in $appMapV3) {
195-
$t = $item.psobject.properties
196-
$appMap[$t.Name] = $t.Value.SiteId
204+
if ($null -eq $solution.DetailExtendedDetail["applianceNameToSiteIdMapV2"] -And
205+
$null -eq $solution.DetailExtendedDetail["applianceNameToSiteIdMapV3"] ) {
206+
throw "Server Migration Solution missing Appliance Details. Invalid Solution."
197207
}
198208

199209
foreach ($eachApp in $appMap.GetEnumerator()) {

src/Migrate/generate-info.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2+
"autorest_powershell": "3.0.424",
23
"autorest_modelerfour": "4.15.414",
3-
"autorest_core": "3.0.6373",
4-
"node": "v10.16.0",
5-
"autorest": "`-- (empty)",
6-
"swagger_commit": "a8c959366fec1621befcbbd333c05581c21a5cda",
7-
"autorest_powershell": "3.0.417"
4+
"node": "v14.15.5",
5+
"autorest_core": "3.2.1",
6+
"swagger_commit": "2dd0ae5b100fee900dc0d2369401c6ab63e75f18",
7+
"autorest": "`-- (empty)"
88
}

src/Migrate/generated/api/Migrate.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,7 +1432,7 @@ public partial class Migrate
14321432
case global::System.Net.HttpStatusCode.Accepted:
14331433
{
14341434
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
1435-
await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' C:\Users\VssAdministrator\.autorest\@[email protected].417\node_modules\@autorest\powershell\dist\llcsharp\schema\object.js*/);
1435+
await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' C:\Users\VssAdministrator\.autorest\@[email protected].424\node_modules\@autorest\powershell\dist\llcsharp\schema\object.js*/);
14361436
break;
14371437
}
14381438
default:
@@ -1945,7 +1945,7 @@ public partial class Migrate
19451945
case global::System.Net.HttpStatusCode.Accepted:
19461946
{
19471947
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
1948-
await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' C:\Users\VssAdministrator\.autorest\@[email protected].417\node_modules\@autorest\powershell\dist\llcsharp\schema\object.js*/);
1948+
await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' C:\Users\VssAdministrator\.autorest\@[email protected].424\node_modules\@autorest\powershell\dist\llcsharp\schema\object.js*/);
19491949
break;
19501950
}
19511951
default:
@@ -4443,7 +4443,7 @@ public partial class Migrate
44434443
case global::System.Net.HttpStatusCode.Accepted:
44444444
{
44454445
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
4446-
await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' C:\Users\VssAdministrator\.autorest\@[email protected].417\node_modules\@autorest\powershell\dist\llcsharp\schema\object.js*/);
4446+
await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' C:\Users\VssAdministrator\.autorest\@[email protected].424\node_modules\@autorest\powershell\dist\llcsharp\schema\object.js*/);
44474447
break;
44484448
}
44494449
default:
@@ -5815,7 +5815,7 @@ public partial class Migrate
58155815
case global::System.Net.HttpStatusCode.Accepted:
58165816
{
58175817
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
5818-
await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' C:\Users\VssAdministrator\.autorest\@[email protected].417\node_modules\@autorest\powershell\dist\llcsharp\schema\object.js*/);
5818+
await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' C:\Users\VssAdministrator\.autorest\@[email protected].424\node_modules\@autorest\powershell\dist\llcsharp\schema\object.js*/);
58195819
break;
58205820
}
58215821
default:
@@ -5983,7 +5983,7 @@ public partial class Migrate
59835983
case global::System.Net.HttpStatusCode.Accepted:
59845984
{
59855985
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
5986-
await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' C:\Users\VssAdministrator\.autorest\@[email protected].417\node_modules\@autorest\powershell\dist\llcsharp\schema\object.js*/);
5986+
await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' C:\Users\VssAdministrator\.autorest\@[email protected].424\node_modules\@autorest\powershell\dist\llcsharp\schema\object.js*/);
59875987
break;
59885988
}
59895989
default:
@@ -35910,7 +35910,7 @@ public partial class Migrate
3591035910
case global::System.Net.HttpStatusCode.Accepted:
3591135911
{
3591235912
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
35913-
await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' C:\Users\VssAdministrator\.autorest\@[email protected].417\node_modules\@autorest\powershell\dist\llcsharp\schema\object.js*/);
35913+
await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' C:\Users\VssAdministrator\.autorest\@[email protected].424\node_modules\@autorest\powershell\dist\llcsharp\schema\object.js*/);
3591435914
break;
3591535915
}
3591635916
default:
@@ -37665,7 +37665,7 @@ public partial class Migrate
3766537665
case global::System.Net.HttpStatusCode.Accepted:
3766637666
{
3766737667
await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Migrate.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; }
37668-
await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' C:\Users\VssAdministrator\.autorest\@[email protected].417\node_modules\@autorest\powershell\dist\llcsharp\schema\object.js*/);
37668+
await onAccepted(_response,null /* deserializeFromResponse doesn't support '-header-' C:\Users\VssAdministrator\.autorest\@[email protected].424\node_modules\@autorest\powershell\dist\llcsharp\schema\object.js*/);
3766937669
break;
3767037670
}
3767137671
default:

0 commit comments

Comments
 (0)