Publish Nuget package from on premise TFS2017 to azure DevOps

792 Views Asked by At

We are in the process of trying out azure devops in the cloud for all our newest .NET core applications. One thing we need to be able to do is publish nuget packages from our on premise TFS 2017 instance, up to devops so the new apps can consume them. I created a new packages feed up in DevOps, and that gave me a URL to publish to. But when I try pushing up an existing package in a build, using a package publisher step, I get an error :

Response status code does not indicate success: 401 (Unauthorized).

Is this even possible? Anyone done this?

1

There are 1 best solutions below

9
On

If you want to publish NuGet packages from on premise TFS 2017 instance to Azure DevOps service feed, you will need to upgrade it because the below NuGet service connection is not available in it. We test it in TFS 2019 and find this type and then follow below steps.

  1. Create a NuGet feed in Azure DevOps service, and then enable “Allow project-scoped builds” option for this feed permissions by following this doc: Package permissions in Azure Pipelines.
  2. Follow this doc: Use NuGet with Azure DevOps Services feeds, you will get the feed URL as below. enter image description here
  3. Create a PAT with full access in Azure DevOps service, and then create a NuGet service connection in on premise TFS project as below. enter image description here Please note that Feed URL come from Step2, Username is your username in Azure DevOps service and Password is the generated PAT.
  4. Follow this doc: Publish to NuGet feeds (YAML/Classic) to publish NUGet packages from on premise TFS instance to Azure DevOps service feed. The NuGet push task is set like below. enter image description here