Switching to TFS but tired of entering in credentials? Want to just have VS remember your username/pwd? Me too!
Thursday, November 08, 2012 10:51 PM
Are you tired of entering your username/password over and over again with TFS? With the help of two good friends, let’s figure this out, once and for all!
Are starting out with TFS? Or maybe you’re just tired of CONSTANTLY entering your username/password? If you’re like me, YUP! About ready to freak out on VS!!!!! Ok, I asked two good friends, Wes (TFS MVP) and Ahmed (who’s quickly becoming another TFS guru!) about this very same problem, and Ahmed replied with this blog (Team Explorer: Save Codeplex Username and Password).
The crux of this solution is telling Windows about the server and your user credentials,. You do that in Control Panel, User Accounts and Manage Credentials.
Ahmed has done a GREAT job of doc’ing the process, and I’m not trying to repeat him. I’m just looking to add some updates and show what happens when you do like me….and don’t follow instructions THE FIRST TIME. DOH! Oooooor maybe you just got lost in the ambiguous areas…like me, ya, that’s it, that’s the ticket! The ambiguous areas!
Note: You just might want to bookmark or email Ahmed’s webpage to yourself cause I think you’ll be back…more than once…I know I have! Thank you Ahmed, you’ve saved my sanity more than a few times! haha
Ahmed does a great job of showing you how to connect to Codeplex, but what if you’re using the new online version of TFS at Microsoft? COOL! I’m moving away from my SVN server, and trying this online TFS out, so let’s set it up together!
First, let’s fire up IE (or firefox, or opera, or what ever you’re using) and goto Team Foundation Service (http://tfs.visualstudio.com/). If you haven’t done so already, then you might want to sign up for free (NO, I’m not an MS emp, nor am I getting any kickbacks from MS, but if you do sign up, you WILL be doing source code control instead of “hoping” nothing happens to your HD). As of today (11-08-2012) the TFS Service is free for up to five users. (If you want something free but don’t want any restrictions and don’t care about sharing your code, the CodePlex is the place for you, I’m also trying to setup my blog source code there).
NOTE: At this point, if you’re like me you might be wondering WHAT THE HECK IS THE DIFFERENCE BETWEEN TFS ONLINE AND YOUR OWN INTERNAL TFS SERVER AT WORK? Well, first off, the online version at Microsoft, is team foundation SERVICE, and if you have a TFS at work, it’s probably team foundation SERVER….service compared to server. Get it? Ya, close enough to confuse people, and the TLAs are the same too, TFS! (uh, TLA = Three Letter Acronym haha) The other differences are, the SERVICE is “in da cloud” hosted by Microsoft, meaning you have to have an internet connection and always be transferring data, as well as being limited to five users. Contrast that with the SERVER you may have installed at work, is a BIG HONK’N server costing MOOCHA DINERO ($$$$) and you might even have someone babysit that TFS server. DOH! The bonus thing about the SERVICE (online version) is for small company’s or indie devs, it’s a GREAT compromise between costs, network access, security, and most of all, lets you focus on code and not infrastructure of source control!
I used to try to convince local/indie devs to do SOME type of source control! But it’s tough when you don’t have a spare box just sitting around. You also might not want to focus on your own infrastructure, nor want to run an apache/java server (like what SVN server requires). And ZIP just don’t/can’t cut it (sorry John, that was for you haha). The arguments to convince people to do source control with Team Foundation Service just got A WHOLE LOT EASIER to win now!
Ok, now that you’re setup on Team Foundation Service, log in (if not already there), and check out your URL, this is important. You can even cut’n’paste the URL to make sure you don’t mistype it later on. Notice the format eh? “Your_special_name dot VisualStudio dot com”
Next, you’re going to want to tell Windows about the Team Foundation Service’s user creds….one last time(we hope) ! haha Goto Control Panel, then fire up User Accounts.
If you followed along Ahmed’s blog, then chances are you have an entry for Codeplex like below (1) (pay attention to the username naming convention if you’re doing this for the first time, I got tripped up there too). Next, you’ll want to click Add a Windows credential (2) (top right).
Next you’ll be asked to enter in server info as well as user creds. Much like you would expect right? At this point, I would like to suggest you READ the type of URL it’s asking for…
If you’re like me, and didn’t REALLY read, or you did, but figured MS would be smart enough to strip out the extraneous stuff…….nope! DOH!
Close that dlg and strip out the extraneous “stuff” from the url (just delete the https:// that’s all) THEN click OK. DOH! AGAIN?! What? You mean you HAVE to manually strip out the LAST slash too? argh, you’d thi…..ANYWAYS, just do what it asks, we’re nearly done. Once you do that, BINGO, you’re good as gold. UUUUUHHHHH Maybe not! One casualty of this process is this dialog is just accepting the information, it’s not validating it! Ya, if you THOUGHT your username/password were being actually checked/validated……uh no. For that, you’ll have to go into VS to double check you entered it correctly. So let’s go there next.
Fire up VS. I just installed VS2012 recently and am playing around with that. Goto Team….oh, excuse me, TEAM, then Connect to Team Foundation Server… (I have a custom shortcut CTRL+SHIFT+ALT+F5 cause I want to be able to flip between TFS and Codeplex quickly, but you might not have that on your copy of VS since it’s a custom shortcut).
On the next dlg, you'll want to click Servers… , Add… then enter in the exact same URL you entered into the Credentials Manager. Notice at the bottom there is the Preview check that out and you’ll see the fully qualified URL. The trick here is, make sure you select the HTTPS option. Don’t trust me? Try HTTP and OK. Bored yet waiting? Ya, thought so (cause I got impatient too HAHA!). Just click the HTTPS option and then OK.
If you typed out your username/password correctly on the Windows Credentials screen, KUDOS! You should be back to the Add/Remove Team Foundation Server dlg and see the new entry. If you didn’t (like what I just did, DOH!) then you’ll be asked to log in.
hhmm very cool. I just tested this by rebooting, the dlg above asking for the correct username/pwd, looks like it updated the Windows Credentials data as well. Very cool, I had a nasty suspicion it wouldn’t, but it looks like it did, SMART!
Now, when you goto the Connect to Team Foundation Server, you’ll see your new entry and just hit the Connect button.
Then you can start using TFS! Pretty cool. This is a longer post, but I hope you are a bit more comfortable setting this up now that you know where some of the pitfalls are…and how to side step them! Now that you know how to set up your user creds, it’s time to grab a coffee and get coding!
Ahmed Al-Asaad: Team Explorer: Save Codeplex Username and Password
VisualStudioGallery: Team Foundation Server Power Tools (Dec 2011)
PCHenry: Are you constantly asked for your TFS creds? Tired of it? Heres the solution! (blog I wrote in Jan with VS2010 and screen caps from that version too)