Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
d14d911
Add Access Token to config
dauinsight Jul 8, 2024
f21ebce
Replace SqlConnection() with GetSqlConnection()
dauinsight Jul 8, 2024
92a7c1b
Replace SqlConnection() with GetSqlConnection()
dauinsight Jul 8, 2024
980a3bc
Add default value to GetSqlConnection()
dauinsight Jul 8, 2024
32c1de7
Add Access Token if exists
dauinsight Jul 9, 2024
34af174
Fix syntax
dauinsight Jul 9, 2024
2692ab6
Update GetSqlConnection
dauinsight Jul 9, 2024
adcf791
Debug
dauinsight Jul 10, 2024
07eb9e7
Write connection string
dauinsight Jul 10, 2024
1c8ade1
Try remove RemoteExecutor
dauinsight Jul 10, 2024
724566c
Test remove diagnostics
dauinsight Jul 11, 2024
a1f0a09
Use new sqlconnection()
dauinsight Jul 11, 2024
a1c73ed
Add connection string
dauinsight Jul 11, 2024
9c5b021
Use SqlConnection() in DiagnosticTest
dauinsight Jul 11, 2024
1e63295
Fix tests
dauinsight Jul 11, 2024
feac3cf
Merge branch 'main' into dev/daniel/azure-assign-access-token
dauinsight Jul 11, 2024
fb2764f
Configure yaml pipeline
dauinsight Jul 11, 2024
e0def57
Fix spacing
dauinsight Jul 11, 2024
da39ac2
Set variable
dauinsight Jul 11, 2024
394efc0
Added Console.WriterLines in TestInitialCatalogStandardValues to see …
arellegue Jul 11, 2024
13eaf16
Merge branch 'dev/daniel/azure-assign-access-token' of https://github…
arellegue Jul 11, 2024
33a1230
Update config yaml
dauinsight Jul 11, 2024
7fad98c
Merge branch 'dev/daniel/azure-assign-access-token' of https://github…
dauinsight Jul 11, 2024
c604f45
Iterate property descriptor of sql connection string builder.
arellegue Jul 11, 2024
a28e8fb
Merge branch 'dev/daniel/azure-assign-access-token' of https://github…
arellegue Jul 11, 2024
5c39d19
Try not using helper to create connection.
arellegue Jul 12, 2024
260e4bb
Update yaml connection string
dauinsight Jul 12, 2024
5e19bbc
Test Access Token
dauinsight Jul 12, 2024
a46c4fe
Use the connection string from config.json for getting the list of da…
arellegue Jul 12, 2024
64b10e9
Merge branch 'dev/daniel/azure-assign-access-token' of https://github…
arellegue Jul 12, 2024
424736e
Update tests
dauinsight Jul 12, 2024
c600c55
Merge branch 'dev/daniel/azure-assign-access-token' of https://github…
dauinsight Jul 12, 2024
e97189d
Test remove pooling
dauinsight Jul 13, 2024
b416dc3
Remove pooling=false, explicitly set access token in diagnostic test
dauinsight Jul 13, 2024
47667b7
Skip RemoteExecutor tests
dauinsight Jul 15, 2024
9fd9178
Find issue
dauinsight Jul 15, 2024
f26148e
Find issue
dauinsight Jul 15, 2024
e8f075e
Add access token condition
dauinsight Jul 15, 2024
b69a2d3
Update TcpConnectionStringDoesNotUseAadAuth condition
dauinsight Jul 15, 2024
1f8b760
Add logging to SqlVariantParam.SendVariantTvp function.
arellegue Jul 15, 2024
1f9c607
Resolved conflict.
arellegue Jul 15, 2024
42b0aa5
Add logging to EventCounter_HardConnectionsCounters_Functional test.
arellegue Jul 15, 2024
7584fd0
Explicitly assign AccessToken to connection string.
arellegue Jul 15, 2024
7382762
Removed logging and explicit token assignments.
arellegue Jul 15, 2024
96be21e
Restore original code.
arellegue Jul 15, 2024
c526a38
Explicitly set accesstoken EventCounter_ConnectionPoolGroupsCounter_F…
dauinsight Jul 15, 2024
8b10dcb
Merge branch 'dev/daniel/azure-assign-access-token' of https://github…
dauinsight Jul 15, 2024
d544ebc
Trigger azure automated pipeline
dauinsight Jul 15, 2024
912c713
Revert change made to trigger pipeline
dauinsight Jul 15, 2024
2dd613e
Add logging for EnterActiveConnectionPoolGroup.
arellegue Jul 15, 2024
60f561f
Remove console logs, update getaccesstoken
dauinsight Jul 16, 2024
dd68a4f
Revert changes to GetAccessToken
dauinsight Jul 16, 2024
fdaa269
Skip a few tests, add logging to GetAccessToken
dauinsight Jul 16, 2024
22c5993
Add logging of ActiveConnectionPoolGroupsCounter
arellegue Jul 16, 2024
7712285
Merge branch 'dev/daniel/azure-assign-access-token' of https://github…
arellegue Jul 16, 2024
9d58bb5
Fix GetAccessToken condition, update getsqlconnection condition
dauinsight Jul 16, 2024
a4f988d
Add more logging.
arellegue Jul 16, 2024
ee59565
Reverted changes for logging.
arellegue Jul 16, 2024
f58f8ee
Skip tests, update comments
dauinsight Jul 16, 2024
d0bb29d
Merge branch 'dev/daniel/azure-assign-access-token' of https://github…
dauinsight Jul 16, 2024
16649e0
Update authenticating with access token condition
dauinsight Jul 16, 2024
7fb9121
Update condition and readme
dauinsight Jul 17, 2024
5505f97
Address PR comments
dauinsight Jul 18, 2024
dca089f
PR comments
dauinsight Jul 19, 2024
1355417
Update yaml config
dauinsight Jul 19, 2024
8a9b8b6
Address new test failures
dauinsight Jul 19, 2024
e1dd58e
Revert UserID cred key to be removed
dauinsight Jul 19, 2024
96766dd
Find tests not using TCP connection string
dauinsight Jul 19, 2024
aae353a
Find tests that contain auth
dauinsight Jul 22, 2024
52fa34c
Find non azure tests
dauinsight Jul 22, 2024
0159d8e
Test azure tests
dauinsight Jul 22, 2024
0e83f68
Revert Non azure tests
dauinsight Jul 22, 2024
e76e0f9
Debug ProcessCommandBatch
dauinsight Jul 22, 2024
75ade72
Check result after
dauinsight Jul 22, 2024
db38ffb
Remove console writeline
dauinsight Jul 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions BUILDGUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ Manual Tests require the below setup to run:
|TCPConnectionStringAASSGX | (Optional) Connection String for a TCP enabled SQL Server with a SGX Enclave and using Microsoft Azure Attestation (AAS) attestation protocol configuration. | `Server=tcp:{servername}; Database={Database_Name}; UID={UID}; PWD={PWD}; Attestation Protocol = AAS; Enclave Attestation Url = {AttestationURL};`|
|EnclaveEnabled | Enables tests requiring an enclave-configured server.|
|TracingEnabled | Enables EventSource related tests |
|UseAccessTokenAuth | (Optional) Enables access token authentication to the database for tests.
|AADAccessToken | (Optional) Access token for authentication to the database.
|AADAuthorityURL | (Optional) Identifies the OAuth2 authority resource for `Server` specified in `AADPasswordConnectionString` | `https://login.windows.net/<tenant>`, where `<tenant>` is the tenant ID of the Azure Active Directory (Azure AD) tenant |
|AADPasswordConnectionString | (Optional) Connection String for testing Azure Active Directory Password Authentication. | `Data Source={server.database.windows.net}; Initial Catalog={Azure_DB_Name};Authentication=Active Directory Password; User ID={AAD_User}; Password={AAD_User_Password};`|
|AADSecurePrincipalId | (Optional) The Application Id of a registered application which has been granted permission to the database defined in the AADPasswordConnectionString. | {Application ID} |
Expand Down
13 changes: 13 additions & 0 deletions eng/pipelines/common/templates/jobs/ci-run-tests-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,16 @@ jobs:
- ${{ if ne(parameters.prebuildSteps, '') }}:
- ${{ parameters.prebuildSteps }} # extra steps to run before the build like downloading sni and the required configuration

