fincooper
fincooper

Reputation: 2997

Error TF30063: You are not authorized to access ... \DefaultCollection

I'm using TFS Preview (Team Foundation Service) with one of my projects with Visual Studio 2012. I'm also using an on-premises TFS server with most of my projects. When I use my on-premises TFS after using TFS preview and go back to using TFS preview, I get this error:

TF30063: You are not authorized to access MyProject\DefaultCollection.

If I go to TeamDisconnect TFS and then connect to TFS preview again, I'm able to see a "Loading identifiers" loading screen coming up, but in the end I don't get to enter my credentials to TFS preview (my Microsoft account) and as a result, the TF30063 error still occurs.

I suspect this has something to do with my Microsoft account (i.e. Live ID). I'm logged in to Windows with the same Microsoft account that I use at TFS preview. I have logged in to other sites (Windows Development Center, MSDN, etc.) with other Microsoft accounts, but I verified that if I log out of these services and re-login with the correct Microsoft account, I still get the TF30063 error when I try to log in to TFS preview from Visual Studio.

Upvotes: 255

Views: 287666

Answers (30)

Frank Tzanabetis
Frank Tzanabetis

Reputation: 2836

This was happening to me within my local setup of TFS when I was tasked with restoring an old TFS database. For some reason, I could not even access "Group Membership" or "Administer Security" options within the Team Foundation Server Administration Console.

Whenever I tried, it would give me the "You are not authorized" error message, but it was a red herring.

Turns out that the connection strings setting was incorrect in IIS, and was pointing to a non-existent database - enter image description here

It was supposed to be connecting to an "aspnetdb" database which includes tables for old-school authentication with asp.net websites (i.e.: it has aspnet_Users, aspnet_Roles, etc tables, and a bunch of stored procs for authentication)

To fix it, you need to go back down memory lane and create one of these DBs. Just create the DB in your local SQL Server, and run this -

cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
aspnet_regsql.exe

This will open the ASP.NET SQL Server Setup Wizard where you can create all the tables and stored procs that are needed.

You can then set up the connection string in IIS -

enter image description here

And the problem goes away. I also added a user which matched my Windows user but dunno if this had an effect. It was pretty much a random effort to get it working again for me, and I have no interest in figuring it out beyond getting it to work.

enter image description here

Not sure how my machine got in to this state to begin with where it would error without any useful explanation, but hopefully this will save someone else's sanity.

Upvotes: 0

TPG
TPG

Reputation: 3219

Go to "Menu > Disconnect from Server". Then open Team Explorer, double click on the project to connect again solve my problem.

Upvotes: 1

456q
456q

Reputation: 117

The littel "Manage Connection" button was mentioned here before. Hower right click and connect did not solve the issue for me.

enter image description here

Clicking on "Manage Connections" > "Connect to a Project" allowed me to enter my credentials again and finally reestablished the connection.

Upvotes: 0

Simon_Weaver
Simon_Weaver

Reputation: 146218

It would be a lot easier if the error message were to tell us the username it's trying to access TFS with.

I've been coping with this for a while, and usually logging back in only for the next day to stop again.

I found I had two accounts and removing the unwanted one fixed the issue.

enter image description here

This is under Help > Register Visual Studio

Upvotes: 2

Senthil
Senthil

Reputation: 71

Same problem not resolved after trying all the above solution for me, then the below command resolve the issue. open a run command on windows and just copy the below command and make the necessary changes like domain\loginname and the VS path

runas /netonly /user:domain\loginname "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe"

Upvotes: 0

Rohan Rao
Rohan Rao

Reputation: 2613

I was also facing the same issue as you did. Here is what I did to solve:

METHOD 1

  1. Click the 'Connect' icon just next to Home icon in Solution Explorer.
  2. Choose your project > Right Click > Connect.
  3. Try Check-in the project and this time it will happily proceed.

This is what I tried, and I did not need to logout from any sessions from TFS or VS Account.

METHOD 2

  1. Just press refresh on the top of Team Explorer.
  2. Try to Check-in.

This is also easy method.

Hope this helps.

Upvotes: 3

Pasha
Pasha

Reputation: 908

I got this error, after all fiddling work I could do — the disk space was full!

Clearing it fixed my issue.

Upvotes: 3

Protector one
Protector one

Reputation: 7331

If Rizowski's answer of clicking the green plug connect-button doesn't work and you have multiple workspaces, the problem might go away by switching to the other workspace and back again.

Upvotes: 0

Mani5556
Mani5556

Reputation: 402

What isn't officially an answer here, but worked for me (the other answers didn't help): Click Team Explorer tab -> Connect hyperlink - connect\choose repository. And it works.

Upvotes: 2

Sukesh Mullassery
Sukesh Mullassery

Reputation: 11

For me, all the above didn't work (worked partially though)!

In credential manager, under Windows credentials and Generic Credentials both places I had to add user credential.

In Windows Credentials, TFS Server name without "http" and port info. Just server name.

