Skip to content

Commit

Permalink
Fix regression - base name overrides in CI (#20563)
Browse files Browse the repository at this point in the history
Co-authored-by: Ben Broderick Phillips <bebroder@microsoft.com>
  • Loading branch information
azure-sdk and benbp authored Apr 5, 2023
1 parent 4bdfb89 commit 380d05a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions eng/common/TestResources/SubConfig-Helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down

0 comments on commit 380d05a

Please sign in to comment.