Cannot Add GitHub Account from Visual Studio 2022 Account Settings - visual-studio

I have just upgraded from Visual Studio 2019 to Visual Studio 2022 and I have encountered a strange problem. When going to File -> Account Settings..., under "All Accounts" I used to have both my Microsoft account (which is also my Personalization Account) and my GitHub account. In VS 2019, there was no issue adding the GitHub account, but I have not been successful in VS 2022. When I select +Add▾ then GitHub/GitHub Account, the Connect to GitHub dialog pops up asing me to Sign In to either GitHub or GitHub Enterprise. Since my account is GitHub and not GitHub Enterprise, the only sign in option listed is "Sign in with your browser".
When I select Sign in with your browser, I get redirected to https://visualstudio.microsoft.com/vs/github-signed-in/ and I get the message "Success! Your authorization was successful. You can now return to Visual Studio."
The expected result at that point would be to see my GitHub account listed under All Accounts, but I do not. The other expected result would be to see Visual Studio listed in my GitHub account under Authorized OAuth Apps, and I do see it there, so it does look like the authorization was successful. As well, I can access repositories without issue, so it looks like the problem is inside Visual Studio 2022.
Has anyone else experienced this issue? Is this a known issue that Microsoft is working on?
EDIT: I found this on the Microsoft Docs, which lays out the steps I was following. Under Adding public GitHub Accounts, I get to Step 3 ok, but then at Step 4, I do not get the expected result.
I've also found out this is preventing me from creating a new repository from VS, or opening a repository directly from VS. I can still work with local repositories cloned via GitHub Desktop, but that's about it.
Very annoying.

This worked for me:
Open ‘Account options’(Click ‘Account options’ in account settings page or navigate to tools > Options > Environment > Accounts) and check ‘Include GitHub Enterprise Server accounts’ checkbox, then click on “Re-enter your credentials” again and check if you still unable to sign in to GitHub enterprise account?
https://developercommunity.visualstudio.com/t/unable-to-sign-in-to-github-enterprise-account-in/1460790#T-N1465373

I had a suspicion that this was related to some type of settings cache or potentially some type of previous Git setting. After wiping out all of my Visual Studio settings and re-setting to factory defaults (which is another annoyance) using the following commands, it started working for me:
devenv.exe /ResetSettings
devenv.exe /ResetUserData

When I clicked Manage Connections, the GitHub option wasn't available in the usual spot. Only the Microsoft Sign on. I found another spot to connect to GitHub;
Open the Team Explorer (View -> Team Explorer).
Click the Connect | Offline drop down from the top of the explorer.
Projects -> New Repository
Under Create a new GitHub repository select Add an account under the account field to open up the sign on page for GitHub.

Related

TF30063:You are not authorized to access dev.azure.com but I can connect

