diff --git a/eng/common/TestResources/SubConfig-Helpers.ps1 b/eng/common/TestResources/SubConfig-Helpers.ps1 index f87b088c3dd3..4ef744828b84 100644 --- a/eng/common/TestResources/SubConfig-Helpers.ps1 +++ b/eng/common/TestResources/SubConfig-Helpers.ps1 @@ -23,6 +23,12 @@ function GetBaseAndResourceGroupNames( [string]$serviceDirectoryName, [bool]$CI ) { + if ($baseNameDefault) { + $base = $baseNameDefault.ToLowerInvariant() + $group = $resourceGroupNameDefault ? $resourceGroupNameDefault : ("rg-$baseNameDefault".ToLowerInvariant()) + return $base, $group + } + if ($CI) { $base = 't' + (New-Guid).ToString('n').Substring(0, 16) # Format the resource group name based on resource group naming recommendations and limitations. @@ -37,12 +43,6 @@ function GetBaseAndResourceGroupNames( return $base, $group } - if ($baseNameDefault) { - $base = $baseNameDefault.ToLowerInvariant() - $group = $resourceGroupNameDefault ? $resourceGroupNameDefault : ("rg-$baseNameDefault".ToLowerInvariant()) - return $base, $group - } - # Handle service directories in nested directories, e.g. `data/aztables` $serviceDirectorySafeName = $serviceDirectoryName -replace '[\./\\]', '' # Seed off resource group name if set to avoid name conflicts with deployments where it is not set