In Generic Credentials, TFS Server name with "http" and port info. like, http://servername:8080/

enter image description here

Upvotes: 0

Kyle Burkett
Kyle Burkett

Reputation: 1443

After updating from TFS 2018 v3 to DevOps Server 2019.0.1 last weekend I now receive this authentication error when attempting to manage security:

TF30063: You are not authorized to access tfs.

I receive this error when attempting to manage security from the Server Administration Console via Application Tier > Administer Security. I also receive the error when I attempt to set permissions via tfssecurity cli tool. I am in the local administrator group and I am listed in the console administration user section.

I'm trying to set permissions because after the update I received several reports from employees that receive errors when they try to access their projects. Those errors are:

TF40049: You do not have licensing rights to access this feature: Code.

I spent 8 hrs working through this issue yesterday, and this is what fixed our problem:

  • deleted DevOps server cache. (location of cache listed in devops admin console on server)
  • reboot server.

I deleted the cache off the server based on an article I read with the same error, a user was having security/permissions issues with visual studio and they deleted the vs cache on their local machine and it solved their problem. I don't know if deleting the cache or the reboot would have fixed it independently because I did them both as a single troubleshooting step.

Hope this helps someone.

Upvotes: 0

Jason D.
Jason D.

Reputation: 480

I went through a number of these solutions too, here what worked for me:

For some reason Team explorer thought I was trying to upload to a new project.

Under Team Explorer -> Sync

I clicked "Advanced" which then showed a Project dropdown as well, which I didn't have to change in my case, I just clicked Publish Repository, and voila.

Upvotes: 0

Markus Bruckner
Markus Bruckner

Reputation: 2880

I solved this issue by using the browser from within Visual Studio, View->Other Windows->Web Browser; Ctrl+Alt+R (or * Ctrl+W, W* in VS versions before VS2010) to navigate to the TFS page and log out of the wrong account and log back in.

For me, the issue was caused by using another live-id to unlock a windows phone for development. Somehow the credentials got cached, it seems.

Upvotes: 196

kyorilys
kyorilys

Reputation: 832

Just enter a new Credential

  1. press Win button, then type credential manager and open it .
  2. Add generic credentials.
  3. Go back to team explorer, add the server again.

Upvotes: 0

Adeel Shekhani
Adeel Shekhani

Reputation: 1105

Just restarting the visual Studio would do the job. As I did this and it worked like a charm

Upvotes: 5

SuRa
SuRa

Reputation: 1093

Check the information in registry : HKEY_CURRENT_USER\SOFTWARE\Microsoft\VSCommon\Keychain\Accounts and delete the related keys under Accounts section.

Clear the cache in these paths:

  • %localappdata%\Microsoft\TeamTest

  • %localappdata%\Microsoft\Team Foundation

  • %localappdata%\Microsoft\VisualStudio

  • %appdata%\Roaming\Microsoft\VisualStudio

Hope this will work.

Note: By doing this may clear all the cookies and caches and load the Visual Studio New.

Upvotes: 2

Nigel Davies
Nigel Davies

Reputation: 1690

I get this problem when I am forced by our IT security policy to change my password. After a password change, when I connect to TFS using VS2017, I am no longer authorized to access our TFS server and get the TF30063: You are not authorised to access ...:8080/tfs error message.

However, if I connect using VS2013, I can connect to the server without problems and the access denied error with VS2017 goes away.

Upvotes: 1

Blue Clouds
Blue Clouds

Reputation: 8191

In my case I had a proxy. I had edited the devenv.exe.config and set the proxy there. But today I changed the proxy domain password and TFS failed (menu ViewWindowsBrowser also failed). I could of course have edited the devenv.exe again. But there was a solution to remove it altogether. A brilliant one. It is given here.

Open menu TOOLS* → Extensions & Updates.
Click on Updates... in the left-hand menu

Here it asks for password and restarting Visual Studio. All okay. For more info, look for the answer in the link.

Upvotes: 0

Eric Ouellet
Eric Ouellet

Reputation: 11763

I finally found the right answer for me on the web.

For me it happened after I changed my password and Windows cached the TFS password. It is require to be updated manually. This is one way to do it:

Solution found at: developercommunity.visualstudio.com

CREDIT: Lavente Nagy! Thanks so much!

Fix Summary:

I found a solution, and it works on Windows 7/Windows 10 too. The steps are the same:

Close Visual Studio. Go to Control Panel (with small icon view) → User Accounts → Manage your credentials (on the left column) → Select "Windows Credentials" → Scroll down to the "Generic Credentials" section and look for your TFS server connection. Expand the pull down and click "Edit". Enter in new network password. Reopen Visual Studio and everything should work again.

Upvotes: 3

David Rogers
David Rogers

Reputation: 2653

I've experienced this issue after an TFS upgrade, and somehow Visual Studio is caching invalid login credentials. I've found two ways to fix it, first, using this answer I completely reset Visual Studio, then reconnected:

