Help regarding NUGet Auth Service
I am working on NUGet Install, Issue is the build is not able to view the NUget package if I use %teamcity.nuget.feed.server% . As I need Auth Serive to read the Package and Guests should not be able to the package. Now if I put the Auth service url in the Package source http://teamcity:3002/httpAuth/app/nuget/v1/FeedService.svc.
The Build gets stuck with this message
[11:12:28][install] Please provide credentials for: http://teamcity:3002/httpAuth/app/nuget/v1/FeedService.svc
[11:24:56][install] UserName: Password:
Please sign in to leave a comment.
I was able to fix this issue by running a step first
The Command to run from TeamCity as a Build Step for each agent individually
nuget sources add -Name TeamCity -source "http://TeamCity:800/httpAuth/app/nuget/v1/FeedService.svc" -UserName <User Name> -Password <Password>
Now whenever you want to use the Nuget Install, use the Authentication url instead of %teamcity.nuget.feed.server%
Verify that The Agent running with a credential should have a file at following location "Documents and Settings\<UserName>\Application Data\NuGet\NuGet.Config". This file will have the credential tag for example
<configuration>
<packageRestore>
<add key="enabled" value="True" />
</packageRestore>
<packageSources>
<add key="TeamCity" value="http://TeamCity:800/guestAuth/app/nuget/v1/FeedService.svc" />
<add key="NuGet official package source" value="https://nuget.org/api/v2/" />
<add key="TeamcityAuth" value="http://TeamCity:800/httpAuth/app/nuget/v1/FeedService.svc" />
</packageSources>
<disabledPackageSources />
<packageSourceCredentials>
<TeamcityAuth>
<add key="Username" value="UserName" />
<add key="Password" value="<Some Encrypted Value using nuget encryption Logic>" />
</TeamcityAuth>
</packageSourceCredentials>
<activePackageSource>
<add key="TeamcityAuth" value="http://TeamCity:800/httpAuth/app/nuget/v1/FeedService.svc" />
</activePackageSource>
</configuration>