- ${{ if parameters.configProperties.UseAccessTokenAuth }}:
- task: AzureCLI@2
inputs:
azureSubscription: ADO.Net-UAMI
scriptType: 'pscore'
scriptLocation: 'inlineScript'
inlineScript: |
$token = az account get-access-token --query accessToken --resource https://database.windows.net/ -o tsv
Write-Host "##vso[task.setvariable variable=UAMI_Access_Token;issecret=true;]$token"

- ${{ if ne(parameters.configProperties, '{}') }}:
- template: ../steps/update-config-file-step.yml@self # update config.json file
parameters:
Expand All @@ -94,6 +104,9 @@ jobs:
TCPConnectionString: ${{ parameters.configProperties.TCPConnectionString }}
${{ if parameters.configProperties.NPConnectionString }}:
NPConnectionString: ${{ parameters.configProperties.NPConnectionString }}
${{ if parameters.configProperties.UseAccessTokenAuth }}:
UseAccessTokenAuth: ${{ parameters.configProperties.UseAccessTokenAuth }}
AADAccessToken: $(UAMI_Access_Token)
${{ if parameters.configProperties.AADAuthorityURL }}:
AADAuthorityURL: ${{ parameters.configProperties.AADAuthorityURL }}
${{ if parameters.configProperties.TCPConnectionStringHGSVBS }}:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,15 @@ parameters:
- name: TracingEnabled
type: boolean
default: false

