web-dev-qa-db-ja.com

Azure DevOpsはNugetをホストされたフィードに公開します

ホストされている(無料の)AzureDevopsパイプラインを使用して質問があります。次の作業が行われるAzure Devopsパイプラインを作成する小さな.NET Coreプロジェクトがあります。

  • 戻す
  • 建てる
  • パック
  • プッシュ(AzureDevOpsがホストするアーティファクトフィードへ)

Azure Devopsのプロジェクトに次のフィード設定があります

enter image description here

フィードのこの接続情報を持つもの

..../NugetProjects/_packaging/nugetprojectstestfeed/nuget/v3/index.json

また、次のセキュリティが適用されています(プロジェクトコレクションビルドサービスが「寄稿者」として設定されていることに注意してください)。

enter image description here

これは、Microsoftの公式ドキュメントのこの段落で述べたとおりです。

Azure Artifactsフィードに公開するには、プロジェクトコレクションビルドサービスIDをフィードの投稿者に設定します。

次に、このビルドパイプラインセットアップ(Yaml)があります。

# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.Microsoft.com/Azure/devops/pipelines/languages/dotnet-core

trigger:
- master

pool:
  vmImage: 'ubuntu-latest'

variables:
  buildConfiguration: 'Release'
  Major: '1'
  Minor: '0'
  Patch: '0'

steps:

- task: DotNetCoreCLI@2
  displayName: 'Restore'
  inputs:
    command: restore
    projects: '**/MathsLib.csproj'


- task: DotNetCoreCLI@2
  displayName: Build
  inputs:
    command: build
    projects: '**/MathsLib.csproj'
    arguments: '--configuration Release' # Update this to match your need


- task: DotNetCoreCLI@2
  inputs: 
    command: 'pack'
    projects: '**/MathsLib.csproj'
    outputDir: '$(Build.ArtifactStagingDirectory)'
    versioningScheme: 'byPrereleaseNumber'
    majorVersion: '1'
    minorVersion: '0'
    patchVersion: '0'


- task: NuGetAuthenticate@0
  displayName: 'NuGet Authenticate'
- task: NuGetCommand@2
  displayName: 'NuGet Push'
  inputs:
    command: Push
    publishVstsFeed: 'nugetprojectstestfeed'
    allowPackageConflicts: true

パイプライン全体は、Nuget Pushまで正常に動作します。ここに示すように

enter image description here

でも例外を見るとこんな感じ

