In order to use tfx against TFS on-premises, you will need to enable basic authentication in the tfs virtual application in IIS. This is a temporary solution until NTLM authentication is supported.
WARNING!! Basic authentication sends usernames and passwords in plaintext. You should consider configuring TFS to use SSL in order to enable secure communication when using basic auth.
Follow these steps to enable basic auth for your TFS:
- Install the
Basic Authenticationfeature for IIS in Server Manager.
- Open IIS Manager and expand to the
Team Foundation Serverwebsite, and then click on thetfsvirtual application. Double-click theAuthenticationtile in the Features view
- Click on
Basic Authenticationin the list of authentication methods. ClickEnablein the right hand column. You should now seeBasic Authenticationenabled.
- Note: leave the
domainandrealmsettings forBasic Authenticationempty.
Now you can start to use tfx against your TFS server. You'll want to login before issuing commands.
- Type
tfx login --auth-type basic - You will be prompted to add your service Url.
- Note for TFS on-prem: If the server name is part of the service URL, be sure to specify the fully-qualitifed domain name (FQDN) of that server (i.e. in the form servername.domain.local). Otherwise, TFX will fail to connect.
- You will be prompted for your username. Use
domain\user(e.g. fabrikam\peter). If you are on a workgroup machine, usemachinename\username. - You will be prompted for your password. Enter the password for the username you entered.
You can now use any other tfx commands.
> tfx login --auth-type basic
Copyright Microsoft Corporation
Enter service url > http://localhost:8080/tfs/defaultcollection
Enter username > fabfiber\peter
Enter password > *******
logged in successfully