- name: UseAccessTokenAuth
type: boolean
default: false

- name: AADAccessToken
type: string
default: ''

- name: AADAuthorityURL
type: string
default: ''
Expand Down Expand Up @@ -134,6 +142,10 @@ steps:

$p.NPConnectionString="${{parameters.NPConnectionString }}"

$p.UseAccessTokenAuth="${{parameters.UseAccessTokenAuth}}"

$p.AADAccessToken="${{parameters.AADAccessToken}}"

$p.AADAuthorityURL="${{parameters.AADAuthorityURL }}"

$p.AADPasswordConnectionString="${{parameters.AADPasswordConnectionString }}"
Expand Down
1 change: 1 addition & 0 deletions eng/pipelines/dotnet-sqlclient-ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,4 @@ stages:
ManagedIdentitySupported: false
LocalDbAppName: $(LocalDbAppName)
LocalDbSharedInstanceName: $(LocalDbSharedInstanceName)
UseAccessTokenAuth: true
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void TestEncryptDecryptWithAKV()
AttestationProtocol = SqlConnectionAttestationProtocol.NotSpecified,
EnclaveAttestationUrl = ""
};
using SqlConnection sqlConnection = new (builder.ConnectionString);
using SqlConnection sqlConnection = DataTestUtility.GetSqlConnection(builder.ConnectionString);

sqlConnection.Open();
Customer customer = new(45, "Microsoft", "Corporation");
Expand Down Expand Up @@ -84,7 +84,7 @@ public void TestLocalCekCacheIsScopedToProvider()
EnclaveAttestationUrl = ""
};

using SqlConnection sqlConnection = new(builder.ConnectionString);
using SqlConnection sqlConnection = DataTestUtility.GetSqlConnection(builder.ConnectionString);

sqlConnection.Open();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ public static void CekCacheShouldBeDisabledWhenCustomProviderIsRegisteredGloball
{
if (SQLSetupStrategyAzureKeyVault.IsAKVProviderRegistered)
{
SqlConnection conn = new();
SqlConnection conn = DataTestUtility.GetSqlConnection();
FieldInfo globalCacheField = conn.GetType().GetField(
"s_globalCustomColumnEncryptionKeyStoreProviders", BindingFlags.Static | BindingFlags.NonPublic);
IReadOnlyDictionary<string, SqlColumnEncryptionKeyStoreProvider> globalProviders =
Expand Down
Loading