##[warning]Could not create provenance session: {"statusCode":500,"result":{"$id":"1","innerException":null,"message":"The feed with ID 'nugetprojectstestfeed' doesn't exist.","typeName":"Microsoft.VisualStudio.Services.Feed.WebApi.FeedIdNotFoundException, Microsoft.VisualStudio.Services.Feed.WebApi","typeKey":"FeedIdNotFoundException","errorCode":0,"eventId":3000}}
[command]/usr/bin/mono /opt/hostedtoolcache/NuGet/4.1.0/x64/nuget.exe Push /home/vsts/work/1/a/MathsLib.1.0.0-CI-20191114-115941.nupkg -NonInteractive -Source https://pkgs.dev.Azure.com/XXXXX/_packaging/nugetprojectstestfeed/nuget/v3/index.json -ApiKey VSTS -Verbosity Detailed
System.AggregateException: One or more errors occurred. (Unable to load the service index for source https://pkgs.dev.Azure.com/XXXXX/_packaging/nugetprojectstestfeed/nuget/v3/index.json.) ---> NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source https://pkgs.dev.Azure.com/XXXXX/_packaging/nugetprojectstestfeed/nuget/v3/index.json. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found - The feed with ID 'nugetprojectstestfeed' doesn't exist. (DevOps Activity ID: F123AC3A-8E75-4D3A-B3B6-60EC4510FF54)).

これは私の最初のフィード接続でした

https://pkgs.dev.Azure.com/XXXX/NugetProjects/_packaging/nugetprojectstestfeed/nuget/v3/index.json

しかし、これはエラーメッセージに表示されているものです

https://pkgs.dev.Azure.com/XXXXX/_packaging/nugetprojectstestfeed/nuget/v3/index.json

したがって、Azure DevOpsで設定した "NuGetProjects"プロジェクトではなく、ルートプロジェクトのフィードにアクセスしようとしているようです。 「NuGetProjects」プロジェクト内のフィードをターゲットにするように伝えるために欠けている設定/構成はありますか

私が言うように、ビルドパイプラインが設定されている特定のプロジェクト内ではないトップレベルのフィードを探しているように見えます

新しいフィードを使用するステップバイステップ

したがって、ここで完全を期すために、プロジェクトを作成した方法と、それが物事の組織のどこにあるかを完全に説明します(試してみるように提案された新しいフィードを作成しました)。

これらのプロジェクトを含むこの組織「sachabarber2019」を持っています

enter image description here

次に、このフィードを組織のプロジェクトの1つで作成しました

enter image description here

これらの設定で enter image description here

enter image description here

これが現在のビルドパイプラインです

# ASP.NET Core
# Build and test ASP.NET Core projects targeting .NET Core.
# Add steps that run tests, create a NuGet package, deploy, and more:
# https://docs.Microsoft.com/Azure/devops/pipelines/languages/dotnet-core

trigger:
- master

pool:
  vmImage: 'ubuntu-latest'

variables:
  buildConfiguration: 'Release'
  Major: '1'
  Minor: '0'
  Patch: '0'

steps:

- task: DotNetCoreCLI@2
  displayName: 'Restore'
  inputs:
    command: restore
    projects: '**/MathsLib.csproj'


- task: DotNetCoreCLI@2
  displayName: Build
  inputs:
    command: build
    projects: '**/MathsLib.csproj'
    arguments: '--configuration Release' # Update this to match your need


- task: DotNetCoreCLI@2
  inputs: 
    command: 'pack'
    projects: '**/MathsLib.csproj'
    outputDir: '$(Build.ArtifactStagingDirectory)'
    versioningScheme: 'byPrereleaseNumber'
    majorVersion: '1'
    minorVersion: '0'
    patchVersion: '0'


- task: NuGetCommand@2
  displayName: 'NuGet Push'
  inputs:
    command: Push
    feedsToUse: select
    packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
    vstsFeed: anotherfeed
    nuGetFeedType: internal
    publishVstsFeed: anotherfeed
    allowPackageConflicts: true


そして前と同じように私は同じエラーを受け取ります

##[section]Starting: NuGet Push
==============================================================================
Task         : NuGet
Description  : Restore, pack, or Push NuGet packages, or run a NuGet command. Supports NuGet.org and authenticated feeds like Azure Artifacts and MyGet. Uses NuGet.exe and works with .NET Framework apps. For .NET Core and .NET Standard apps, use the .NET Core task.
Version      : 2.161.0
Author       : Microsoft Corporation
Help         : https://docs.Microsoft.com/Azure/devops/pipelines/tasks/package/nuget
==============================================================================
Caching tool: NuGet 4.1.0 x64
Found tool in cache: NuGet 4.1.0 x64
Resolved from tool cache: 4.1.0
Using version: 4.1.0
Found tool in cache: NuGet 4.1.0 x64
SYSTEMVSSCONNECTION exists true
SYSTEMVSSCONNECTION exists true
SYSTEMVSSCONNECTION exists true
Detected NuGet version 4.1.0.2450 / 4.1.0
##[warning]Could not create provenance session: {"statusCode":500,"result":{"$id":"1","innerException":null,"message":"The feed with ID 'anotherfeed' doesn't exist.","typeName":"Microsoft.VisualStudio.Services.Feed.WebApi.FeedIdNotFoundException, Microsoft.VisualStudio.Services.Feed.WebApi","typeKey":"FeedIdNotFoundException","errorCode":0,"eventId":3000}}
[command]/usr/bin/mono /opt/hostedtoolcache/NuGet/4.1.0/x64/nuget.exe Push /home/vsts/work/1/a/MathsLib.1.0.0-CI-20191120-121118.nupkg -NonInteractive -Source https://pkgs.dev.Azure.com/sachabarber2019/_packaging/anotherfeed/nuget/v3/index.json -ApiKey VSTS -Verbosity Detailed
NuGet Version: 4.1.0.2450
mono-sgen: /home/vsts/work/_tasks/NuGetCommand_333b11bd-d341-40d9-afcf-b32d5ce6f23b/2.161.0/CredentialProvider/CredentialProvider.TeamBuild.exe -uri https://pkgs.dev.Azure.com/sachabarber2019/_packaging/anotherfeed/nuget/v3/index.json -nonInteractive -verbosity detailed
mono-sgen: URI Prefixes:
mono-sgen:     https://dev.Azure.com/sachabarber2019/
mono-sgen:     https://pkgs.dev.Azure.com/sachabarber2019/
mono-sgen:     https://pkgsproduks1.pkgs.visualstudio.com/
mono-sgen:     https://pkgs.dev.Azure.com/sachabarber2019/
mono-sgen:     https://sachabarber2019.pkgs.visualstudio.com/
mono-sgen:     https://pkgs.dev.Azure.com/sachabarber2019/
mono-sgen: URI: https://pkgs.dev.Azure.com/sachabarber2019/_packaging/anotherfeed/nuget/v3/index.json
mono-sgen: Is retry: False
mono-sgen: Matched prefix: https://pkgs.dev.Azure.com/sachabarber2019/
System.AggregateException: One or more errors occurred. (Unable to load the service index for source https://pkgs.dev.Azure.com/sachabarber2019/_packaging/anotherfeed/nuget/v3/index.json.) ---> NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source https://pkgs.dev.Azure.com/sachabarber2019/_packaging/anotherfeed/nuget/v3/index.json. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found - The feed with ID 'anotherfeed' doesn't exist. (DevOps Activity ID: 9E8C7E28-9D51-44A1-9286-8F6F839BCBD6)).
  at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode () [0x00040] in <7ecf813f2d314058b05c6c092c47b77a>:0 
  at NuGet.Protocol.HttpSource+<>c__DisplayClass12_0`1[T].<GetAsync>b__0 (System.Threading.CancellationToken lockedToken) [0x004a8] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T] (System.String filePath, System.Func`2[T,TResult] action, System.Threading.CancellationToken token) [0x0024a] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.HttpSource.GetAsync[T] (NuGet.Protocol.HttpSourceCachedRequest request, System.Func`2[T,TResult] processAsync, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x000ed] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3 (NuGet.Protocol.Core.Types.SourceRepository source, System.DateTime utcNow, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x00207] in <d0f788a4af354971807e5d8ca6fc682e>:0 
   --- End of inner exception stack trace ---
  at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3 (NuGet.Protocol.Core.Types.SourceRepository source, System.DateTime utcNow, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x002d5] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.ServiceIndexResourceV3Provider.TryCreate (NuGet.Protocol.Core.Types.SourceRepository source, System.Threading.CancellationToken token) [0x00233] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T] (System.Threading.CancellationToken token) [0x000b8] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.PackageUpdateResourceV3Provider.TryCreate (NuGet.Protocol.Core.Types.SourceRepository source, System.Threading.CancellationToken token) [0x0007d] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T] (System.Threading.CancellationToken token) [0x000b8] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T] () [0x0006e] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Commands.CommandRunnerUtility.GetPackageUpdateResource (NuGet.Configuration.IPackageSourceProvider sourceProvider, System.String source) [0x000f1] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Commands.PushRunner.Run (NuGet.Configuration.ISettings settings, NuGet.Configuration.IPackageSourceProvider sourceProvider, System.String packagePath, System.String source, System.String apiKey, System.String symbolSource, System.String symbolApiKey, System.Int32 timeoutSeconds, System.Boolean disableBuffering, System.Boolean noSymbols, NuGet.Common.ILogger logger) [0x00133] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.PushCommand.ExecuteCommandAsync () [0x001b0] in <d0f788a4af354971807e5d8ca6fc682e>:0 
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <285579f54af44a2ca048dad6be20e190>:0 
  at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <285579f54af44a2ca048dad6be20e190>:0 
  at System.Threading.Tasks.Task.Wait () [0x00000] in <285579f54af44a2ca048dad6be20e190>:0 
  at NuGet.CommandLine.Command.Execute () [0x000bd] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, System.String[] args) [0x001f3] in <d0f788a4af354971807e5d8ca6fc682e>:0 
---> (Inner Exception #0) NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source https://pkgs.dev.Azure.com/sachabarber2019/_packaging/anotherfeed/nuget/v3/index.json. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found - The feed with ID 'anotherfeed' doesn't exist. (DevOps Activity ID: 9E8C7E28-9D51-44A1-9286-8F6F839BCBD6)).
  at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode () [0x00040] in <7ecf813f2d314058b05c6c092c47b77a>:0 
  at NuGet.Protocol.HttpSource+<>c__DisplayClass12_0`1[T].<GetAsync>b__0 (System.Threading.CancellationToken lockedToken) [0x004a8] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T] (System.String filePath, System.Func`2[T,TResult] action, System.Threading.CancellationToken token) [0x0024a] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.HttpSource.GetAsync[T] (NuGet.Protocol.HttpSourceCachedRequest request, System.Func`2[T,TResult] processAsync, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x000ed] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3 (NuGet.Protocol.Core.Types.SourceRepository source, System.DateTime utcNow, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x00207] in <d0f788a4af354971807e5d8ca6fc682e>:0 
   --- End of inner exception stack trace ---
  at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3 (NuGet.Protocol.Core.Types.SourceRepository source, System.DateTime utcNow, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x002d5] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.ServiceIndexResourceV3Provider.TryCreate (NuGet.Protocol.Core.Types.SourceRepository source, System.Threading.CancellationToken token) [0x00233] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T] (System.Threading.CancellationToken token) [0x000b8] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.PackageUpdateResourceV3Provider.TryCreate (NuGet.Protocol.Core.Types.SourceRepository source, System.Threading.CancellationToken token) [0x0007d] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T] (System.Threading.CancellationToken token) [0x000b8] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T] () [0x0006e] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Commands.CommandRunnerUtility.GetPackageUpdateResource (NuGet.Configuration.IPackageSourceProvider sourceProvider, System.String source) [0x000f1] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Commands.PushRunner.Run (NuGet.Configuration.ISettings settings, NuGet.Configuration.IPackageSourceProvider sourceProvider, System.String packagePath, System.String source, System.String apiKey, System.String symbolSource, System.String symbolApiKey, System.Int32 timeoutSeconds, System.Boolean disableBuffering, System.Boolean noSymbols, NuGet.Common.ILogger logger) [0x00133] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.PushCommand.ExecuteCommandAsync () [0x001b0] in <d0f788a4af354971807e5d8ca6fc682e>:0 <---

