Skip to content

Commit 1c95827

Browse files
authored
[Az.Migrate] PE Fix (#19964)
* Powershell support for private endpoint * PE fix * Enable migration fix
1 parent 571f2f7 commit 1c95827

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/Migrate/custom/Initialize-AzMigrateReplicationInfrastructure.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,11 +268,11 @@ public static int hashForArtifact(String artifact)
268268
$hash = Receive-Job $job
269269

270270
Write-Host "Initiating Artifact Creation for Appliance: ", $applianceName
271+
$MigratePrefix = "migrate"
271272

272273
if ([string]::IsNullOrEmpty($CacheStorageAccountId)) {
273274
# Phase 1
274275
# Storage account
275-
$MigratePrefix = "migrate"
276276
$LogStorageAcName = $MigratePrefix + "lsa" + $hash
277277
$GateWayStorageAcName = $MigratePrefix + "gwsa" + $hash
278278
$StorageType = "Microsoft.Storage/storageAccounts"

src/Migrate/custom/New-AzMigrateServerReplication.ps1

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,17 @@ public static int hashForArtifact(String artifact)
497497
}
498498
"@
499499
Add-Type -TypeDefinition $Source -Language CSharp
500-
$hash = [HashFunctions]::hashForArtifact($HashCodeInput)
500+
if ([string]::IsNullOrEmpty($mappingObject.ProviderSpecificDetail.KeyVaultUri)) {
501+
$LogStorageAccountID = $mappingObject.ProviderSpecificDetail.StorageAccountId
502+
$LogStorageAccountSas = $LogStorageAccountID.Split('/')[-1] + '-cacheSas'
503+
}
504+
else {
505+
$hash = [HashFunctions]::hashForArtifact($HashCodeInput)
506+
$LogStorageAccountID = "/subscriptions/" + $SubscriptionId + "/resourceGroups/" +
507+
$ResourceGroupName + "/providers/Microsoft.Storage/storageAccounts/migratelsa" + $hash
508+
$LogStorageAccountSas = "migratelsa" + $hash + '-cacheSas'
509+
}
501510

502-
$LogStorageAccountID = "/subscriptions/" + $SubscriptionId + "/resourceGroups/" +
503-
$ResourceGroupName + "/providers/Microsoft.Storage/storageAccounts/migratelsa" + $hash
504-
$LogStorageAccountSas = "migratelsa" + $hash + '-cacheSas'
505511
if (!$HasTargetBDStorage) {
506512
$TargetBootDiagnosticsStorageAccount = $LogStorageAccountID
507513
}

0 commit comments

Comments
 (0)