How do I retrieve the value for %teamcity.nuget.feed.api.key%

I'm trying to run a nuget push command and it's failing. In order to debug the problem, I want to reproduce at the command line but can't since the api key is obfuscated.

How do I retrieve this value?

1
4 comments

Hi Dan,

What error are you getting?

If you do not see a particular error in the build log, teamcity-server.log, or teamcity-nuget.log, you might need to change the Active logging preset to `debug-all` under Administration - Diagnostics - Troubleshooting, and reproduce the failure.

Changing logging preset does not require build server restart. Be sure to change the preset back to <Default> after you are done troubleshooting.

/Anatoly

0

Thanks Aantoly but really what I'm after is the ability to manage the nuget feed independently of the teamcity build configurations. The errors I was getting were related to conflicts where I was trying to push a package version that already existed. Given there are times I might want to perform bulk operations on the nuget feed, it would be a lot easier if I could just do that from the command line. However, in order to do that, I need to know the teamcity api key - hence my question.

0

From a purely technical standpoint it is possible to hack around the parameter and get the API key in text format. However that API key will only be valid during the build from which it is taken, thus, on practice such key will not be very useful.

The built-in NuGet feed is designed to be managed from within TeamCity. That said, if you describe what exactly you are trying to achieve, it will be easier to suggest an adequate solution.

0

As I mentioned, I'm trying to bulk upload a bunch of nuget packages to a newly created teamcity feed. For whatever reason, this was consistently crapping out pushing ~35 out of 70 packages so I wanted to do it from the command line where I have more control over logging, redirection, etc.

 

I didn't realize the api key was ephemeral and only meant for 1 time use. It's a moot point now anyway but just think it shouldn't be so difficult to recreate directly on the command line what teamcity is doing internally.

1

Please sign in to leave a comment.