microsoft / vso-agent

Visual Studio Team Services and TFS agent for Mac OSX and Linux
MIT License
131 stars 57 forks source link

Failed Request: Unauthorized(401) #187

Closed redbrain17 closed 8 years ago

redbrain17 commented 8 years ago

Hello,

I try to setup a vso-agent on ubuntu 14.04 but I always get a "Failed Request Unauthorized(401)" from my TFS.

On TFS I added username to Agent Pool Administrator and Agent Pool Service Account On IIS I installed basic authentication and enabled it. From my Ubuntu PC I can access TFS via Firefox and same credentials i like to use for vso-agent.

node agent/vsoagent
Enter alternate username > username
Enter alternate password > 
Enter server url > http://server:8080/tfs/
Enter agent name (enter sets ibis-build)  >
Enter agent pool name (enter sets default)  >
Enter force basic (enter is false)  >
Error starting the agent
Failed Request: Unauthorized(401) - http://server:8080/tfs/_apis/connectionData

Some clue what whent wrong with my setup?

Best Regards,

bryanmacfarlane commented 8 years ago

Since it's 401 (unauthorized) it means IIS is not accepting your credentials. That means it's an IIS config issue or credentials are wrong.

Ensure you are following all the steps here (including #4) and the domain/user account is valid.

https://github.com/Microsoft/tfs-cli/blob/master/docs/configureBasicAuth.md

If it was a role membership issue (pool administrators etc...), you would get a 403.

Since you're doing on-prem, ensure you're also following all the steps on this repos README (for example install @preview and during config, force basic is true