首页 > 解决方案 > Azure DevOps - 无法加载源的服务索引

问题描述

我正在运行 Azure DevOps 管道,并收到以下错误。

error: Unable to load the service index for source https://pkgs.dev.azure.com/companyName/_packaging/12345678-1234-1234-1234-1234567890ab/nuget/v3/index.json.
error:   Response status code does not indicate success: 403 (Forbidden - User '12345678-1234-1234-1234-1234567890ab' lacks permission to complete this action. You need to have 'ReadPackages'. (DevOps Activity ID: 12345678-1234-1234-1234-1234567890ab)).

我从一个 yaml 看起来像这样的任务中得到错误。

steps:
- task: DotNetCoreCLI@2
  displayName: 'Push the created package to Nuget feed. '
  inputs:
    command: push
    publishVstsFeed: '12345678-1234-1234-1234-1234567890ab'
    versioningScheme: byPrereleaseNumber

有什么想法要做什么吗?

标签: azure-devopsazure-devops-artifacts

解决方案


Azure DevOps - 无法加载源的服务索引

好像您还没有验证您的私人订阅源,请尝试添加任务NuGetAuthenticate

- task: NuGetAuthenticate@0
  displayName: 'NuGet Authenticate'
  inputs:
    nuGetServiceConnections: TestNuGet

并为私人提要创建服务连接:

在此处输入图像描述


推荐阅读