Click on menu ToolsImport and Export SettingsReset all settingsNext"No, just reset settings, overwriting all current settings"NextFinish.

For some strange reason, after the reset it connected without issue (I didn't even have to re-enter my credentials or reconfigure TFS after the reset).

The second approach was easier. First close all instances of Internet Explorer and Visual Studio, then open Internet Explorer and browse to TFS, login, then open Visual Studio again and attempt to connect to TFS one more time.

Upvotes: 3

Chris Halcrow
Chris Halcrow

Reputation: 32020

Try making Internet Explorer your default browser temporarily.

Upvotes: 0

Demian Kasier
Demian Kasier

Reputation: 2543

For me the error came after changing my password for my AD account.

I had to remove the line from credential manager (which contained the previous password.)

Then it worked again.

Upvotes: 71

Sajjad.HS
Sajjad.HS

Reputation: 393

In team explorer I removed project... then in Manage Connections, clicked on 'Connect to a Project...'

enter image description here

enter image description here

In this screen choose your project then click on Connect... this solved my problem.

Upvotes: 8

clarifier
clarifier

Reputation: 149

Now I got the solution to the problem which I have faced: The TFS remembered the prior password when I got logged in by using my mobile VPN.

Solution:

Resetting the account that I used to connect using VPN

Upvotes: 1

Timeless
Timeless

Reputation: 7547

None of the current answers worked for me. I found a solution here.

The issue was that my previous credentials were cached by the Windows OS for the TFS server. While some people might have had success wiping out the AppData temp folders, that is not required.

You need to update the credentials through Control Panel on the Windows OS.

For me on Windows 10: Close VS. Go to Control Panel (with small icon view)-->User Accounts-->Manage your credentials (on the left column)-->Select "Windows Credentials"-->Scroll down to the "Generic Credentials" section and look for your TFS server connection. Expand the pull down and click "Edit". Enter in new network password. Reopen VS and everything should work again.

Upvotes: 5

Darxis
Darxis

Reputation: 1570

I have upgraded TFS 2015 to TFS 2017, and then the TF30063 error occured on one of my client machines. None of the solutions here worked...

For me the only solution that worked was running the following command from the Developer Command Prompt:

tf workspaces /collection:https://tfs.xxxxx.com/tfs/DefaultCollection

Of course, you need to adjust the url to the valid one.

Source: https://www.visualstudio.com/en-us/docs/setup-admin/tfs/admin/backup/refresh-data-caches

Upvotes: 37

Abhishek Siddhu
Abhishek Siddhu

Reputation: 587

Disconnect from Team Fountation Server under Team Menu and reconnect it from Connect Tab under Team Explorer Window

enter image description here enter image description here

Upvotes: 4

Paul Schroeder
Paul Schroeder

Reputation: 1601

When Visual Studio prompted me for Visual Studio Team Services credentials there are two options:

  1. Use a "Work or School"
  2. Use a "Personal" account

In my situation I was using a work email address, however, I had to select "Personal" in order to get connected. Selecting "Work or School" gave me the "tf30063 you are not authorized to access..." error.

For some reason my email address appears to be registered as "personal" even though everything is setup in Office 365 / Azure as a company. I believe the Microsoft account was created prior to our Silver Partnership status with Microsoft.

Upvotes: 4

user1568891
user1568891

Reputation: 395

I had to "run as a different user" to get Visual Studio to connect using my TFS account. It seemed to be trying to use my Microsoft account instead.

Text and image from: https://www.visualstudio.com/en-us/docs/connect/connect-team-projects

To change accounts

To run Visual Studio under an account that is different from your logged on Windows account, open the context menu for devenv.exe to access your run as options.

Context menu for Visual Studio devenv.exe

You can locate the executable in the following folder: Drive:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE.

Upvotes: 2

tony09uk
tony09uk

Reputation: 2991

I tried the following to resolve this issue. Hopefully one of these will work for you

A - Close VS then start the VS Developer Command prompt as an administrator. Then enter: devenv /resetuserdata

B - Clear the cache in IE (apparently VS uses this to access your account mentioned here)

C - Click View -> Other Window -> Web browser (CTRL+ALT+r) sign in to your old account, log out and sign in to your new one

D - Open the folder containing you solution, delete (backup if you want) the Visual Studio Source Control Solution Metadata File delete the .suo file and open the .sln file in Notepad and delete the below section

GlobalSection(TeamFoundationVersionControl) = preSolution
    SccNumberOfProjects = 6
    SccEnterpriseProvider = {**********************}
    SccTeamFoundationServer = theServer
    SccLocalPath0 = .
    SccProjectUniqueName1 = pro
    SccProjectName1 = myProject.BL
    SccLocalPath1 = myProject.BL
    .....more stuff.....
EndGlobalSection

The last step was required because, while I had managed to disconnect VS my solution was still trying to connect to the old source control account.

Upvotes: 10

Related Questions