##[error]The nuget command failed with exit code(1) and error(System.AggregateException: One or more errors occurred. (Unable to load the service index for source https://pkgs.dev.Azure.com/sachabarber2019/_packaging/anotherfeed/nuget/v3/index.json.) ---> NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source https://pkgs.dev.Azure.com/sachabarber2019/_packaging/anotherfeed/nuget/v3/index.json. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found - The feed with ID 'anotherfeed' doesn't exist. (DevOps Activity ID: 9E8C7E28-9D51-44A1-9286-8F6F839BCBD6)).
  at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode () [0x00040] in <7ecf813f2d314058b05c6c092c47b77a>:0 
  at NuGet.Protocol.HttpSource+<>c__DisplayClass12_0`1[T].<GetAsync>b__0 (System.Threading.CancellationToken lockedToken) [0x004a8] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T] (System.String filePath, System.Func`2[T,TResult] action, System.Threading.CancellationToken token) [0x0024a] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.HttpSource.GetAsync[T] (NuGet.Protocol.HttpSourceCachedRequest request, System.Func`2[T,TResult] processAsync, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x000ed] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3 (NuGet.Protocol.Core.Types.SourceRepository source, System.DateTime utcNow, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x00207] in <d0f788a4af354971807e5d8ca6fc682e>:0 
   --- End of inner exception stack trace ---
  at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3 (NuGet.Protocol.Core.Types.SourceRepository source, System.DateTime utcNow, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x002d5] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.ServiceIndexResourceV3Provider.TryCreate (NuGet.Protocol.Core.Types.SourceRepository source, System.Threading.CancellationToken token) [0x00233] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T] (System.Threading.CancellationToken token) [0x000b8] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.PackageUpdateResourceV3Provider.TryCreate (NuGet.Protocol.Core.Types.SourceRepository source, System.Threading.CancellationToken token) [0x0007d] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T] (System.Threading.CancellationToken token) [0x000b8] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T] () [0x0006e] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Commands.CommandRunnerUtility.GetPackageUpdateResource (NuGet.Configuration.IPackageSourceProvider sourceProvider, System.String source) [0x000f1] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Commands.PushRunner.Run (NuGet.Configuration.ISettings settings, NuGet.Configuration.IPackageSourceProvider sourceProvider, System.String packagePath, System.String source, System.String apiKey, System.String symbolSource, System.String symbolApiKey, System.Int32 timeoutSeconds, System.Boolean disableBuffering, System.Boolean noSymbols, NuGet.Common.ILogger logger) [0x00133] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.PushCommand.ExecuteCommandAsync () [0x001b0] in <d0f788a4af354971807e5d8ca6fc682e>:0 
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <285579f54af44a2ca048dad6be20e190>:0 
  at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <285579f54af44a2ca048dad6be20e190>:0 
  at System.Threading.Tasks.Task.Wait () [0x00000] in <285579f54af44a2ca048dad6be20e190>:0 
  at NuGet.CommandLine.Command.Execute () [0x000bd] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.Program.MainCore (System.String workingDirectory, System.String[] args) [0x001f3] in <d0f788a4af354971807e5d8ca6fc682e>:0 
---> (Inner Exception #0) NuGet.Protocol.Core.Types.FatalProtocolException: Unable to load the service index for source https://pkgs.dev.Azure.com/sachabarber2019/_packaging/anotherfeed/nuget/v3/index.json. ---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 404 (Not Found - The feed with ID 'anotherfeed' doesn't exist. (DevOps Activity ID: 9E8C7E28-9D51-44A1-9286-8F6F839BCBD6)).
  at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode () [0x00040] in <7ecf813f2d314058b05c6c092c47b77a>:0 
  at NuGet.Protocol.HttpSource+<>c__DisplayClass12_0`1[T].<GetAsync>b__0 (System.Threading.CancellationToken lockedToken) [0x004a8] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Common.ConcurrencyUtilities.ExecuteWithFileLockedAsync[T] (System.String filePath, System.Func`2[T,TResult] action, System.Threading.CancellationToken token) [0x0024a] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.HttpSource.GetAsync[T] (NuGet.Protocol.HttpSourceCachedRequest request, System.Func`2[T,TResult] processAsync, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x000ed] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3 (NuGet.Protocol.Core.Types.SourceRepository source, System.DateTime utcNow, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x00207] in <d0f788a4af354971807e5d8ca6fc682e>:0 
   --- End of inner exception stack trace ---
  at NuGet.Protocol.ServiceIndexResourceV3Provider.GetServiceIndexResourceV3 (NuGet.Protocol.Core.Types.SourceRepository source, System.DateTime utcNow, NuGet.Common.ILogger log, System.Threading.CancellationToken token) [0x002d5] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.ServiceIndexResourceV3Provider.TryCreate (NuGet.Protocol.Core.Types.SourceRepository source, System.Threading.CancellationToken token) [0x00233] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T] (System.Threading.CancellationToken token) [0x000b8] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.PackageUpdateResourceV3Provider.TryCreate (NuGet.Protocol.Core.Types.SourceRepository source, System.Threading.CancellationToken token) [0x0007d] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T] (System.Threading.CancellationToken token) [0x000b8] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Protocol.Core.Types.SourceRepository.GetResourceAsync[T] () [0x0006e] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Commands.CommandRunnerUtility.GetPackageUpdateResource (NuGet.Configuration.IPackageSourceProvider sourceProvider, System.String source) [0x000f1] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.Commands.PushRunner.Run (NuGet.Configuration.ISettings settings, NuGet.Configuration.IPackageSourceProvider sourceProvider, System.String packagePath, System.String source, System.String apiKey, System.String symbolSource, System.String symbolApiKey, System.Int32 timeoutSeconds, System.Boolean disableBuffering, System.Boolean noSymbols, NuGet.Common.ILogger logger) [0x00133] in <d0f788a4af354971807e5d8ca6fc682e>:0 
  at NuGet.CommandLine.PushCommand.ExecuteCommandAsync () [0x001b0] in <d0f788a4af354971807e5d8ca6fc682e>:0 <---)
