Skip to content

Commit 32d1aee

Browse files
azure-sdkbenbp
andauthored
Add well known tenant IDs and TME status (Azure#2261)
Co-authored-by: Ben Broderick Phillips <[email protected]>
1 parent 51f94b1 commit 32d1aee

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

eng/common/TestResources/New-TestResources.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ param (
121121
. $PSScriptRoot/TestResources-Helpers.ps1
122122
. $PSScriptRoot/SubConfig-Helpers.ps1
123123

124+
$wellKnownTMETenants = @('70a036f6-8e4d-4615-bad6-149c02e7720d')
125+
124126
if (!$ServicePrincipalAuth) {
125127
# Clear secrets if not using Service Principal auth. This prevents secrets
126128
# from being passed to pre- and post-scripts.
@@ -527,8 +529,11 @@ try {
527529
if ($CI -and $Environment -eq 'AzureCloud' -and $env:PoolSubnet) {
528530
$templateParameters.Add('azsdkPipelineSubnetList', @($env:PoolSubnet))
529531
}
530-
# Some arm/bicep templates may want to change deployment settings (e.g. local auth) in sandboxed TME tenants
531-
$templateParameters.Add('supportsSafeSecretStandard', ($context.Tenant.Name -notlike '*TME*'))
532+
# The TME tenants are our place for local auth testing so we do not support safe secret standard there.
533+
# Some arm/bicep templates may want to change deployment settings like local auth in sandboxed TME tenants.
534+
# The pipeline account context does not have the .Tenant.Name property, so check against subscription via
535+
# naming convention instead.
536+
$templateParameters.Add('supportsSafeSecretStandard', ($wellKnownTMETenants.Contains($TenantId)))
532537

533538
$defaultCloudParameters = LoadCloudConfig $Environment
534539
MergeHashes $defaultCloudParameters $(Get-Variable templateParameters)

0 commit comments

Comments
 (0)