Skip to content

Commit 407367a

Browse files
author
Sam Lee
committed
Revert changes
1 parent f6da053 commit 407367a

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

src/Migrate/Migrate.Autorest/custom/Helper/CommonHelper.ps1

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,28 @@ function GetHCIClusterARGQuery {
4747
)
4848

4949
process {
50-
$query = "resources | where type == 'microsoft.extendedlocation/customlocations'"
51-
$query += "| mv-expand ClusterId = properties['clusterExtensionIds']"
52-
$query += "| extend ClusterId = toupper(tostring(ClusterId))"
53-
$query += "| extend CustomLocation = toupper(tostring(id))"
54-
$query += "| extend resourceBridgeID = toupper(tostring(properties['hostResourceId']))"
55-
$query += "| extend customLocationRegion = location"
56-
$query += "| join ("
57-
$query += "kubernetesconfigurationresources"
58-
$query += "| where type == 'microsoft.kubernetesconfiguration/extensions'"
59-
$query += "| where properties['ConfigurationSettings']['HCIClusterID'] =~ '$HCIClusterID'"
60-
$query += "| project ClusterId = id"
61-
$query += "| extend ClusterId = toupper(tostring(ClusterId))"
62-
$query += ") on ClusterId"
63-
$query += "| join ("
64-
$query += "resources"
65-
$query += "| where type == 'microsoft.resourceconnector/appliances'"
66-
$query += "| where properties['provisioningState'] == 'Succeeded'"
67-
$query += "| extend statusOfTheBridge = properties['status']"
68-
$query += "| extend resourceBridgeID = toupper(tostring(id))"
69-
$query += ") on resourceBridgeID"
70-
50+
$query = @"
51+
resources | where type == 'microsoft.extendedlocation/customlocations'
52+
| mv-expand ClusterId = properties['clusterExtensionIds']
53+
| extend ClusterId = toupper(tostring(ClusterId))
54+
| extend CustomLocation = toupper(tostring(id))
55+
| extend resourceBridgeID = toupper(tostring(properties['hostResourceId']))
56+
| extend customLocationRegion = location
57+
| join (
58+
kubernetesconfigurationresources
59+
| where type == 'microsoft.kubernetesconfiguration/extensions'
60+
| where properties['ConfigurationSettings']['HCIClusterID'] =~ '$HCIClusterID'
61+
| project ClusterId = id
62+
| extend ClusterId = toupper(tostring(ClusterId))
63+
) on ClusterId
64+
| join (
65+
resources
66+
| where type == 'microsoft.resourceconnector/appliances'
67+
| where properties['provisioningState'] == 'Succeeded'
68+
| extend statusOfTheBridge = properties['status']
69+
| extend resourceBridgeID = toupper(tostring(id))
70+
) on resourceBridgeID
71+
"@
7172
return $query
7273
}
7374
}

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ function Initialize-AzMigrateHCIReplicationInfrastructure {
121121
process {
122122
Import-Module $PSScriptRoot\Helper\AzStackHCICommonSettings.ps1
123123
Import-Module $PSScriptRoot\Helper\CommonHelper.ps1
124-
124+
125125
CheckResourcesModuleDependency
126126
CheckStorageModuleDependency
127127
Import-Module Az.Resources
@@ -878,7 +878,7 @@ function Initialize-AzMigrateHCIReplicationInfrastructure {
878878

879879
# Remove replication extension if does not match the selected Cache Storage Account
880880
if ($null -ne $replicationExtension -and $replicationExtension.Property.CustomProperty.StorageAccountId -ne $cacheStorageAccount.Id) {
881-
Write-Host "Replication Extension '$($replicationExtensionName)' found but linked to a different Cache Storage Account '$($replicationExtension.Property.CustomProperty.StorageAccountId)'.`nRemoving Replication Extension..."
881+
Write-Host "Replication Extension '$($replicationExtensionName)' found but linked to a different Cache Storage Account '$($replicationExtension.Property.CustomProperty.StorageAccountId)'."
882882

883883
try {
884884
Az.Migrate.Internal\Remove-AzMigrateReplicationExtension -InputObject $replicationExtension | Out-Null
@@ -889,7 +889,8 @@ function Initialize-AzMigrateHCIReplicationInfrastructure {
889889
}
890890
}
891891

892-
Start-Sleep -Seconds 30
892+
Write-Host "Removing Replication Extension and waiting for 2 minutes..."
893+
Start-Sleep -Seconds 120
893894
$replicationExtension = Az.Migrate.Internal\Get-AzMigrateReplicationExtension `
894895
-InputObject $replicationExtension `
895896
-ErrorVariable notPresent `

0 commit comments

Comments
 (0)