How to get fix "You are not authorized to access" accessing VS Team Services - tfs

I can open internet explorer and login just fine.
Credentials are saved in the credential manager.
Trying to access any tf.exe command results in a TF30063 error.
I do not have VS installed on this machine.
Any suggestions on what to try?
UPDATE:
Here are the step I've taken to get this error.
Login to VS Team Services via IE
At the command prompt:
C:\>tf.exe status /collection:https://xxxxx.visualstudio.com/DefaultCollection
C:\>tf.exe workspaces /collection:https://xxxxx.visualstudio.com
C:\>tf.exe workspace /new /collection:https://xxxxx.visualstudio.com
I've also tried a few others and everyone of them return with the same unauthorized error.
These commands all work on another server that's connected to the same tfs repo with the same credentials, which leads me to believe it's something in IE and/or internet security options.

Taking add files and folders to version control as example, you can specify the user account /login:username,[password] in the command:
tf add itemspec [/lock:(none|checkin|checkout)] [/encoding:filetype]
[/noprompt] [/recursive] [/noignore] [/login:username,[password]]
More commands, see: https://www.visualstudio.com/en-us/docs/tfvc/use-team-foundation-version-control-commands

To use tf.exe command, you need either Visual Studio or Team Explorer is installed. More details please refer Command-line tools for TFS

Related

Team Explorer configuration via command line

I am trying to automatically configure the TF Workspace for all users when they login on a PC which is different from what they normally code on.
I am currently running the following to configure the workspace via a logon script
./TF.exe workspace /new /collection:azuredevops.url/project /permission:public /location:Server /filetime:current /noprompt
But when the user starts Visual Studio in Team Explorer it is not enabled /online for the user.
Even the "Connect to a project" is empty
How do I configure this in PowerShell or CMD using TF or any other function?
In the command line you are using, I see you set the value of the option /collection as "azuredevops.url/project".
According to the docs about tf workspace command (see here):
/collection: Specifies the project collection.
It seems that the value of the option /collection should be set as the collection URL.
I tried both the collection URL and the project URL in the command, only the collection URL did work, the project URL returned error.
In addition, you can manually try the following command on the machine,
tf.exe workspace /new /collection:<collection URL>
to see if it can normally pop-up the window like as the screenshot shows below.
This can verify if the tf workspace command is working on your machine.
[UPDATE]
The TF.exe is a tool that integrates some interfaces of Azure DevOps. It helps you set up the configurations of TFVC workspace on background, instead of manually filling the parameters via the VS UI. It's not a VS integrating tool that can fill parameters on the VS UI.
When you open VS, to automatically connect the project on the VS UI, you need to use the VS integrating API (or interfaces collection) to achieve the operation on the VS UI. However, currently, we have no such API or CLI to do this. So, you need to manually connect the project after opening VS.

How to integrate TFS in WebStorm?

I'm using Git with WebStorm's version control already, but have to use TFS version control. After some research fond this plugin but there is no tutorial that aiming to configure that plugin.
Can anyone guide me?
You can opt for using git tfs, locally you can still use Git and all of the advantages you're used to. And then push from git to TFVC. You'll need to install Team Explorer or the Team Explorer Cross Platform Commandline Tools.
Or you can use the native plugin for, thelatest version of the TFS / Azure DevOps (Server) plugin can be found on the Jetbrains site. It requires TFS 2015 or newer. You can use the plugin you found for older versions of TFS.
A good explanation to get started can be found here. The part to configure TFVC is replicated below.
Visual Studio Team Services plugin and TFVC
Before starting with TFVC, we need an external tool. The tool in question is TF command line tool. It ships with the Microsoft Team Explorer Everywhere 2015 and you can download it here.
The file we are interested in is TEE-CLC-14.0.3.zip. Download it and unzip it in a folder of your choice. You should end up with something similar to this.
Now, open the command prompt, move into the folder where you have extracted the TF command line tool and run the following:
tf eula /accept
If command succeeded and you haven’t received any error, you are good to go.
Now back to IDEA. Open the settings panel.
and move to Version Control -> TFVC pane. In the select path to executable field, enter the exact path to the tf.cmd command file located in TF command line tool folder.
Once done, press the test button and you should see the following message
Confirm all of the open windows and get back to the IDEA welcome page. Now you are ready to choose Team Services TFVC (Preview) version control.
At this point, same as for Git, you will be prompted about the connection towards your TFS. The following dialog will be shown.
Move to the Team Foundation Server tab and specify the address of your TFS server, then click connect. You will now be prompted for the credentials and if everything is ok, you will be shown the list of available TFVC repositories.
You can now create a new workspace directly from IDEA and start working with your TFVC repositories.