##[error]Packages failed to publish
##[section]Finishing: NuGet Push
5
sacha barber

@mwimwiからの回答のとおり、フィードパスにプロジェクト名を含めるとうまくいきました。

- task: DotNetCoreCLI@2
  displayName: Push
  inputs:
    command: Push
    packagesToPush: ...
    feedPublish: <project-name>/<feed-name>
1
Jevon Kendon

数日前に新しいAzure Artifactsフィードを作成し、 this example のような.NET Core/Standard NuGetビルドパイプラインを作成しようとしているときに、これに真っ向からぶつかりました。 CIパイプラインの残りの部分は完全に実行されましたが、回避策を見つけようとしたすべての試みにもかかわらず、Azure Pipelinesログでまったく同じエラーが発生し、NuGet Pushタスクが毎回失敗しました。

ID「{my_feed_name}」のフィードは存在しません。

フィードは確かに存在していたため、もう少し掘り下げて、Azure Pipelinesのバグに関する他の同様のレポートを発見しました。どうやら、Microsoftは最近、新しいフィードのデフォルトのスコープレベルを組織ではなくProjectに変更しました。これにより、いくつかのAzure Pipelineタスクが壊れました。古いフィードは、この問題の影響を受けていないようです。 このフォーラムの投稿を参照してください

