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
Since the built-in TfsPublisher logger is deprecated in Visual Studio 2017, I'm trying to use this logger to publish test results to TFS 2015 Update 4 (on-premise) as part of my build instead. 😊
Before I enabled the Allow Scripts to Access OAuth Token option in my build definition, I received the error message AzurePipelines.TestLogger: Not an Azure Pipelines test run, environment variable SYSTEM_ACCESSTOKEN not set.
However, after I enabled the Allow Scripts to Access OAuth Token option in my build definition, I receive the following error:
Error from AzurePipelines logger while sending POST to http://tfs2015:8080/tfs/DefaultCollection/MyTeamProject/_apis/test/runs?api-version=5.0
Body:
{"name":"MyTestAssembly (OS: Microsoft Windows 10.0.14393 , Job: Build, Agent: Agent-WIN-MACHINENAME)","build":{"id":"12345"},"startedDate":"2020-01-15T23:38:48.191Z","isAutomated":true}
Exception:
System.Net.Http.HttpRequestException: Response status code does not indicate success: 401 (Unauthorized).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
at AzurePipelines.TestLogger.ApiClient.<SendAsync>d__3.MoveNext()
Do you have any ideas on how I can troubleshoot and/or resolve this issue?
Is there another security setting that needs to be configured?
The Visual Studio 2017 test agent (VsoAgent) is running in interactive mode.
The build definition is using the new build pipeline definition and isn't a XAML build definition.
Interesting, never envisioned this being used for an on-prem TFS install and don't have one to test on, but happy to support it if we can figure it out.
In Azure Pipelines enabling access to the token isn't quite enough. You also have to pass SYSTEM_ACCESSTOKEN down to the script via the YAML definition:
env:
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
I suspect given that you received a different error after turning on the token that it's being set as an environment variable now. You might be on to something with the basic vs. windows authentication though. Here's where it sets the auth header: https://github.com/daveaglick/AzurePipelines.TestLogger/blob/master/src/AzurePipelines.TestLogger/ApiClient.cs#L21-L22 - I could try adding a flag that uses default/windows credentials instead. Do you think that would help? Might at least give us a little more information...
Hi Dave.
Thank you for
AzurePipelines.TestLogger
v1.0.3.Since the built-in
TfsPublisher
logger is deprecated in Visual Studio 2017, I'm trying to use this logger to publish test results to TFS 2015 Update 4 (on-premise) as part of my build instead. 😊Before I enabled the
Allow Scripts to Access OAuth Token
option in my build definition, I received the error messageAzurePipelines.TestLogger: Not an Azure Pipelines test run, environment variable SYSTEM_ACCESSTOKEN not set.
However, after I enabled the
Allow Scripts to Access OAuth Token
option in my build definition, I receive the following error:Do you have any ideas on how I can troubleshoot and/or resolve this issue?
Is there another security setting that needs to be configured?
Is it possible to test this using the default logged in Windows credentials instead of the
Basic
authentication type?For example, see https://docs.microsoft.com/en-us/dotnet/api/system.net.webclient.usedefaultcredentials.
The Visual Studio 2017 test agent (VsoAgent) is running in interactive mode.
The build definition is using the new build pipeline definition and isn't a XAML build definition.
Command line:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" "c:\agent\_work\1\s\MyProject\bin\Release\MyTestAssembly.dll" /logger:"AzurePipelines" /TestAdapterPath:"c:\agent\_work\1\s\AzurePipelines.TestLogger\v1.0.3\netstandard1.5"
Thank you!
The text was updated successfully, but these errors were encountered: