diff --git a/eng/pipelines/templates/jobs/live.tests.yml b/eng/pipelines/templates/jobs/live.tests.yml index a75d58bdf5903..108b8ae8281a4 100644 --- a/eng/pipelines/templates/jobs/live.tests.yml +++ b/eng/pipelines/templates/jobs/live.tests.yml @@ -110,7 +110,7 @@ jobs: - pwsh: > dotnet test eng/service.proj --framework $(TestTargetFramework) - --filter "TestCategory!=Manually" + --filter "(TestCategory!=Manually)&(FullyQualifiedName~Azure.Identity.Tests.VisualStudioCodeCredentialLiveTests)" --logger "trx" --logger:"console;verbosity=normal" /p:SDKType=${{ parameters.SDKType }} diff --git a/sdk/identity/Azure.Identity/tests/CredentialTestHelpers.cs b/sdk/identity/Azure.Identity/tests/CredentialTestHelpers.cs index 7961d9bf931db..f3ee2e97fdb8f 100644 --- a/sdk/identity/Azure.Identity/tests/CredentialTestHelpers.cs +++ b/sdk/identity/Azure.Identity/tests/CredentialTestHelpers.cs @@ -146,7 +146,7 @@ public static async Task GetRefreshTokenAsync(IdentityTestEnvironment te .Build(); var retriever = new RefreshTokenRetriever(client.UserTokenCache); - await client.AcquireTokenByUsernamePassword(new[] { ".default" }, username, password.ToSecureString()).ExecuteAsync(); + await client.AcquireTokenByUsernamePassword(new[] { "https://vault.azure.net/.default" }, username, password.ToSecureString()).ExecuteAsync(); StaticCachesUtilities.ClearStaticMetadataProviderCache(); StaticCachesUtilities.ClearAuthorityEndpointResolutionManagerCache(); diff --git a/sdk/identity/Azure.Identity/tests/VisualStudioCodeCredentialLiveTests.cs b/sdk/identity/Azure.Identity/tests/VisualStudioCodeCredentialLiveTests.cs index a2b4d523e6e6d..d5438153a585a 100644 --- a/sdk/identity/Azure.Identity/tests/VisualStudioCodeCredentialLiveTests.cs +++ b/sdk/identity/Azure.Identity/tests/VisualStudioCodeCredentialLiveTests.cs @@ -2,23 +2,39 @@ // Licensed under the MIT License. using System; +using System.Diagnostics.Tracing; using System.IO; using System.Threading; using System.Threading.Tasks; using Azure.Core; +using Azure.Core.Diagnostics; using Azure.Core.TestFramework; using NUnit.Framework; namespace Azure.Identity.Tests { + [NonParallelizable] public class VisualStudioCodeCredentialLiveTests : IdentityRecordedTestBase { private const string ExpectedServiceName = "VS Code Azure"; + private AzureEventSourceListener _logListener; public VisualStudioCodeCredentialLiveTests(bool isAsync) : base(isAsync) { } + [SetUp] + public void EnableLogging() + { + _logListener = new AzureEventSourceListener((_, message) => TestContext.WriteLine(message), EventLevel.Verbose); + } + + [TearDown] + public void DisableLogging() + { + _logListener.Dispose(); + } + [Test] [RunOnlyOnPlatforms(Windows = true, OSX = true, ContainerNames = new[] { "ubuntu_netcore_keyring" })] public async Task AuthenticateWithVscCredential()