Using NuGet Feed Credentials in Custom Command Line Step

Answered

I wrote a custom script to perform nuget restore on multiple sln files. However one of the Nuget feeds requires credentials. Can I somehow use "NuGet Feed Credentials" from section "Build Features" in my CommandLine build step?

If not what other options do I have?

1
6 comments
Avatar
Permanently deleted user

Hello Petr,

Yes, during a build on TeamCity it is possible to use NuGet packages from an external authenticated feed. Please refer to TeamCity Documentation about NuGet Feed Credentials.

0
Avatar
Permanently deleted user

Hi Marina,

there was probably a misunderstanding. I am asking if I can use already defined Nuget Feed Credentials in a script that is run by Command List Step.

Petr

 

0
Avatar
Permanently deleted user

Hello Petr,

 

Yes, I see your point. Thank you for submitting a related feature request to our tracker.

At the moment there are no possibility to pass Nuget Feed Credentials into non-Nuget steps, especially password, which is a secure build feature parameter. I am in contact with one of our developers about possible ways of accessing secure parameters during build steps. I will return to you after he is available.

However, several Nuget Installer steps with Restore mode for each of the solutions can be a possible workaround here.

0
Avatar
Permanently deleted user

Any update on this?

This would be a good feature, or add the ability for nuget install step to work for *.proj files.

I currently have to run a custom command line build step to do a "nuget restore ..." for my MSBuild proj file.
However, I am currently unable to set the source to the teamcity nuget feed as it doesn't have access to the credentials.

In this scenario there is no workaround. So I am having to use NuGet.Server just for 2 nuget packages that already exist in my private teamcity nuget feed.

0
Avatar
Permanently deleted user

Any update on this?   We build inside Docker, thus not a NuGet step and would like to use proper credentials.

0

Hi Jason, 

please check the related issue in YouTrack for any updates. The current status is the issue isn't planned for any release version. 

As for your case, is it possible for you to use ".NET CLI" build step instead of "NuGet Installer"?

0

Please sign in to leave a comment.