新しいフィードはデフォルトでプロジェクトスコープになり、パイプラインタスクに必要な修正のデプロイに失敗しました。最新のパイプラインタスクバージョンに更新する修正プログラムをリリースしており、1日の終わりまでにリリースされるはずです。

うまくいけば、マイクロソフトはこの問題をすぐに解決するでしょう。

1
Kerwin

以下のような2つの変更を行いました。

  1. FeedSetting権限で、「プロジェクトスコープのビルドを許可する」を選択しました

  2. 以下のようにNuGetCommand用に更新されたYMLファイル、

    task: NuGetCommand@2
      displayName: 'Publish NuGet package'
      inputs:
        command: Push
        feedsToUse: 'select'
        packagesToPush: '$(Build.ArtifactStagingDirectory)/**/*.nupkg;!$(Build.ArtifactStagingDirectory)/**/*.symbols.nupkg'
        nuGetFeedType: 'internal'
        publishVstsFeed: 'Space Game - web - Dependencies/Tailspin.SpaceGame.Web.Models'
        allowPackageConflicts: true

そして問題は今解決されました...

君たちありがとう...

〜KC

0
Kany

NuGetCommand @ 2タスクで必要な引数をいくつか設定していません。

これを試して:

- task: NuGetCommand@2
  displayName: 'NuGet Push'
  inputs:
    command: Push
    feedsToUse: select
    vstsFeed: nugetprojectstestfeed
    nuGetFeedType: internal
    publishVstsFeed: nugetprojectstestfeed
    allowPackageConflicts: true

NuGetタスクの documentation を調べると、「Push」コマンドには特定の引数が必要です。

0
Sudarshan_SMD