如何使用 YAML 从 Artifactory 恢复包

How to restore packages from Artifactory using YAML

指南 here 给出了以下示例代码:

- task: DotNetCoreCLI@2
  inputs:
    command: restore
    projects: '**/*.csproj'
    feedsToUse: config
    nugetConfigPath: NuGet.config    # Relative to root of the repository
    externalFeedCredentials: <Name of the NuGet service connection>

但我很难知道需要什么来代替 <Name of the NuGet service connection> 甚至 NuGet.config

Artifactory 上的指南没有使用 YAML,甚至没有提到它,所以我不知道它是否可行。

我的问题:以上是否可能,如果可能,我应该在上面的脚本中包含什么?

<Name of the NuGet service connection> 正是它所说的。在您的项目中创建一个指向 NuGet 提要的 service connection,然后在那里按名称引用它。