Octopack passing windows credentials

Is it possible for octopack to supply windows credentials when pushing a nuget package? I would like to create a private nuget gallery that requires windows authentication in order to read/write packages.

Hi Ryan,

OctoPack just calls NuGet.exe push. if your credentials are saved with NuGet then it might actually already work. I believe NuGet push already includes the default credentials but I haven’t tested this.


Hi Ryan,

Did you end up getting this to work?

I’ve created and checked in a NuGet.Config in the .octopack directory with the correct credentials. This works perfectly when I issue a push locally.

But just does not appear to work during the TFS build process sadly - the log shows its still prompting for credentials and failing. So the config does not appear to be getting picked up there for some reason?

I did manage to get mine working properly but don’t entirely remember what I did. If you need some help with it I can try and remember and send you some info.

Thanks Ryan, anything you can dig up on how you did this would be fantastic - this really is the last hurdle (securing the Nuget feed) I need to get over before we can take Octopus into production.

Perhaps I am even going about securing the feed the wrong/hard way by using this method of authentication?

Hi Gents, I’m having the exact same issue that Phil described.
My current build/deployment solution consists of the following technologies;
Hosted TFS Git -> Hosted TFS Build -> MyGet (Private Feed).

In the final stage of the build the nuget push fails requesting credentials. I have added the package source credentials to a NuGet.Config file in the .octopack folder and in the .nuget folder.

As Phil suggested running nuget push locally picks up the credentials and works fine.

Any ideas on how to resolve this without going back to using a public feed would be greatly appreciated?


I have temporarily resolved this issue. Turns out when octopack runs “nuget.exe push” within msbuild, nuget doesn’t seem to automatically find the solution’s nuget config file. So by modifying the following line in the octopack.targets file, you can tell nuget to use a local nuget config.

Full path will be something like the following in Hosted TFS Build; C:\a\src.octopack\NuGet.Config