我得到一个错误:
User XXX lacks permission to complete this action. You need to have 'AddPackage'
当尝试将nuget包推送到Azure DevOps工件时。我是管理员 这是阶段:
- stage:
displayName: 'Release'
condition: succeeded()
jobs:
- job: 'Publish'
displayName: 'Publish nuGet Package'
steps:
- download: current
artifact: $(PIPELINE_ARTIFACT_NAME)
displayName: 'Download pipeline artifact'
- script: ls $(PATH_PIPELINE_ARTIFACT_NAME)
displayName: 'Display contents of downloaded articacts path'
- task: NuGetAuthenticate@0
displayName: 'Authenticate in NuGet feed'
- script: dotnet nuget push $(PATH_PIPELINE_ARTIFACT_NAME)/**/*.nupkg --source $(NUGET_FEED) --api-key $(NUGET_API_KEY)
displayName: 'Uploads nuGet packages'
确切的错误:
error: Response status code does not indicate success: 403 (Forbidden - User '4a2eb786-540d-4690-a12b-013aec2c86e5' lacks permission to complete this action. You need to have 'AddPackage'. (DevOps Activity ID: XXXXXXX-6DF9-4A98-8A4E-42C556C6FC56)).
##[error]Bash exited with code '1'.
Finishing: Uploads nuGet packages
git repo在GitHub中。不知道谁被认为是用户,但我不知道要修改哪些其他权限
答案 0 :(得分:12)
答案 1 :(得分:6)
步骤:
答案 2 :(得分:5)
很棒的发现!在...菜单中允许进行项目范围的构建对我来说很有效。
但是,为了能够将包从Azure Pipelines完全推送到Azure Artifacts提要,我必须在dotnet生成并最终推动dotnet之前,在dotnet恢复步骤下添加与Target feed相同的提要。 https://docs.microsoft.com/en-us/azure/devops/artifacts/nuget/dotnet-exe?view=azure-devops
答案 3 :(得分:3)
答案 4 :(得分:0)
正确答案是,在工件设置页面(您可以按照上面的说明访问),您需要向名称模式为 [project_name] Build Service 的用户添加贡献者权限。例如,如果您的项目名称为“IoT”,则需要在如上所示的权限选项卡中的添加用户/组中找到用户“IoT 构建服务”并分配贡献者权限。
答案 5 :(得分:0)
如果仍然出现错误,您也可以尝试将团队添加为贡献者。
希望它有效。
[project_name][project_name] 团队 - 贡献者
project_name 构建服务(Org_name) - 贡献者