-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NuGetAuthenticate and on-premise (Azure DevOps Server 2019) #12471
Comments
Hello @chucker We have a script that you can run that will add the auth task to your on premise instance. However, for now we haven't officially published the scripts yet because we haven't tested the scripts behind a proxy. Is your Azure DevOps Server behind a proxy? Before running one of the scripts, please read through it to understand what it does. Here's the script for PowerShell (Windows) and here's the one for Bash (Linux/Mac). Here are the main steps the script takes:
Setup before running the script. For both these scripts you will need:
Powershell script: Provide the needed parameters. By default this script adds NuGet Authenticate, Maven Authenticate, Pip Authenticate and Twine Authenticate tasks. If you only want to add the NuGet Authenticate task you can run the script with a "-Task NuGetAuthenticateV0". Shell / Bash script: If the script ran successfully you can now add the auth task to your pipeline. Let me know if you have any questions or if you run into any issues. Edit: Please note that you must run the script in a directory with a short path such as "C:\MyTest", otherwise the step where NuGetAuthenticate gets built may fail when the build extracts the artifacts credential provider. Edit 2: Azure DevOps Server 2020+ includes the NuGet Authenticate task. |
Hi @satbai, and thank you for your response. I'm not behind a proxy. I'll take a look! |
Hi there @satbai , I tried to follow your instructions and was succesfully able to install the tasks for maven, pip and twine. However, the NuGet task, that I so dire need, did not work. Enclosing screenshot - can you diagnose the issue? Thanks a million in advance. |
I was able to reproduce your issue when I was running the script in a directory with a long path. However, when running it in a directory with shorter path it succeeded. E.g. "C:\MyTest". Sorry for the inconvenience! I'll include this in the instructions above. |
@satbai Terrific, and great service, really appreciate it. |
The script is failing when it does "node make.js build --task NuGetAuthenticateV0". And in the pipeline repo's build it looks like it's failing when it tries to download the credential provider. I think this open issue is the cause of this. Unfortunately the workaround there seems to be to downgrade node :( |
@satbai just FYI, your Unix script won't (easily) work on macOS, as it only ships with bash 3.2.
My guess is that's a newer bash feature. In Windows on PowerShell, I get:
I've tried both |
Thanks for this work around. |
I have used node version 11.15 and successfully uploaded these task to an on-premise devops server. Using tfx build tasks --list the NuGetAuthenticate task appears with following entry:
However, it does not work to use it in a pipeline with
The pipeline cannot be started. Azure DevOps Server complains that the task is missing. Any hint, what I could have missed here? Edit: The task can be added for each collection of the Azure Dev Ops server separately, so it was necessary to add it to the correct collection, to get it working. This is what I missed... |
I had the similar problem to solve, and satbai's comment above was super helpful to solve it. What is needed is two commands (once you have tfx-cli installed): node make.js build --task NuGetAuthenticateV0 tfx build tasks upload --task-path _build\Tasks\NuGetAuthenticateV0 --service-url $ServiceURL --token $PAT I did not have time to fight with the error when downloading NugetCredProvider 0.1.20 that is listed in the archivePackages (not a nodejs developer), so I just dowloaded it in a browser, unzipped and patched make-util.js line 617: //var archiveSource = downloadArchive(archive.url); You could modify the downloadArchive() function to only download archives that have not been downloaded to a local directory-cache yet. Or you could just zip and attach prebuilt tasks here which we could upload to on-prem tfs. |
I'm getting the following error:
I tried to install tfx-cli manually, but that triggers a deprecation error:
|
I could not get past the error downloading the cred provider (even after reverting to node 11.15) so I went with @dpurge and manually downloaded it. This got me past the node make.js build step (with the same hack to line 617) When I attempt to run the next step 'tfx build tasks upload...' I get:
Oddly, this is the same error that led me to this post in the first place. I originally just omitted the NuGetAuthenticate task in my build pipeline, seeing as how it did not exist, and attempted to do a nuget push directly to my artifact feed which resulted in this exact error. I'll continue looking at it tomorrow, but if anyone has come across this i'd appreciate some help. Been fighting with on prem artifact feeds for a few days now. |
@steve-kuennen I got around the download error by updating sync-request to the latest version. Even though I finally got the authenticate task installed on our DevOps Server instance, I still can't get my build process (or when I run dotnet restore manually on our build servers) to get credentials. |
@a688 I believe the way it works requires a few things to match. I use this task to set up credential provider to upload and download tasks to Azure Artifacts, and this is a process that I use during troubleshooting.
|
This issue is stale because it has been open for 180 days with no activity. Remove the stale label or comment on the issue otherwise this will be closed in 5 days |
Type: Feature
Enter Task Name: NuGetAuthenticate
Environment
Server - Azure DevOps Server 2019 Update 1.1
Agent - Private, Windows Server 2012 R2, agent 2.153.1
Issue Description
I have a project with Azure Pipelines, Azure Code (git), and Azure Artifacts (NuGet) to store some private packages. Trying to access that artifact from the pipeline seems to be rather cumbersome in terms of authentication.
Recent guidance such as here suggests to use the NuGetAuthenticate task.
However, that task seems to only be available on the cloud version. (the docs seem to support this: they don't list it for "Azure DevOps Server 2019".)
Given the usefulness, is porting the task to on-premise planned? Can I manually install the task somehow, or is there a reasonable alternative?
The text was updated successfully, but these errors were encountered: