tf.exe complains that "TF30063: You are not authorized to access "

I'm trying to get the list of workspaces using this command:

tf workspaces /collection:url /computer:* /owner:* /format:xml > workspacesxml.xml

Where I replace url with the Azure DevOps URL of my organization account.

The problem is that it complains that:

TF30063: You are not authorized to access

I've Cleared Windows credentials, restarting and trying again and no success. Using /login:username,password is not an option, since I have 2FA enabled.

How do I re-login into command line (CMD) or logout of TF.exe?

Upvotes: 5

Views: 4299

Answers (1)

PatrickLu-MSFT
PatrickLu-MSFT

Reputation: 51073

Your error is clearly, not authorized to connect remote url. If it's not cached in local, you need to specify the authentication included in the command line.

According to your description the Azure DevOps URL of my organization account. seems you are using Azure DevOps Service, not on-premises TFS. Usually /login option can be used on on-premises TFS, we use the /login option to specify the Team Foundation Server user account to run a command.

If you want to use tf.exe on Azure DevOps Service, you need to use PAT token. The command line is:

tf workspaces /collection:https://xxxx.visualstudio.com /login:PATtoken

Add a screenshot:

enter image description here


Details of using Personal access tokens (PATs) which are alternate passwords that you can use to authenticate into Azure DevOps. When use it, just leave the user name empty and enter password with PAT token.

When you are using it, please navigate to https://tfsurl/{teamprojectcollection}/_usersSettings/tokens, and make sure your PAT is still in validity period. If not, please create new token by clicking 'New Token' button.

More details please take a look at our official link-- Authenticate access with personal access tokens

Upvotes: 3

Related Questions