Unable to validate collection

I am trying to set up TFS for vscode. I am getting the error, unable to validate the collection assuming 'default collection', when signing in. Any recommendations oh how to resolve this issue.
Firstly make sure you have correctly set the TFVC support.
Below is a short list of steps to get up-and-running with TFVC support:
Install the Team Services extension for Visual Studio Code.
Team Foundation Server requires your domain credentials.
Ensure you have a TF command line client installed (either TF.exe or
the TEE CLC).
Set the tfvc.location VS Code setting to the full path of your TF
command line client.
Open a folder containing a Local TFVC Workspace and sign in when
prompted.
Set the SCM Provider to TFVC.
For more detail tutorial you could also take a look at my reply in this question How can I connect to on-premises TFS using visual studio code?
Back on the error message, it may related to the workspace. Check if you have correctly mapped the workspace. Just try to remap the existing workspace or create a new workspace and map sources to a new local folder, then check that again.
Also just try to specify the collection and team project name in the user settings like this:
{
"tfvc.location": "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\Common7\\IDE\\tf.exe",
"team.remoteUrl": "http://server:8080/tfs/collection",
"team.teamProject": "TeamProjectName",
"tfvc.restrictWorkspace": true,
"window.zoomLevel": 2
}

How to clear TFS Cache in a linux machine

After removal of existing account all the workspaes for old account was deleted in my linux Jenkins server. But when changed configuration to new Account credentials. I am finding old workspaces could not be overrided with new account details. where on server side we could not find that workspace details.
Is there a way we can clear linux client cache?
According to my understand, seems you want to migrate all workspaces from your old user to another user. This can be accomplished by command line tool tf.exe
tf workspaces /updateUserName:OldUserName /collection:collectionurl
This should be done with your new account, and will assign all workspaces from old account to current account.
/updateUserName
Updates security identification information on the Team Foundation
server for a user whose network user name has been changed. If you
specify this option, you must also specify a team project collection
by using the /collection option.
More details please refer Workspaces Command For Linux machine, you could use Team Explorer Everywhere (TEE) an Eclipse plug-in and a command-line client to run the command.
Another way is creating the server workspace on Windows, then use the /template option on Linux to setup the same configuration.

Setup Jenkins on VSO with TFS

Has anyone successfully set up VSO & Jenkins & TFS?
Server URL: https://<myproject>.visualstudio.com/DefaultCollection
Login name and user password (using alternative credentials)
What domain name did you use? <domain>\username
If I run the tf command in Command Prompt, it succeeds, but Jenkins shows the same command as failing. I'm lost as to how to debug this. I also tried setting cached credentials for TFS, and not caching them. It seems as though Jenkins does not have cached credentials, but my command prompt does? Why would my system have stored credentials for me, but not Jenkins?
Error from Jenkins: TF30063: You are not authorized to access https://windwardstudios.visualstudio.com/DefaultCollection
With the release of version 4.0.0 of the Jenkins Team Foundation Server plugin, Team Foundation Version Control (TFVC) from Visual Studio Online (VSO) is now officially supported and both Personal Access Tokens (PAT) & alternate credentials can be used.
See the section User name and password in the wiki page.
This is an answer, but may not be what you want to hear. This used to work for us about a year ago. It required someone to stay logged into VisualStudio.com with his MSDN credentials on the build server. Then we simply didn't use credentials in the Jenkins TFS plug-in. Then one day, that simply stopped working. We tried alternative credentials, as #MrHinsh suggested, but never got it to work. Eventually we gave up and switched all of our TFS repositories to git (but still hosted on VisualStudio.com). That does work with the alternate credentials, and we have been very pleased since.
You need to configure Jenkins yo use the alternate credentials. It will not work with any other configuration and the credentials are never stored. Every command that you pass must include the same creds.

Resources