NuGet Installer Build Step ~ Unable to authenticate

Hello everyone,

I am trying to install a NuGet Package before a build using the NuGet Installer Build Step.

As a package source, I have specified the %teamcity.nuget.feed.auth.server%

I have added a NuGet Feed Credentials referring to the feed %teamcity.nuget.feed.auth.server% and provided the credentials there. I have checked that the credentials are correct by manually accessing the feed in a browser.

However, when I try to build the project, I get the following error message:

[16:02:22][restore] Please provide credentials for: http://localhost:80/httpAuth/app/nuget/v1/FeedService.svc/
[16:02:22][restore] UserName: GET http://localhost/httpAuth/app/nuget/v1/FeedService.svc/Packages(Id='SpecEx',Version='2.2.14')
[16:02:22][restore] Unauthorized http://localhost/httpAuth/app/nuget/v1/FeedService.svc/Packages(Id='SpecEx',Version='2.2.14') 1ms
 
What am I doing wrong here?
 
Thanks in advance,
Kira Resari
0
1 comment

Okay, I was able to resolve this rather tricky issue.

Here's my breakdown of what happened:

I was using %teamcity.nuget.feed.auth.server% as the Package Source. That was what caused the issue.

What internally happened was that TeamCity resolved %teamcity.nuget.feed.auth.server% as http://localhost:80/httpAuth/app/nuget/v1/FeedService.svc/ . This differed from the actual feed address of http://xxx.xxx.xxx/httpAuth/app/nuget/v1/FeedService.svc/ , and somehow caused the authentication to fail, causing a 401 Unauthorized exception.

I was able to resolve it from changing my package source from %teamcity.nuget.feed.auth.server% to http://xxx.xxx.xxx/httpAuth/app/nuget/v1/FeedService.svc/ (the Authenticated Feed URL as listed in the NuGet Feed Administration Page). Now the authentication works.

1

Please sign in to leave a comment.