Skip to content

Commit 56d0430

Browse files
authored
rotate the location of creating MHSM in live test (#25341)
1 parent bedf3b2 commit 56d0430

File tree

1 file changed

+9
-2
lines changed
  • src/KeyVault/KeyVault.Test/LiveTests/ManagedHsmDataPlaneLiveTests

1 file changed

+9
-2
lines changed

src/KeyVault/KeyVault.Test/LiveTests/ManagedHsmDataPlaneLiveTests/TestSetting.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
function Get-RotatedLocation
2+
{
3+
$regions = @("eastus", "westus", "japaneast", "japanwest", "eastasia", "southeastasia", "brazilsouth", "eastus2")
4+
$index = (Get-Date).Day % 8
5+
return $regions[$index]
6+
}
7+
18
Invoke-LiveTestScenario -Name "Get and update key vault setting in a MSHM" -Description "Get and update a key vault setting in a MSHM" -Platform Linux -PowerShellVersion Latest -ScenarioScript `
29
{
310
param ($rg)
411

512
$rgName = $rg.ResourceGroupName
613
$hsmName = "bezmhsm" + (New-LiveTestRandomName -Option AllNumbers)
7-
$hsmLocation = 'eastasia'
14+
$hsmLocation = Get-RotatedLocation
815
$appId = (Get-AzContext).Account.Id
916
$adminId = (Get-AzADServicePrincipal -ApplicationId $appId).Id
1017
$hsmObject = New-AzKeyVaultManagedHsm -HsmName $hsmName -ResourceGroupName $rgName -Location $hsmLocation -Administrator $adminId -SoftDeleteRetentionInDays 7
@@ -16,4 +23,4 @@ Invoke-LiveTestScenario -Name "Get and update key vault setting in a MSHM" -Desc
1623
# Clean up
1724
Get-AzKeyVaultManagedHsm -HsmName $hsmName -ResourceGroupName $rgName | Remove-AzKeyVaultManagedHsm -Force
1825
Get-AzKeyVaultManagedHsm -HsmName $hsmName -Location $hsmLocation -InRemovedState | Remove-AzKeyVaultManagedHsm -InRemovedState -Force
19-
}
26+
}

0 commit comments

Comments
 (0)