Azure DevOps:用户无权完成此操作.你需要有“AddPackage" [英] Azure DevOps: User lacks permission to complete this action. You need to have 'AddPackage'
本文介绍了Azure DevOps:用户无权完成此操作.你需要有“AddPackage"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我收到一个错误:
User XXX lacks permission to complete this action. You need to have 'AddPackage'
尝试将 nuget 包推送到 Azure DevOps 工件时.我是管理员这是舞台:
when trying to push a nuget package to Azure DevOps artifacts. I am the administrator This is the stage:
- 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 存储库位于 GitHub 中.不确定谁被认为是用户,但我不知道要修改哪些其他权限
The git repo is in GitHub. Not sure who is considered to be the user but I don't know which other permissions to modify
推荐答案
看来我通过将 Build Service as Contributor 添加到提要的权限设置来修复.
It seems I fixed by adding to the feed's permission settings the Build Service as Contributor.
这有点令人困惑 tbh 但它现在工作正常.
It's a bit confusing tbh but it's now working fine.
这篇关于Azure DevOps:用户无权完成此操作.你需要有“AddPackage"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文