Code Monkey home page Code Monkey logo

Comments (5)

satbai avatar satbai commented on July 24, 2024 1

The way the basic mode works is that you have to authenticate interactively the first time and after that the creds will be fetched from cache. Unless you're on Windows and you're already signed in, then Windows Integrated Authentication will be used and you may get authenticated non-interactively the first time.

If interactive mode is not possible in your case, you can try using this cred provider the way the Azure Pipelines NuGet task uses it. To do that you manually set a PAT for each Azure Artifacts feed endpoint and use the environment variable VSS_NUGET_EXTERNAL_FEED_ENDPOINTS with json that contains an array of service endpoints, usernames and access tokens to authenticate endpoints in nuget.config.

Example: VSS_NUGET_EXTERNAL_FEED_ENDPOINTS = '{"endpointCredentials": [{"endpoint":"http://example.index.json", "username":"optional", "password":"PAT"}, {"endpoint":"http://example-2.index.json", "username":"optional-2", "password":"PAT-2"}]}'

If this environment variable is correctly set with feed endpoints and PATs, and the cred provider is correctly installed to the location nuget/dotnet will be able to find it, the authentication should work.

from artifacts-credprovider.

Lutando avatar Lutando commented on July 24, 2024 1

This worked 100% thanks for the help.

from artifacts-credprovider.

satbai avatar satbai commented on July 24, 2024

This cred provider will help with authenticating to Azure DevOps Artifacts feeds no matter if you're restoring from a feed or pushing to a feed. You need NuGet version 4.8+ or dotnet SDK version 2.1.400+.

Are you using the Azure DevOps Pipelines or pushing packages on your dev machine? If using pipelines, the NuGet push task (NuGetCommandV2) will use this cred provider automatically if the NuGet version is 4.8 or greater. If on your dev machine, you can use one of these scripts to install the cred provider to a location on your machine where NuGet and dotnet will be able to find it. More in the readme.

from artifacts-credprovider.

Lutando avatar Lutando commented on July 24, 2024

Thank you. Its a combination of dev machines and other build on other platforms. So it needs to be self contained, non-interactive, and cross plat (this is why the task wont suffice in my use case). Your reply implies that the non-interactive / headless mode of pushing from external location to is not possible?

from artifacts-credprovider.

Lutando avatar Lutando commented on July 24, 2024

Thanks @satbai I will give this a try tomorrow, but your guidance makes sense to me so I guess we can close this.

from artifacts-credprovider.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.