Skip to content

Commit

Permalink
Fix principal
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshLove-msft authored and azure-sdk committed Aug 30, 2021
1 parent 566e76e commit 5509e86
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions eng/common/TestResources/New-TestResources.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ try {
$BaseName = 't' + (New-Guid).ToString('n').Substring(0, 16)
Log "Generated base name '$BaseName' for CI build"
} elseif (!$BaseName) {
$BaseName = "$UserName$ServiceDirectory" + (New-Guid).ToString('n').Substring(0, 4)
$BaseName = "$UserName$ServiceDirectory"
Log "BaseName was not set. Using default base name '$BaseName'"
}

Expand Down Expand Up @@ -289,7 +289,8 @@ try {
$AzureTestPrincipal
} else {
Log "TestApplicationId was not specified; creating a new service principal in subscription '$SubscriptionId'"
$global:AzureTestPrincipal = New-AzADServicePrincipal -Role Owner -Scope "/subscriptions/$SubscriptionId" -DisplayName "test-resources-$($baseName).microsoft.com"
$suffix = (New-Guid).ToString('n').Substring(0, 4)
$global:AzureTestPrincipal = New-AzADServicePrincipal -Role Owner -Scope "/subscriptions/$SubscriptionId" -DisplayName "test-resources-$($baseName)$suffix.microsoft.com"
$global:AzureTestSubscription = $SubscriptionId

Log "Created service principal '$($AzureTestPrincipal.ApplicationId)'"
Expand Down

0 comments on commit 5509e86

Please sign in to comment.