You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set the resource group prefix after we get the tenantId (#2526)
Given we are using the tenantId to determine to add the prefix or not we need to make sure we have it set before we check it. For the pipelines it is set at the script calling time so it was working there but for some local scenarios it is not set yet, so we need to do it a little later in the script.
Co-authored-by: Wes Haggard <[email protected]>
Copy file name to clipboardExpand all lines: eng/common/TestResources/New-TestResources.ps1
+13-12Lines changed: 13 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -199,18 +199,6 @@ try {
199
199
-serviceDirectoryName $serviceName`
200
200
-CI $CI
201
201
202
-
if ($wellKnownTMETenants.Contains($TenantId)) {
203
-
# Add a prefix to the resource group name to avoid flagging the usages of local auth
204
-
# See details at https://eng.ms/docs/products/onecert-certificates-key-vault-and-dsms/key-vault-dsms/certandsecretmngmt/credfreefaqs#how-can-i-disable-s360-reporting-when-testing-customer-facing-3p-features-that-depend-on-use-of-unsafe-local-auth
205
-
$ResourceGroupName="SSS3PT_"+$ResourceGroupName
206
-
}
207
-
208
-
if ($ResourceGroupName.Length-gt90) {
209
-
# See limits at https://docs.microsoft.com/azure/architecture/best-practices/resource-naming
210
-
Write-Warning-Message "Resource group name '$ResourceGroupName' is too long. So pruning it to be the first 90 characters."
# Make sure pre- and post-scripts are passed formerly required arguments.
215
203
$PSBoundParameters['BaseName'] =$BaseName
216
204
@@ -304,6 +292,19 @@ try {
304
292
}
305
293
}
306
294
295
+
# This needs to happen after we set the TenantId but before we use the ResourceGroupName
296
+
if ($wellKnownTMETenants.Contains($TenantId)) {
297
+
# Add a prefix to the resource group name to avoid flagging the usages of local auth
298
+
# See details at https://eng.ms/docs/products/onecert-certificates-key-vault-and-dsms/key-vault-dsms/certandsecretmngmt/credfreefaqs#how-can-i-disable-s360-reporting-when-testing-customer-facing-3p-features-that-depend-on-use-of-unsafe-local-auth
299
+
$ResourceGroupName="SSS3PT_"+$ResourceGroupName
300
+
}
301
+
302
+
if ($ResourceGroupName.Length-gt90) {
303
+
# See limits at https://docs.microsoft.com/azure/architecture/best-practices/resource-naming
304
+
Write-Warning-Message "Resource group name '$ResourceGroupName' is too long. So pruning it to be the first 90 characters."
0 commit comments