2
votes

I have the following setup within a single organisation:

  • Project A

    • Feed A (Project scoped)
  • Project B

    • Feed B (Project scoped) with upstream sources:
      • ProjectA.FeedA
      • nuget.org

For now all packages are added to the Local view, which is the default. And in the Local view permissions, I configured it to 'People in '

When I create a pipeline in ProjectB, that uses the step 'Nuget restore' with feed 'ProjectB.FeedB' I always end with an error while restoring the packages:

Response status code does not indicate success: 502 (Bad Gateway - The upstream source FeedA@Local can't be found because the upstream feed's project with id 'xxxxx-xxxx-xxxx-xxxx-xxxxxxxxx' is deleted or has had its permissions changed. (DevOps Activity ID: XXXXXX-XXXX-XXXX-XXXX-XXXXXX)).)

I figured out that in the past all artifact feeds were 'Organisation scoped'. When creating feeds now, they are 'Project-scoped'. However:

  • I don't see a way to create an organisation scope feed anywhere (besides using the API).
  • I don't know how to convert an existing to an organisation scope feed.
  • If I'm able to configure the view in my Project-Scoped feed to be accessible to the entire organisation I guess this should work?

Any pointers on how to solve this would be very welcome!

3

3 Answers

7
votes

I finally figured it out.

Go to

Project settings > Pipeline > Settings

There you can see the option:

Limit job authorization scope to current project

This option is also available in the settings of the organisation!

Azure devops project settings screenshot

1
votes

From the documentation on the topic, it looks like the only way is to use the API, as you said (emphasis mine).

https://docs.microsoft.com/en-us/azure/devops/artifacts/feeds/project-scoped-feeds?view=azure-devops

If you're concerned that your project will be turned public in the future and you want your feed remain private, you can use the organization-scoped feed that's automatically created when a new organization is created. Alternatively, you can use the Create Feed API to manually create a new organization-scoped feed. You will have to set the default permissions for the new feed manually either by using the Feed Permission API or the Artifacts feed settings. Creating new organization-scoped feeds is not recommended.

So you have two options:

  • Use the/an existing organisation feed, or
  • Manually create an organisation feed through the API (not recommended).

However, can you use a special task to authenticate with the project-scoped Azure Artifacts feed before doing your restore? We are currently using a project-scoped feed from one project in another project (within the same organisation) by using the NuGet Authenticate task:

steps:
- task: UseDotNet@2
  inputs:
    packageType: 'sdk'
    version: 3.1.101
- task: NuGetAuthenticate@0
- task: DotNetCoreCLI@2
  displayName: 'dotnet restore with nuget.config'
  inputs:
    command: 'restore'
    projects: '**/*.csproj'
    feedsToUse: 'config'
    nugetConfigPath: 'nuget.config'
0
votes

I don't see a way to create an organisation scope feed anywhere (besides using the API).

For this issue ,I am afraid it is not support to create a new organization-scoped feeds through the UI. Currently, only rest API is supported to create feeds for organization scope.

Until now, in our official feature suggestion for Azure Devops forum, there has been a such suggestion exist in it: Organisation scoped feeds. You can comment and vote it there.

If I'm able to configure the view in my Project-Scoped feed to be accessible to the entire organisation I guess this should work?

For this issue , you can try to add other Project's Build Service groups to the feed permissions in the Permissions of Feed settings.

enter image description here

enter image description here