[英]TFS 2018 Unauthorized when downloading current build artifact
I'm trying to work with TFS 2018 Artifacts .我正在尝试使用TFS 2018 Artifacts 。
I created a very simple build (definition)- it has one agent phase that uploading artifact , and then another agent that should download the artifact .我创建了一个非常简单的构建(定义)——它有一个代理阶段上传 artifact ,然后另一个代理应该下载 artifact 。
The Download Build Artifact failed with Unauthorized :下载构建工件因未授权而失败:
Downloading artifacts from: {...}/tfs/DefaultCollection//_apis/resources/Containers/262302?itemPath=Artifact&isShallow=true&api-version=4.1-preview.4
Failed to parse response body: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>401 - Unauthorized: Access is denied due to invalid credentials.</title>
.
.
.
(Also this message appears five times) (此消息也出现了五次)
Both phases marked with this:两个阶段都标有:
TFS 2018 Unauthorized when downloading current build artifact
下载当前构建工件时 TFS 2018 未经授权
According to the error message:根据错误信息:
This is an authentication issue, you could check if those two Agent phases use the same build agent.这是一个身份验证问题,您可以检查这两个代理阶段是否使用相同的构建代理。 And try to enable the option
Allow scripts to access OAuth token
in the Agent phase
page:并尝试在
Agent phase
页面中启用Allow scripts to access OAuth token
选项:
If you are using different build agent, you should make sure your account has permission to access that agent:如果您使用不同的构建代理,则应确保您的帐户有权访问该代理:
Agent Pools
-> Agents
-> Roles
Agent Pools
-> Agents
-> Roles
Add your account as user
or admin
.将您的帐户添加为
user
或admin
。
If above not resolve this issue, I would like provide you a workaround to resolve it:如果以上不能解决这个问题,我想为您提供一个解决方法来解决它:
Create a share folder on your TFS server, then make sure your account could access that share folder, now we could publish our artifact to that share folder instead of Visual Studio Team Services/TFS
:在您的 TFS 服务器上创建一个共享文件夹,然后确保您的帐户可以访问该共享文件夹,现在我们可以将我们的工件发布到该共享文件夹而不是
Visual Studio Team Services/TFS
:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.