HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Project pipeline not able to access NuGet package from Artifact Feed in different Project

Submitted by: @import:stackexchange-devops··
0
Viewed 0 times
nugetpackageartifactpipelinefeeddifferentprojectfromnotaccess

Problem

Updated 20th Feb & 21st Feb

Summary

Not able to find NuGet package from our private feed under Artifacts.

Our Azure DevOps environment

In Azure, we have our company "space": dev.azure.com/OurCompany

Under that, we have multiple Projects, so for example, imagine these three:

  • Green: this holds applications of a certain type



  • Blue: this holds applications of a different type



  • Red: this holds our "common" helper code



RED

RED holds all our common helper code are DLLs consumed by applications in GREEN and BLUE. These are made available as NuGet packages.

Under RED's Artifacts, we see an "organisational scoped feed" called "OurCompany". We understood that we couldn't use this because these NuGet packages need to be available to everyone in OurCompany, which means not only on Azure, but also on our DeskTop machines in our Corporate network (where we run Visual Studio). The "organisational scoped feed" I don't think is exposed to our Corporate Network.

We therefore created a new Feed under RED's Artifacts. When I view Permissions, I see the following entries:

  • {me} : (Owner)



  • [OurCompany]\Project Collection Adminstrators : (Owner)



  • [RED]\Project Administrators : (Owner)



  • Project Collection Build Service (OurCompany) : (Contributor)



  • [RED]\Contributors (Contributor)



  • RED Build Service (OurCompany) : (Contributor)



  • BLUE Build Service (OurCompany) : (Contributor)



Corporate

So, back in Corporate, we add the NuGet package feed to our Visual Studio and it can then pull the NuGet packages down from Azure.

GREEN and BLUE

In here we have our products. We create a build Pipeline and we add a NuGet restore step:

- task: NuGetCommand@2
  displayName: 'Restore for Our Application'
  inputs:
    command: 'restore'
    restoreSolution: '**/*.sln'
    feedsToUse: 'select'
    vstsFeed: '{Guid1}/{Guid2}'


The two Guids were filled in when we picket the Azure Artifacts feed from the drop-down.

GREEN or BLUE NuGet Restore Failure

So this is whe

Solution

Very few people were viewing this thread, so afterwards I posted a duplicate question on Stack Overflow, and now contains the answer. Below is a copy of it ...

Finally, I found the problem. I wonder if this is a bug, or just poorly documented....(or maybe I just didn't interpret it correctly).

As per Leo Lui-MSFT's suggestion above (documented by Microsoft), I'd added the permissions to the NuGet feed, and this didn't work. However, I was intrigued by his sentence:


If you've changed your builds to run at project scope

Personally, I hadn't, so I got with our System Administrator and we went through all the possible settings. Eventually, we found it - it wasn't something I had the ability to change.

So in my example above, BLUE and GREEN are the two projects that are trying to use the NuGet package in RED's Artifact feed.

So picking BLUE (or GREEN), in the bottom left hand corner of Azure DevOps you'll see a link "Project Settings". Under "Pipelines > Settings" there are four settings. We had to change the following to be:


Limit job authorization scope to current project = false

If the option is greyed out in the project, that's probably because it's enforced at organization level. In that case, you have to first change it in the organization, and then change it in the project as well.

Hope that helps!

Context

StackExchange DevOps Q#10843, answer score: 6

Revisions (0)

No revisions yet.