I am using Azure Devops and VS2017 15.9.7.
I am logged into Devops and can sync.
When I open my project I get a message
"TF30063": You are not authorized to access dev.azure.com/myproject
I have tried going into credentials manager and deleting all the credentials for the devops organisation.
I have looked at this question and tried logging out via the browser within VS
TF30063:You are not authorized to access dev.azure.com but I can connect
I have encountered the same issue. (I need to switch back and forth between work account and test account). Of course, there could be so many reasons and it could be different for each (cached another account, or modified the password).
To resolve this issue I have two methods/steps.
Step 1 is to clear the credential from credential manager:
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.
Step 2 is to click on the operation that Connects to the Team Projects which is the button/plug icon in the Team Explorer tab. Then to also right click the project you are getting this issue on and select Connect:
I also have tried other methods but not work for me, if possible, you can check if it is useful to you:
How To Fix TF30063 Error
Error TF30063: You are not authorized to access
The comment by Kirsten Greed in the accepted solution resolved the issue for me. Reproduced here:
The problem was that I was opening the project using the Recent Project section of the start page. I closed VS, re-opened and then opened the project via "connect: in Team Explorer. Then exited. Now it seems to open ok either way.
I had the same issue, It solved by simply rerunning the Visual Studio as Administrator.
Running this command in cmd prompt, forces the re-authentication screen to come up and worked for me:
tf.exe get . /r
NOTE: you may need to locate tf.exe on your disk. For instance I have it at this location: C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer\TF.exe
Another reason for this error is that you might have to re-enter your credentials in Visual Studio:
Restarting Visual Studio and connecting to Azure DevOps did the trick for me.
If the is problem like below:
The solution will be like below:
And after that select:
Re-enter your credentials
Step 1: Add
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer" in the environment variable path
Step 2: remove azuredevops org related credential from credential manager
Step 3: Delete this folder:
C:\Users<UserName>\AppData\Local\Microsoft\Team Foundation\7.0\Cache
Step 3:
run tf workspaces /collection:https://dev.azure.com/royalmailgroup in cmd
It might be the case of a password change.
In my case I had update my account password in a different machine. So on machine #02 I went to Visual Studio > Account Settings. After the pop-up opened, there was a message to re-enter credentials.
Sometimes the password isn't updated across all used app/services and you have to enter that manually.
Hope that helps.
None of the other methods above worked for me. I tried this in visual studio 2022 and it worked.
Open the Developer PowerShell (search for PowerShell) and type in the following:
TF vc permission
This will bring up a login screen and allow you to log in.
After that you should have permission.
In Visual Studio>Navigate to Tools > Nuget Package Manager >Package Manage Settings>Azure Service Authentication>Verify/Change the account
Leo Liu's answer got me on the right track. My problem could have originated from having two different Azure DevOps accounts cached in Windows Credentials and Visual Studio started choosing which one to authenticate with at random.
Log out of both accounts in Windows Credentials.
(The Manage Connections window does not have access to source control now.)
Open up the Azure DevOps website and logout there.
Login on Azure DevOps website.
(Visual Studio's Manage Connections can access source control again.)
What did it for me was open VS without code and connect via Team Explorer, but then also it threw the same error and after some time I logged out of azure web and tried connecting via Team Explorer again and it worked.

Can't sign out of TFS in Visual Studio 2017

I am trying to sign out of TFS from Visual Studio 2017. I am connected to two VSTS online accounts. Here are the lists of the things I did:
Removing my username from Visual Studio => Help => Register Product => All Accounts
Deleting the entire entries in Credential Manager (all items from Web and Windows)
Removing entries from TeamExplorer.config
Using Team => Disconnect from Team Foundation Server
And when I open Visual Studio, one VSTS account is still accessible, while the other is not. It's so frustrating and imposes an important security threat. Even using Connection Manager windows from Team Explorer I can see that no account exists there and no TFS URL is listed there. But I can still do everything with one of my accounts.
Any ideas to help me sign out?
Update: I don't login anywhere, but this entry keeps coming back in Credential Manager:
If it is VSTS account, you should be able to sign out by the steps below:
Click on your profile in the up-right corner of VS.
Click "Account Settings".
Remove the credential that you have already signed in.
And you can also clear the .IdentityService folder under %localappdata%. VS2017 stores VSTS Account credential there.

Visual Studio - Publish Web App to Azure "Reenter your credentials" does not work

I can't publish an asp.net app to Azure Web App in Visual Studio 2015. It asks me to reenter my credentials, which I do, and then get the same "renter your credentials" screen.
I have two Azure accounts, one is my synced Azure AD identity (account#company.com), and the other as a cloud-only identity (account#company.onmicrosoft.com). When trying to log in with either of these accounts, Visual Studio still says "Reenter your credentials" and does not show any subscriptions or resource groups.
Looking at a Fiddler, I can see Azure return a list of all of my subscriptions, yet Visual Studio does not populate and thinks my credentials are invalid (Fiddler screenshot below)
I had the same problem
In the Acount settings of your visual studio top right..
Delete all acounts an then sign in with the proper azure account.
Then when you go to publish you can add the account
I have experienced exactly what you describe here, however when I ensured that I was connected to Visual Studio using the same account as I wished to publish with, the "reenter credentials" message disappeared.
Go to Options > Accounts,
On the "Add and reauthenticate accounts using:" field select Device code .
Login in the browser with the provided code and then you are able to publish without re-entering credentials.
I had this issue with visual studio 2019, my Microsoft account was linked with my gitHub account. I unlinked my github account by logging into my windows account going into security and unlinking the account
Same issue here with VS 2019 and 2022 (preview), but the account settings in Visual Studio only showed my 'Home Organization'. Deleting and re-adding didn't help.
Finally, I fixed it by removing an external organization that I was a member of from my account.
Go to https://myaccount.microsoft.com and login. On the left panel, select Organizations and delete all, except your Home Organization.
Of course, if you actually need the external organization(s), this isn't going to help you.

This account has no subscription - Publishing to Azure from Visual Studio

Earlier this year I successfully deployed a MVC app to Azure from Visual Studio.
Now I'm trying to do the same thing again, but now I am told my azure account "has no subscription".
However I am 100% positive I do have a subscription associated with my email. My old MVC app still runs and I can see my Pay-as-you-go is properly charged.
What I Have tried to fix it
Emptied my browser caches, history, cookies etc.
Removed my account from Visual Studio, restarted, and added them again.
Formatted my computer and reinstalled everything (not really because of this problem, but the timing was perfect).
Updated the Azure SDK to the newest 2.9.5.
I did the following things above based on advice from these pages:
Visual Studio not finding my Azure subscriptions
Unable to publish to Azure with VS2015
No subscription found in windows azure account
But alas, no luck.
The only thing that comes to thought is I tried to add an Azure Pass to my account, but without luck. But I can't see how that should change anything...
So my question is: How do I make Visual Studio recognize my current Pay-as-you-go subscription, so I can publish my services, apps, etc. from Visual Studio directly?
Or at least: What has gone wrong? Whom can I contact to get help with this?
As always, thank you for your time and patience, and please write a comment if you need further information.
You may try to connect first via the server explorer (ctrl+alt+s). (The server explorer has an azure root node, if the azure sdk installed)
If you have connected, the publish wizard won't ask (usually) for sign in again.
In my case, the solution was as follows:
Open Server Explorer in Visual Studio, right-click on Azure and select "Manage and filter subscriptions":
Screenshot of Manage Subscriptions Dialog
Click the Certificates tab, click Import, then click Download subscription file. This will take you to the azure portal page where you can download a .publishsettings file for your subscription. After downloading that file, click the Browse button in the Import dialog shown above and select that file.
I had the same issue. To solve it I opened the server explorer (ctrl+alt+s) and refreshed the Azure connection. It still said 0 subscriptions, but in the publishing options I could connect without any issue.

TFS in Visual Studio 2012 under Windows 8

I'm having trouble connecting to the hosted Team Foundation Service using Visual Studio 2012 RC.
Upon my first connect, a window was opened prompting me for my username and password, however I was added to TFS with a different Live ID. I've re-registered a new Live ID and now I can't get access to TFS. When I try to do so, I get this error:
TF31003
If you log out from All Live accounts in your Browser's and then try logging into TFS again you should be prompted for the credentials and you can login with the account that has access to TFS Preview.
I got the tf31003 error while trying to connect to a hosted TFS at https://mycompanyname.visualstudio.com/
I could access the site using my Live Id through Firefox but when trying to connect using VS 2010 I was getting that error.
The issue with my case was that VS2010 was trying to login using Internet Explorer which I was signed in under a different account. To solve this I opened Internet Explorer and logout from Hotmail/Live and went to the about URL and connected to the TFS instance, which connected successfully.
After that I went back to VS 2010 and tried to connect to the server again, this time I was shown the Login window where I was able to enter my login details. Once done my server was successfully added to the 'Team Server Foundation list' and was able to get the list of all my projects.
I had the same problem, except I am running VS2012 Update 2. This is overboard, but this is a thorough list of everything I did that eventually fixed it.
Ensured Visual Studio was not running
I opened Internet Explorer, pressed CTRL+SHFT+DEL, selected everything and clicked "Delete"
I opened Fiddler and navigated to "Tools > Clear WinINET Cache" and "Tools > Clear WinINET Cookies"
I opened the windows Credential Manager and removed all entries (including all Web Credentials, Windows Credentials, and Generic Credentials)
I disconnected my Microsofot account from my Windows account
Opened Visual Studio and connected to TFS, and it finally prompted me to login
Again, this is overboard, and not very surgical, but as I was in a hurry, so I decided to take the shotgun run, and it worked.
I had the same issue, the simplest solution I got was to delete just three cookies.
I found this recommendation in other post. It worked for me.
cookie:*#login.live.com/
cookie:*#visualstudio.com/
cookie:*#tfs.app.visualstudio.com/
To see the cookie files directly so to "Internet Options -> In the Browsing History Section Click "Settings" -> Click "View Files" -> They are all text files.
I received this same error (TF31003 / TF30063) when setting up a new TFS Build Server on Windows Server 2012 because Active Scripting was not enabled in IE.
In order to login - you must enable active scripting to see the login prompt below...
I actually discovered this after installing Visual Studio where the popup dialog specifically informs you of this required setting. Hopefully this will save sometime hours of lost time...

Resources