Skip to content

Commit 5c0c886

Browse files
authored
Fix the connection string that is set to TEST_CSM_ORGID_AUTHENTICATION (Azure#19813)
1 parent 927bce6 commit 5c0c886

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

documentation/development-docs/azure-powershell-developer-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ CI in DevOps will happens under `Debug` folder. So you need to make sure that th
338338
Create this environment variables for the AD scenario tests:
339339

340340
- `AZURE_SERVICE_PRINCIPAL` should be a service principal - an application defined in the subscription's tenant - that has management access to the subscription (or at least to a resource group in the tenant)
341-
- `AZURE_SERVICE_PRINCIPAL=UserId=<UserGuid>;Password=<Password>;AADTenant=<TenantGuid>;SubscriptionId=<SubscriptionId>`
341+
- `AZURE_SERVICE_PRINCIPAL=UserId=<UserGuid>;Password=<Password>;TenantId=<TenantGuid>;SubscriptionId=<SubscriptionId>`
342342

343343
### Recording/Running Tests
344344

documentation/testing-docs/using-azure-test-framework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ To use this option, set the following environment variable before starting Visua
121121
* The [AAD Tenant ID](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-create-service-principal-portal#get-tenant-id)
122122

123123
```
124-
TEST_CSM_ORGID_AUTHENTICATION=SubscriptionId={SubId};ServicePrincipal={clientId};ServicePrincipalSecret={clientSecret};AADTenant={tenantId};Environment={env};HttpRecorderMode=Record;
124+
TEST_CSM_ORGID_AUTHENTICATION=SubscriptionId={SubId};ServicePrincipal={clientId};ServicePrincipalSecret={clientSecret};TenantId={tenantId};Environment={env};HttpRecorderMode=Record;
125125
AZURE_TEST_MODE=Record
126126
```
127127

src/Accounts/Accounts.Test/ConnectAzAccountScenarioTests.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function Test-MaxContextPopulationWithSpecifiedValue
2323
$applicationId=$authenticationString.SubString($authenticationString.IndexOf("ServicePrincipal=")+"ServicePrincipal=".length,36)
2424
$password=$authenticationString.SubString($authenticationString.IndexOf("ServicePrincipalSecret=")+"ServicePrincipalSecret=".length,34)
2525
$secret = ConvertTo-SecureString -String $password -AsPlainText -Force
26-
$tenantId=$authenticationString.SubString($authenticationString.IndexOf("AADTenant=")+"AADTenant=".length,36)
26+
$tenantId=$authenticationString.SubString($authenticationString.IndexOf("TenantId=")+"TenantId=".length,36)
2727

2828
$credential = New-Object -TypeName System.Management.Automation.PSCredential($applicationId, $secret)
2929

@@ -55,7 +55,7 @@ function Test-MaxContextPopulationWithDefaultValue
5555
$applicationId=$authenticationString.SubString($authenticationString.IndexOf("ServicePrincipal=")+"ServicePrincipal=".length,36)
5656
$password=$authenticationString.SubString($authenticationString.IndexOf("ServicePrincipalSecret=")+"ServicePrincipalSecret=".length,34)
5757
$secret = ConvertTo-SecureString -String $password -AsPlainText -Force
58-
$tenantId=$authenticationString.SubString($authenticationString.IndexOf("AADTenant=")+"AADTenant=".length,36)
58+
$tenantId=$authenticationString.SubString($authenticationString.IndexOf("TenantId=")+"TenantId=".length,36)
5959

6060
$credential = New-Object -TypeName System.Management.Automation.PSCredential($applicationId, $secret)
6161
Connect-AzAccount -ServicePrincipal -Credential $credential -Tenant $tenantId
@@ -84,7 +84,7 @@ function Test-MaxContextPopulationGetAll
8484
$applicationId=$authenticationString.SubString($authenticationString.IndexOf("ServicePrincipal=")+"ServicePrincipal=".length,36)
8585
$password=$authenticationString.SubString($authenticationString.IndexOf("ServicePrincipalSecret=")+"ServicePrincipalSecret=".length,34)
8686
$secret = ConvertTo-SecureString -String $password -AsPlainText -Force
87-
$tenantId=$authenticationString.SubString($authenticationString.IndexOf("AADTenant=")+"AADTenant=".length,36)
87+
$tenantId=$authenticationString.SubString($authenticationString.IndexOf("TenantId=")+"TenantId=".length,36)
8888

8989
$credential = New-Object -TypeName System.Management.Automation.PSCredential($applicationId, $secret)
9090

tools/Modules/TestFx-Tasks.Tests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Describe "Test-NewCredentialNewServicePrincipal"{
3939
It "creates correctly formatted environment string" {
4040
$Env:AZURE_TEST_MODE | Should Match "Playback"
4141
$Env:TEST_CSM_ORGID_AUTHENTICATION | Should Match "SubscriptionId=" + $context.Subscription.Id + ";HttpRecorderMode=Playback;Environment=Prod;ServicePrincipal=" +
42-
"8bc48661-1801-4b7a-8ca1-6a3cadfb4870" + ";ServicePrincipalSecret=testpassword;" + "AADTenant=" + $context.Tenant.Id
42+
"8bc48661-1801-4b7a-8ca1-6a3cadfb4870" + ";ServicePrincipalSecret=testpassword;" + "TenantId=" + $context.Tenant.Id
4343
}
4444
}
4545

@@ -78,7 +78,7 @@ Describe "Test-NewCredentialExistingServicePrincipal" {
7878
It "creates correctly formatted environment string" {
7979
$Env:AZURE_TEST_MODE | Should Match "Record"
8080
$Env:TEST_CSM_ORGID_AUTHENTICATION | Should Match "SubscriptionId=" + $context.Subscription.Id + ";HttpRecorderMode=Record;Environment=Prod;ServicePrincipal=" +
81-
"1234" + ";ServicePrincipalSecret=testpassword;" + "AADTenant=" + $context.Tenant.Id
81+
"1234" + ";ServicePrincipalSecret=testpassword;" + "TenantId=" + $context.Tenant.Id
8282
}
8383
}
8484

@@ -137,7 +137,7 @@ Describe "Test-SetEnvironmentServicePrincipal" {
137137
Set-TestEnvironment -ServicePrincipalId $NewServicePrincipal.ApplicationId -ServicePrincipalSecret "testpassword" -SubscriptionId $context.Subscription.Id -TenantId $context.Tenant.Id -RecordMode "Record"
138138
It "creates correctly formatted environment string" {
139139
$Env:AZURE_TEST_MODE | Should Match "Record"
140-
$Env:TEST_CSM_ORGID_AUTHENTICATION | Should Match "SubscriptionId=" + $context.Subscription.Id + ";HttpRecorderMode=Record;Environment=Prod;AADTenant=" +
140+
$Env:TEST_CSM_ORGID_AUTHENTICATION | Should Match "SubscriptionId=" + $context.Subscription.Id + ";HttpRecorderMode=Record;Environment=Prod;TenantId=" +
141141
$context.Tenant.Id + ";ServicePrincipal=" + "1234" + ";ServicePrincipalSecret=testpassword"
142142
}
143143
}
@@ -160,4 +160,4 @@ Describe "Test-SetEnvironmentUserId" {
160160
# Clean-up
161161
Remove-Item Env:AZURE_TEST_MODE
162162
Remove-Item Env:TEST_CSM_ORGID_AUTHENTICATION
163-
}
163+
}

tools/Modules/TestFx-Tasks.psm1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ This cmdlet will only prompt you for Subscription and Tenant information, rest a
228228

229229
if([string]::IsNullOrEmpty($TenantId) -eq $false)
230230
{
231-
$formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";AADTenant={0}"), $TenantId)
231+
$formattedConnStr = [string]::Format([string]::Concat($formattedConnStr, ";TenantId={0}"), $TenantId)
232232
}
233233

234234
if([string]::IsNullOrEmpty($ServicePrincipalId) -eq $false)
@@ -325,7 +325,7 @@ Function Print-ConnectionString([string]$uid, [string]$subId, [string]$aadTenant
325325

326326
if([string]::IsNullOrEmpty($aadTenant) -eq $false)
327327
{
328-
Write-Host "AADTenant=" -ForegroundColor Green -NoNewline
328+
Write-Host "TenantId=" -ForegroundColor Green -NoNewline
329329
Write-Host $aadTenant";" -NoNewline
330330
}
331331

0 commit comments

Comments
 (0)