【发布时间】:2019-02-20 21:27:32
【问题描述】:
我有一个 Azure DevOps 项目(只有一个)。
我有一个构建管道设置为在“托管 VS2017”代理池中运行。此代理池似乎具有 [MyProject]\Build Administrators、Contributors、Project Administrators 和 Release Administrators 角色。
我在 DevOps 项目中还有一个 Artifacts nuget 提要。它具有 [MyProject]\Project Valid Users 设置为“读者”角色。项目有效用户似乎具有上述代理池的所有成员角色。
我有一个 azure-pipelines.yml 脚本,它在开头添加了工件提要作为 nuget 源:
# Add nuget source
- powershell: Invoke-RestMethod "https://dist.nuget.org/win-x86-commandline/latest/nuget.exe" -OutFile "$env:UserProfile/nuget.exe"
- script: '%UserProfile%\nuget.exe sources Add -Name "devops" -Source "https://pkgs.dev.azure.com/MyProject/_packaging/feed/nuget/v3/index.json"'
构建 yml 然后点一个 dotnet build 但在 NuGet.targets 内部失败:
Unable to load the service index for source https://pkgs.dev.azure.com/MyProject/_packaging/feed/nuget/v3/index.json.
Response status code does not indicate success: 401 (Unauthorized).
我怎样才能做到这一点?我的构建需要来自该工件提要上的其他构建的包...
【问题讨论】:
标签: azure-devops azure-pipelines azure-pipelines-build-task azure-artifacts