NuGetCommand@2 in Azure Devops Pipeline is unable to get Azure Artifacts feed

I am trying to retrieve a custom NuGet package that I have pushed into a Azure DevOps Artifacts (project)feed.

But the NuGetCommand@2 fails with error:

NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json.

My build yaml file has got following steps:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>steps:
- task: NuGetToolInstaller@1
# Required for custom access to Artifacts
- task: PowerShell@2
displayName: "Install Artifacts Provider"
inputs:
targetType: 'inline'
script: |
Write-Host "Install Artifacts Provider"
Invoke-Expression "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx"
- task: NuGetAuthenticate@1
- task: NuGetCommand@2
inputs:
command: 'restore'
FeedsToUse: 'select'
restoreSolution: '$(solution)'
vstsFeed: [FEED_NAME]
</code>
<code>steps: - task: NuGetToolInstaller@1 # Required for custom access to Artifacts - task: PowerShell@2 displayName: "Install Artifacts Provider" inputs: targetType: 'inline' script: | Write-Host "Install Artifacts Provider" Invoke-Expression "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx" - task: NuGetAuthenticate@1 - task: NuGetCommand@2 inputs: command: 'restore' FeedsToUse: 'select' restoreSolution: '$(solution)' vstsFeed: [FEED_NAME] </code>
steps:
- task: NuGetToolInstaller@1
# Required for custom access to Artifacts
- task: PowerShell@2
  displayName: "Install Artifacts Provider"
  inputs:
    targetType: 'inline'
    script: |
      Write-Host "Install Artifacts Provider"
      Invoke-Expression "& { $(irm https://aka.ms/install-artifacts-credprovider.ps1) } -AddNetfx"
- task: NuGetAuthenticate@1
- task: NuGetCommand@2
  inputs:
    command: 'restore'
    FeedsToUse: 'select'
    restoreSolution: '$(solution)'
    vstsFeed: [FEED_NAME]

In my nuget.config file I have the following configuration:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code><?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="[FEED_NAME]" value="https://pkgs.dev.azure.com/[COMPANY_NAME]/[PROJECT_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json" />
</packageSources>
<packageSourceCredentials>
<[FEED_NAME]%>
<add key="Username" value="[USER_NAME]" />
<add key="Password" value="[PAC]" />
</[FEED_NAME]>
</packageSourceCredentials>
</configuration>
</code>
<code><?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <clear /> <add key="[FEED_NAME]" value="https://pkgs.dev.azure.com/[COMPANY_NAME]/[PROJECT_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json" /> </packageSources> <packageSourceCredentials> <[FEED_NAME]%> <add key="Username" value="[USER_NAME]" /> <add key="Password" value="[PAC]" /> </[FEED_NAME]> </packageSourceCredentials> </configuration> </code>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="[FEED_NAME]" value="https://pkgs.dev.azure.com/[COMPANY_NAME]/[PROJECT_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json" />
  </packageSources>
  <packageSourceCredentials>
    <[FEED_NAME]%>
      <add key="Username" value="[USER_NAME]" />
      <add key="Password" value="[PAC]" />
    </[FEED_NAME]>
  </packageSourceCredentials>
</configuration>

Under the artifact permissions settings I have given the project build service the collaborator role.

With this setup I get the following messages in the log:

The NuGetAuthenticate step gives this output and is successfull:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Setting up the credential provider to use the identity '[PROJECT_NAME] Build Service ([COMPANY_NAME])' for feeds in your organization/collection starting with:
https://pkgs.dev.azure.com/[COMPANY_NAME]/
https://[COMPANY_NAME].pkgs.visualstudio.com/
</code>
<code>Setting up the credential provider to use the identity '[PROJECT_NAME] Build Service ([COMPANY_NAME])' for feeds in your organization/collection starting with: https://pkgs.dev.azure.com/[COMPANY_NAME]/ https://[COMPANY_NAME].pkgs.visualstudio.com/ </code>
Setting up the credential provider to use the identity '[PROJECT_NAME] Build Service ([COMPANY_NAME])' for feeds in your organization/collection starting with:
  https://pkgs.dev.azure.com/[COMPANY_NAME]/
  https://[COMPANY_NAME].pkgs.visualstudio.com/

The NuGetCommand step fails with following log:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>Using D:a_tasksNuGetCommand_333b11bd-d341-40d9-afcf-b32d5ce6f23b2.238.1CredentialProviderV2pluginsnetfxCredentialProvider.MicrosoftCredentialProvider.Microsoft.exe as a credential provider plugin.
Feeds used:
C:Program Filesdotnetlibrary-packs
https://api.nuget.org/v3/index.json
https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json
...
[CredentialProvider]Handling 'Request' 'GetAuthenticationCredentials'. Time elapsed in ms: 4 - Payload: {"Uri":"https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json","IsRetry":false,"IsNonInteractive":true,"CanShowDialog":true}
[CredentialProvider]Creating a progress reporter with interval: 00:00:02
[CredentialProvider]Handling auth request, Uri: https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json, IsRetry: False, IsNonInteractive: True, CanShowDialog: True
[CredentialProvider]URI: https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json
[CredentialProvider]VstsBuildTaskServiceEndpointCredentialProvider - This credential provider must be run under the Team Build tasks for NuGet with external endpoint credentials. Appropriate environment variable needs to be set.
...
[CredentialProvider]Skipping NuGetCredentialProvider.CredentialProviders.VstsBuildTaskServiceEndpoint.VstsBuildTaskServiceEndpointCredentialProvider, cannot provide credentials for https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json
...
NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json.
</code>
<code>Using D:a_tasksNuGetCommand_333b11bd-d341-40d9-afcf-b32d5ce6f23b2.238.1CredentialProviderV2pluginsnetfxCredentialProvider.MicrosoftCredentialProvider.Microsoft.exe as a credential provider plugin. Feeds used: C:Program Filesdotnetlibrary-packs https://api.nuget.org/v3/index.json https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json ... [CredentialProvider]Handling 'Request' 'GetAuthenticationCredentials'. Time elapsed in ms: 4 - Payload: {"Uri":"https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json","IsRetry":false,"IsNonInteractive":true,"CanShowDialog":true} [CredentialProvider]Creating a progress reporter with interval: 00:00:02 [CredentialProvider]Handling auth request, Uri: https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json, IsRetry: False, IsNonInteractive: True, CanShowDialog: True [CredentialProvider]URI: https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json [CredentialProvider]VstsBuildTaskServiceEndpointCredentialProvider - This credential provider must be run under the Team Build tasks for NuGet with external endpoint credentials. Appropriate environment variable needs to be set. ... [CredentialProvider]Skipping NuGetCredentialProvider.CredentialProviders.VstsBuildTaskServiceEndpoint.VstsBuildTaskServiceEndpointCredentialProvider, cannot provide credentials for https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json ... NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json. </code>
Using D:a_tasksNuGetCommand_333b11bd-d341-40d9-afcf-b32d5ce6f23b2.238.1CredentialProviderV2pluginsnetfxCredentialProvider.MicrosoftCredentialProvider.Microsoft.exe as a credential provider plugin.

Feeds used:
    C:Program Filesdotnetlibrary-packs
    https://api.nuget.org/v3/index.json
    https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json


...


[CredentialProvider]Handling 'Request' 'GetAuthenticationCredentials'. Time elapsed in ms: 4 - Payload: {"Uri":"https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json","IsRetry":false,"IsNonInteractive":true,"CanShowDialog":true}
[CredentialProvider]Creating a progress reporter with interval: 00:00:02
[CredentialProvider]Handling auth request, Uri: https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json, IsRetry: False, IsNonInteractive: True, CanShowDialog: True
[CredentialProvider]URI: https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json
[CredentialProvider]VstsBuildTaskServiceEndpointCredentialProvider - This credential provider must be run under the Team Build tasks for NuGet with external endpoint credentials. Appropriate environment variable needs to be set.

...

[CredentialProvider]Skipping NuGetCredentialProvider.CredentialProviders.VstsBuildTaskServiceEndpoint.VstsBuildTaskServiceEndpointCredentialProvider, cannot provide credentials for https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json

...

NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json.

The strange part is that all source URL have removed the project name.
Instead of

https://pkgs.dev.azure.com/[COMPANY_NAME]/[PROJECT_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json

he uses the url without the project name:

https://pkgs.dev.azure.com/[COMPANY_NAME]/_packaging/[FEED_NAME]/nuget/v3/index.json

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật