Buck Hodges

Visual Studio Online, Team Foundation Server, MSDN

Posts
  • Buck Hodges

    How to add licensed users to VS Online via the API

    • 1 Comments

    A while back someone asked a question about how to use the API to add licensed users to a VSO account and change licenses for existing users (instead of the web UI to invite and assign licenses to users). Abhijeet, a dev on my team, gave me some code to get me started, as the identity APIs are not easy to figure out.

    Licensing is different on VSO than it is with Team Foundation Server. With VSO, every user who is added to an account must have a license assigned. We need to be able to add a new user and also to change the license for an existing user. Let’s take a look at how the code to do this works.

    Shared Platform Services

    The first thing to notice is that the code is operating on the account that is stored in what we call Shared Platform Services (SPS). SPS is a core set of services, such as identity, account, and profile, that are used by every service in VSO. The notion of a collection, which is a concept that was introduced in TFS 2010, doesn’t exist in SPS. That’s because not every service in VSO has to have the notion of a collection. Collection is a TFS concept that is used by version control, work item tracking, etc.

    Since we need to make a change to the account, we are going to be talking to SPS. Rather than making calls to https://MyAccount.visualstudio.com as you are used to seeing, we are going to be calling https://MyAccount.vssps.visualstudio.com. The “vssps” part of the URL takes us to SPS, and the account name in the URL gives SPS the context.

    You can see SPS in some scenarios if you watch the address bar in your browser. For example, go to http://visualstudio.com and sign in. Then click on your name to go to your profile page. You will see that the URL is https://app.vssps.visualstudio.com/profile/view?mkt=en-us (or you can directly click that URL). In that context, you are asking SPS for your profile and the list of accounts that you have across the system. SPS is responsible for that information.

    Once we’ve connected to SPS using the same credentials that you normally use as administrator of your account, we get the client representations of the identity and account services in SPS that we’ll use. The next thing we do is to determine if the user is new or an existing user.

    Adding a New User with a License

    New users have to be added to the system. We call that process “bind pending.” What we mean by that is that we will add a reference to a user – nothing but the email address. That email address is not bound to anything. Once a user logs into VSO with an email address that matches a bind-pending entry, we’ll create a full Identity object that references the unique identifier of that user. We’ll also have enter basic info for a profile (e.g., display name) and link that to the identity.

    The Identity API calls for this operation are not at all obvious, and this is something we need to improve. I’ve added a lot of comments to the code to help explain what’s going on. At a high level, we first have to construct a descriptor for this bind pending identity. Each account in VSO is either an MSA-backed account (i.e., it only uses MSAs, also known as LiveIDs) or AAD-backed (i.e., all identities reside in an Azure Active Directory tenant). We make that determination using the properties of the administrative user. Then we first have to add a new user to a group in order for the user to be part of the system – for there to be a reference to the identity. Since every user must have a license, we add the user to the licensed users group.

    Changing the License for an Existing User

    This case is much simpler. If the user is already in the account, the code just makes a call to set the license with licensingClient.AssignEntitlementAsync.

    Notes on Licensing

    The names for the licenses match what you’ll find in our documentation for pricing levels except AccountLicense.Express. That’s the name that the code uses for Basic (at one time it was going to be called Express, and the code didn’t get updated). If you look at the AccountLicense enum, you���ll also find AccountLicense.EarlyAdopter. That was only valid until VSO became GA, so it can no longer be used.

    The MSDN benefits license is different than the other licenses because it is dependent upon a user’s MSDN license level. While you could explicitly set the license to a particular MSDN benefits level, you’d only cause yourself problems. Setting it to MsdnLicense.Eligible as the code does below means that the service will handle setting the user’s MSDN benefits level properly upon logging in.

    The licensing API right now uses an enum rather than a string for the licenses. The result is that AccountLicense.Stakeholder doesn’t exist in the client API prior to Update 4. You’ll see in the code that I commented out Stakeholder so that it builds with Update 3, which is the latest RTM update at the time this post is being written. In the future the API will allow for a string so that as new license types are added the API will still be able to use them.

    There are limits for licenses based on what you have purchased. For example, if you try to add a sixth user licensed for Basic, you will get an error message. Here’s how to add licenses to your VSO account.

    One other thing that I’ll mention is that you may have to search around for the credential dialog prompt. That dialog ends up parented to the desktop, so it’s easy for it to get hidden by another window.

    I’ve attached the VS solution to this blog post, in addition to including the code in the post. I highly recommend downloading the solution, which will build with VS 2013 Update 3 or newer (it may work with earlier versions of 2013, but I didn’t try it).

    Enjoy!

    Follow me on Twitter at twitter.com/tfsbuck

    using System;
    using System.Linq;
    using Microsoft.TeamFoundation;
    using Microsoft.TeamFoundation.Framework.Common;
    using Microsoft.VisualStudio.Services.Client;
    using Microsoft.VisualStudio.Services.Identity;
    using Microsoft.VisualStudio.Services.Identity.Client;
    using Microsoft.VisualStudio.Services.Licensing;
    using Microsoft.VisualStudio.Services.Licensing.Client;
    
    namespace AddUserToAccount
    {
        public class Program
        {
            public static void Main(string[] args)
            {
                if (args.Length == 0)
                {
                    // For ease of running from the debugger, hard-code the account and the email address if not supplied
                    // The account name here is just the name, not the URL.
                    //args = new[] { "Awesome", "example@outlook.com", "basic" };
                }
    
                if (!Init(args))
                {
                    Console.WriteLine("Add a licensed user to a Visual Studio Account");
                    Console.WriteLine("Usage: [accountName] [userEmailAddress] <license>");
                    Console.WriteLine("  accountName - just the name of the account, not the URL");
                    Console.WriteLine("  userEmailAddress - email address of the user to be added");
                    Console.WriteLine("  license - optional license (default is Basic): Basic, Professional, or Advanced");
                    return;
                }
    
                AddUserToAccount();
            }
    
            private static void AddUserToAccount()
            {
                try
                {
                    // Create a connection to the specified account.
                    // If you change the false to true, your credentials will be saved.
                    var creds = new VssClientCredentials(false);
                    var vssConnection = new VssConnection(new Uri(VssAccountUrl), creds);
    
                    // We need the clients for two services: Licensing and Identity
                    var licensingClient = vssConnection.GetClient<LicensingHttpClient>();
                    var identityClient = vssConnection.GetClient<IdentityHttpClient>();
    
                    // The first call is to see if the user already exists in the account.
                    // Since this is the first call to the service, this will trigger the sign-in window to pop up.
                    Console.WriteLine("Sign in as the admin of account {0}. You will see a sign-in window on the desktop.",
                                      VssAccountName);
                    var userIdentity = identityClient.ReadIdentitiesAsync(IdentitySearchFilter.AccountName, 
                                                                          VssUserToAddMailAddress).Result.FirstOrDefault();
    
                    // If the identity is null, this is a user that has not yet been added to the account.
                    // We'll need to add the user as a "bind pending" - meaning that the email address of the identity is 
                    // recorded so that the user can log into the account, but the rest of the details of the identity 
                    // won't be filled in until first login.
                    if (userIdentity == null)
                    {
                        Console.WriteLine("Creating a new identity and adding it to the collection's licensed users group.");
    
                        // We are adding the user to a collection, and at the moment only one collection is supported per
                        // account in VSO.
                        var collectionScope = identityClient.GetScopeAsync("DefaultCollection").Result;
    
                        // First get the descriptor for the licensed users group, which is a well known (built in) group.
                        var licensedUsersGroupDescriptor = new IdentityDescriptor(IdentityConstants.TeamFoundationType, 
                                                                                  GroupWellKnownSidConstants.LicensedUsersGroupSid);
    
                        // Now convert that into the licensed users group descriptor into a collection scope identifier.
                        var identifier = String.Concat(SidIdentityHelper.GetDomainSid(collectionScope.Id),
                                                       SidIdentityHelper.WellKnownSidType,
                                                       licensedUsersGroupDescriptor.Identifier.Substring(SidIdentityHelper.WellKnownSidPrefix.Length));
    
                        // Here we take the string representation and create the strongly-type descriptor
                        var collectionLicensedUsersGroupDescriptor = new IdentityDescriptor(IdentityConstants.TeamFoundationType, 
                                                                                            identifier);
    
    
                        // Get the domain from the user that runs this code. This domain will then be used to construct
                        // the bind-pending identity. The domain is either going to be "Windows Live ID" or the Azure 
                        // Active Directory (AAD) unique identifier, depending on whether the account is connected to
                        // an AAD tenant. Then we'll format this as a UPN string.
                        var currUserIdentity = vssConnection.AuthorizedIdentity.Descriptor;
                        var directory = "Windows Live ID"; // default to an MSA (fka Live ID)
                        if (currUserIdentity.Identifier.Contains('\\'))
                        {
                            // The identifier is domain\userEmailAddress, which is used by AAD-backed accounts.
                            // We'll extract the domain from the admin user.
                            directory = currUserIdentity.Identifier.Split(new char[] { '\\' })[0];
                        }
                        var upnIdentity = string.Format("upn:{0}\\{1}", directory, VssUserToAddMailAddress);
    
                        // Next we'll create the identity descriptor for a new "bind pending" user identity.
                        var newUserDesciptor = new IdentityDescriptor(IdentityConstants.BindPendingIdentityType, 
                                                                      upnIdentity);
    
                        // We are ready to actually create the "bind pending" identity entry. First we have to add the
                        // identity to the collection's licensed users group. Then we'll retrieve the Identity object
                        // for this newly-added user. Without being added to the licensed users group, the identity 
                        // can't exist in the account.
                        bool result = identityClient.AddMemberToGroupAsync(collectionLicensedUsersGroupDescriptor, 
                                                                           newUserDesciptor).Result;
                        userIdentity = identityClient.ReadIdentitiesAsync(IdentitySearchFilter.AccountName, 
                                                                          VssUserToAddMailAddress).Result.FirstOrDefault();
                    }
    
                    Console.WriteLine("Assigning license to user.");
                    var entitlement = licensingClient.AssignEntitlementAsync(userIdentity.Id, VssLicense).Result;
    
                    Console.WriteLine("Success!");
                }
                catch (Exception e)
                {
                    Console.WriteLine("\r\nSomething went wrong...");
                    Console.WriteLine(e.Message);
                    if (e.InnerException != null)
                    {
                        Console.WriteLine(e.InnerException.Message);
                    }
                }
            }
    
            private static bool Init(string[] args)
            {
                if (args == null || args.Length < 2)
                {
                    return false;
                }
    
                if (string.IsNullOrWhiteSpace(args[0]))
                {
                    Console.WriteLine("Error: Invalid accountName");
                    return false;
                }
    
                VssAccountName = args[0];
    
                // We need to talk to SPS in order to add a user and assign a license.
                VssAccountUrl = "https://" + VssAccountName + ".vssps.visualstudio.com/";
    
                if (string.IsNullOrWhiteSpace(args[1]))
                {
                    Console.WriteLine("Error: Invalid userEmailAddress");
                    return false;
                }
    
                VssUserToAddMailAddress = args[1];
    
                VssLicense = AccountLicense.Express; // default to Basic license
                if (args.Length == 3)
                {
                    string license = args[2].ToLowerInvariant();
                    switch (license)
                    {
                        case "basic":
                            VssLicense = AccountLicense.Express;
                            break;
                        case "professional":
                            VssLicense = AccountLicense.Professional;
                            break;
                        case "advanced":
                            VssLicense = AccountLicense.Advanced;
                            break;
                        case "msdn":
                            // When the user logs in, the system will determine the actual MSDN benefits for the user.
                            VssLicense = MsdnLicense.Eligible;
                            break;
                        // Uncomment the code for Stakeholder if you are using VS 2013 Update 4 or newer.
                        //case "Stakeholder":
                        //    VssLicense = AccountLicense.Stakeholder;
                        //    break;
                        default:
                            Console.WriteLine("Error: License must be Basic, Professional, Advanced, or MSDN");
                            //Console.WriteLine("Error: License must be Stakeholder, Basic, Professional, Advanced, or MSDN");
                            return false;
                    }
                }
    
                return true;
            }
    
            public static string VssAccountUrl { get; set; }
            public static string VssAccountName { get; set; }
            public static string VssUserToAddMailAddress { get; set; }
            public static License VssLicense { get; set; }
        }
    }
    
  • Buck Hodges

    How to provide non-admins access to activity and job pages

    • 0 Comments

    When we shipped TFS 2012, we introduced a feature in the web UI that makes it easy to look at the activity and job history. In the post I mentioned that you had to be an admin to be able to see the information. A question about this came up last week, and Sean Lumley, one of the folks who built the feature, pointed out there is a specific permission for this.

    The permission is called Troubleshoot and it is in the Diagnostic security namespace. These are not exposed in the web UI for setting permissions, so you have to use the tfssecurity.exe tool.

    Here’s an example command line that gives a TFS group called “diag test” the permission to see this info. Anyone added to the “diag test” group would then have access to these pages.

    C:\Program Files\Microsoft Team Foundation Server 12.0\Tools>TFSSecurity.exe /a+ Diagnostic Diagnostic Troubleshoot n:"diag test" ALLOW /server:http://server:8080/tfs

    Enjoy!

    Follow me on Twitter at twitter.com/tfsbuck

  • Buck Hodges

    The ALS Ice Bucket Challenge

    • 0 Comments

    Yesterday, Brian took ALS Ice Bucket Challenge after being challenged by both Scott Guthrie and Adam Cogan. Brian then challenged me, James Phillips, and David Treadwell. I didn’t want to turn down a challenge from Brian. I happen to be in Redmond this week, so I thought why not do it with my team here.

    I mentioned it to Jessica, who is my great admin, and she then got a bunch of the DevDiv admins in on it (the level of excitement among the admins was through the roof). My whole day was booked, so I had no idea when I would do this. Then my 2 PM meeting got canceled. It was on!

    Then the admin team sent email to my team to solicit a volunteer to dump the ice bucket on me. That honor went to Sam Nuziale, dev lead working on our integration into the new Azure portal.

    We did it out behind building 18 with a bunch of my team there to take pictures and video. They had the ice and water sitting out for about 15 minutes ahead of time, so it was plenty cold.

    Of course, I named three more people. I’ve challenged Martin Hinshelwood (update: Martin’s video), Munil Shah, and John Cunningham. Let’s see if they’ll take the challenge in the next 24 hours. Good luck!

    Here’s the video: http://vimeo.com/103961763

    And pictures…
    buck_als_ice_bucket1 buck_als_ice_bucket2  
  • Buck Hodges

    Ten years of blogging

    • 3 Comments

    This past week was the tenth anniversary of blogging here. Over that time I’ve written 560 blog posts. There’s clearly been a drop in my blogging frequency, unfortunately, in recent years. I’ve spent more time interacting with folks on Twitter over the last couple of years than on blogging because of the Visual Studio Online service. I started using Twitter to keep an eye on feedback and to look for problems that customers hit that we don’t know about (someday, I’d love that to be zero, but reality is that you can never have enough telemetry).

    I started at Microsoft in 2003, and when I discovered the very open blog policy at Microsoft (basically, use common sense) and that anyone could do it, I decided to give it a try.

    My first couple of posts were random, one on VC++ releasing a toolkit and another about Bill Gates visiting University of Illinois. Then I started writing posts about some of the issues I was working on and later really about how TFS version control worked, how to use the API, etc. It was a great way to get deeper technical information about the product out.

    I quickly found that the more thorough blog posts on technical details generated the most readership and the most responses from people. That feedback was great encouragement to continue to blog. As those of you who maintain blogs know, a good blog post with depth takes some time to write.

    As my role changed over the years, so did my blogging. I spent my first three years at Microsoft as a developer building TFS version control, then two years as dev lead of team build along with web access for part of that time. When I moved to dev manager, that was the start of writing far less code, but I was still contributing code to the product. I wrote at least one feature in every major release of TFS except for the TFS 2013 release. Unfortunately, I haven’t contributed more than fixing a few comments in the last 18 months or so.

    Being the tenth anniversary, I can’t help but look back on my top blog posts as measured by page views. Here are some of the top blog posts.

    • With 8.5% of total page views, my number one blog post was about removing Visual Studio setup projects. That’s certainly not what I would select as my all-time best blog post, but it clearly shows that if you blog about something controversial, it’ll get a lot of traffic. Since we’re on this subject, I’ll point out the new Visual Studio Installer Projects Extension that was released last month that adds support for Visual Studio setup projects in VS 2013.
    • My second most popular post was about the licensing changes we introduced with the TFS 2010 release. That post taught me to be very careful about posting on licensing. The reason is that our licensing is very complicated. It’s why there’s a sizable white paper on licensing that still doesn’t cover everything. What happened was people started posting licensing question (because it’s very confusing, of course). Well, I couldn’t answer many the questions, but I wanted to help people. That meant I was constantly sending questions posted on my blog to the licensing folks. I’I haven’t posted about licensing since then (i.e., blog about what you know).
    • The next couple are about a path already being mapped in a workspace and authentication in web services with HttpWebRequest.
    • The first one from 2012 (all of the others are older) is Visual Studio 2012 features enabled by using a TFS 2012 server. Given that this post has less relevance over time than the others, it’s interesting how popular it was (I don’t have a graph, but I imagine it’s tailed off quite a bit). This is an example of a post that we should have with every release.
    • Skipping to the end of the top ten is how to delete a team project in Visual Studio Online. When we originally released the feature, it was pretty hard to find. Now it is more apparent in the admin experience.

    Thanks for reading and for your comments over the years.

    Follow me on Twitter at twitter.com/tfsbuck

  • Buck Hodges

    Azure Portal Preview and Visual Studio Online: Adding a user

    • 7 Comments

    Today at the Build Conference, we showed a preview of the new Azure Portal, and that includes a preview of deep integration with Visual Studio Online. As with any preview, it has some rough edges and limitations. One of the limitations is that you have to create a new Visual Studio Online account through the new Azure Portal Preview. Your existing account will not work right now. All new accounts created through the new portal will be backed by Azure Active Directory. In the near future we will provide an experience to convert your existing Visual Studio Online account.

    This also means that adding a user is different. I’ll walk you through the current process to get you off and running.

    First, go to http://portal.azure.com to get started.

    image

    Once you sign in, you will see the dashboard.

    image

    In the lower left corner, click New and then click on Team Project.

    image

    Next you will need an Azure subscription.

    image

    Clicking Sign up will take you through the standard Azure subscription sign up process. If you have an MSDN subscription associated with the identity you signed in with, you will be able to choose that.

    Once you have your subscription set up, click on New, Team Project, and fill out the name of the Team Project. Then click on Account, Create New, and enter the name you want to use for your new Visual Studio Online account (ignore skyrise in the screenshot – I created that one earlier). Click OK and then the Create button.

    image

    After a bit, you will have your new team project. At this point, you can start using it.

    image

    Let’s say you want to add another user. Click on your team project’s tile, scroll down, and click on Users.

    image

    Remember how I said that all new Visual Studio Accounts created through the new portal are backed by Azure Active Directory (AAD)? Now we need to set up AAD, as everyone added to your account needs to be in your directory. Click on the Use Active Directory shown under 2 in the screenshot above.

    You can just create a default directory.

    image

    Click on Default Directory. Then click on the Users tab.

    image

    I chose to add someone with a Microsoft Account (MSA, formerly known as a Windows Live ID).

    image

    I chose to add the person as a User (not an admin).

    image

    This MSA identity is now added to my Azure Active Directory. You can now add this identity as you would before. Let’s try it out creating a new identity that exists only in my Azure AD tenant – an Organizational Identity.

    This is where it gets interesting. I don’t need to have this person have or use their personal Microsoft Account. I can create their identity and control the lifetime of that identity. I as an admin can choose to delete that identity – just like I could with Windows Active Directory. Let’s do that.

    image

    image

    image

    I chose to create the temporary password. Remember that – you will need it.

    Now that I have created a new user in my directory, I need to go to my new Visual Studio Account and add the person there. Once you go to <youraccount>.visualstudio.com, click on Users.

    image

    I enter the identity that I created and click “Send Invitation.” Of course, sending an invitation doesn’t make much sense yet for this type of identity, but we’ll get that limitation addressed soon.

    image

    Finally, I need to add my new user to the contributors group for my “Demo” team project. That follows the standard flow to add a team member.

    Now you are ready for that user to log in.

    image

    Now I’m asked to add a real password – follow the standard Azure Active Directory flow for a newly created identity. Once I’m done with that, I have to create a profile on Visual Studio Online (same as all new identities), and then I’m logged in with my newly created identity that exists only in Azure Active Directory.

    image

    This process is more difficult than it should be, and we are working to smooth it out.

    At this point, you now know how to add a user to your new Visual Studio Online account that is using Azure Active Directory.

    Follow me on Twitter at twitter.com/tfsbuck

  • Buck Hodges

    Patch for issue with Visual Studio 2013 Queue Build dialog

    • 7 Comments

    In Visual Studio 2013 and Team Explorer 2013 there is a bug that will cause the “What do you want to build?” combo box to be disabled and the entire Parameters tab to be blank. We have now released a patch to fix this bug: KB 2898341. This bug occurs when using VS or TE 2013 with a TFS 2013 server. We introduced the bug at the very end of the release when we made a performance optimization for builds on the server used by the Developer Division.

    Follow me on Twitter at twitter.com/tfsbuck

  • Buck Hodges

    Visual Studio and Team Explorer 2013 no longer require IE 10 for installation

    • 28 Comments

    When Visual Studio 2013 and Team Explorer 2013 were originally released, the installation process required that Internet Explorer 10 or newer was installed. Today we released updated installers that no longer require IE 10.

    You will get a warning at the beginning of your installation that looks like the screen shot below. For VS 2013 there is a KB article titled Visual Studio 2013: Known issues when IE10 is not installed that describes what the limitations are if you don’t have IE 10 or newer installed (the “some features” link in the dialog takes you to that KB article). The good news is that there aren’t many things that require IE 10.

    TE 2013 will work as you expect without IE 10. There are no limitations for Team Explorer when IE 10 is not installed.

    The updated installers are available from the Visual Studio Download page and from the MSDN subscriber downloads. [Update Nov. 13th: Due to a problem with the update to subscriber downloads, the new bits are only available from the Visual Studio Download page. This will be fixed in the next few days.]

    image

    Follow me on Twitter at http://twitter.com/tfsbuck

  • Buck Hodges

    Updated Team Foundation Server 2013 download addressing web and installation path issues

    • 7 Comments

    Today we have updated the TFS 2013 installation packages both on the web download page and in MSDN subscriber downloads. The reason is that we found two bugs that we wanted to address broadly. We’ve made changes to be able to catch these types of issues in the future.

    Here are details on the two fixes.

    Fixed: Red error box when using Code (version control) in the web UI

    In the case of upgrading from a prior version of TFS to TFS 2013 RTM, you will see a big error box that says “Error in the application” when using the Code section in the web UI (for example, viewing History). The reason is that we had a bug that was introduced shortly before RTM where the version number for the discussion service, which is the back end for the code review feature, is not set correctly (it was left as a 5 and should have been a 6). As a result, what was returned by the server was InvalidServiceVersionException. Users had reported this in a couple of forum threads (here and here) where we had provided a simple SQL script to fix the issue until this updated download was available.

    clip_image001

    For anyone who has the original RTM installed (not the new release mentioned above) and has this issue, the fix from Vladimir will correctly address the issue, or you can contact customer support who will be able to help you. You would need to run this SQL script on each collection database. Please do not modify this SQL script or make any other changes to the TFS databases.

    IF EXISTS ( SELECT *
                FROM    sys.extended_properties
                WHERE   name = 'TFS_SERVICE_LEVEL'
                        AND value = 'Dev12.M53')
       AND
       EXISTS ( SELECT *
                FROM    sys.extended_properties
                WHERE   name = 'TFS_DATABASE_TYPE'
                        AND value = 'Collection')
    BEGIN
        EXEC prc_SetServiceVersion 'Discussion', 6
    END

    Fixed: Unable to install into a custom path

    When you install TFS 2013, you do not have to uninstall TFS 2012 – the installer will take care of it for you and preserve your settings and provides a much better experience for upgrading databases compared to a patch. This was a feature we introduced with TFS 2012 specifically for easy installation of the updates for TFS 2012. There was a bug in the original TFS 2013 RTM release where if your installation for your TFS 2012 installation did not have “11” in the path (for example, d:\tfs) that you would not be able to change path and the installation would leave your TFS inoperable if you went forward with the installation (if this has happened to you, contact customer support, and we’ll get it fixed for you).

    For both of these issues, we have learned from them and now have checks in place to catch them in the future.

    Follow me on Twitter at twitter.com/tfsbuck

  • Buck Hodges

    Git and HTTPS with TFS 2013

    • 0 Comments

    Philip Kelley has written a great blog post that explains using HTTPS with Team Foundation Server 2013. In it he explains basic auth and Windows auth among other things. If you are using a self-signed certificate, the post will tell you how to add it to your client so that git.exe will work.

    Git network operations in Visual Studio 2013

    Visual Studio 2013 includes in-the-box support for Git version control. That support includes the ability to perform Git network operations from inside of Visual Studio, such as cloning a repository, or performing a fetch, push, or pull operation on an existing repository.

    An endpoint for a clone, fetch, push, or pull operation in Git is called a “remote.” Visual Studio 2013’s Git support contains support for remotes using the following protocols.

    more…

  • Buck Hodges

    How to fix an error with the Windows 8.1 upgrade utility

    • 1 Comments

    I had gotten a Windows 8 upgrade key with the purchase of a computer last summer. I hadn’t used it, so I wanted to upgrade a desktop my family uses. I ran the utility WindowsSetupBox.exe that you can download from the Upgrade Windows with only a product key page.

    However, it failed quickly after choosing either to run the upgrade or to download it to media. I didn’t write down the error message, but it wasn’t very descriptive – it just said that something went wrong. It failed so quickly, it seemed like it wasn’t really trying.

    So I downloaded SysInternals’ Process Monitor in order to see which files and registry keys the upgrade utility was using. Scanning through the output, I saw C:\users\<acct>\AppData\Local\Microsoft\WebSetup. I deleted that folder. After that, the upgrade utility started working as expected.

    I noticed the dates on the files were from January, and that’s when I remembered having started to upgrade the computer from Win 7 to 8 and later canceling. Apparently having the old data there was causing the upgrade utility to fail.

    I hope this helps anyone who runs into a similar problem.

  • Buck Hodges

    What’s installed on the build machine in Visual Studio Online?

    • 5 Comments

    If you are using Visual Studio Online and wondering what’s installed on the build machine for your builds to use, we have a list here. Tarun Arora, one of our MVPs, put together a web site that shows a comprehensive list of what’s installed: http://listofsoftwareontfshostedbuildserver.azurewebsites.net/.

    Follow me on Twitter at twitter.com/tfsbuck

  • Buck Hodges

    Team Foundation Service 2013 RC is go-live–use it in production

    • 0 Comments

    Have you upgraded to TFS 2013 RC yet? It’s a supported, “go-live” release that you can use in production. We are using it ourselves in production our biggest internal server (I’ve written about that server before).

    Download TFS 2013 RC and upgrade.

    You can check out what’s new here (hint: the background image at the top of that page shows off the new work item charting feature).

    One thing I want to point out is that Internet Explorer 8 is not supported for TFS 2013. You can use IE 8 (we don’t block it), but you may encounter problems, and the issues will get worse moving forward (i.e., updates to TFS 2013) since we aren’t testing it. Brian announced it back in February here.

    Here are a few reasons you should upgrade.

    Git support – full git support on the server where you can use our git experience built into VS 2013, the add-in for VS 2012, Eclipse, Xcode, Git for Windows, and any other git client you want.

    Coding commenting in the web UI

    Agile portfolio management

    Work item charting

    Team rooms

    Enjoy!

    Follow me on Twitter at twitter.com/tfsbuck

  • Buck Hodges

    How to delete a team project from Team Foundation Service using the web UI

    • 15 Comments

    [Update 18 Nov. 2013] It is now easier to get to the UI to delete a project. Navigate to the home page for your team project, then click on the gear icon in the upper left, and then you can click on the drop down arrow that will show up when you mouse over the name of the team project.

    You now have the ability to delete a team project from TF Service using the web UI rather than the command line (the command line still works, and you can find the instructions here if you need them). Unfortunately, this only applies to the service. In the future, we plan to have both team project creation and deletion be available from the web UI for the on-premises server, but we haven’t gotten to it yet.

    However, it’s a bit hidden. Here’s how to find it. First, go to the project home page for one of your team projects (you’ll need to be an account admin) and click on the gear icon in the upper right. It doesn’t matter at this point which team project you pick. Doing this will open a new tab with the administrative web page in it.

    image

    Next, click on DefaultCollection in the navigation area in the upper left. Doing this will take you to a list of team projects.

    image

    In the list of team projects, you will see a drop down arrow to the left of a team project name when you hover over the name with you mouse. Clicking on that drop down arrow will give you the option to delete the team project. Here I am deleting a team project called Awesome.

    image

    Now you will be presented with a dialog to confirm deletion of the team project. Be sure you really want to delete the entire team project. The code, work items, etc. will all be destroyed on the server. There is no way to recover from this operation (it’s not a soft delete at this point – it’s in our plans for the future). So, be certain you want to delete the team project (and double check that the name in the dialog is the one you want to delete)!

    image

    If you choose to delete the team project, you will see a progress bar. The time to delete a project depends on how large it is. For an empty team project, it will be done in seconds.

    image

    That’s all there is to it. Just be careful that you don’t delete something you care about!

    Follow me on Twitter at twitter.com/tfsbuck

  • Buck Hodges

    Team Foundation Server 2012.2 (aka Update 2) now available

    • 8 Comments

    Today we released the second update for TFS 2012 (TFS, TFS Express). You will find a detailed list of features in this blog post. You need to install the one that matches your installation – full or express. You do not need to uninstall TFS 2012 RTM or TFS 2012 Update 1. Installing TFS 2012.2 will take care of uninstalling your previous TFS 2012 installation and then installing the new version. You also do not need to detach collections or anything else special. As always, you should make a backup of your server prior to upgrade (you do make and test backups regularly, right?).

    In this update, we preserve most of the configuration settings. This was a common complaint in the first update. We have a few more settings to preserve, most notably build machine settings, that we will address in the third update.

    The one feature I want to highlight is the compatibility with TFS 2010 build agents/controllers. I mentioned this in a previous post. This is one of those features that’s incredibly valuable but isn’t obvious – you have to know about it.

    This update process is completely new for the 2012 product cycle, and we learned a lot from our mistakes with the first update. Of course, our testing was even more thorough for this release.

    The biggest change we made was getting more users trying early releases of it. We did this because we realized that some of the issues we had to patch for the first update were due just to the fact that customers exercise the product in different ways, and the combinations are nearly infinite. In a regular major version cycle, we have at least one public “go live” release that is crucial to flushing out bugs. We made CTP3 “go live” for our MVPs. We made CTP4 “go live” for everyone. That helped immensely. Every issue that was reported to us we investigated and fixed.

    Enjoy!

    Follow me on Twitter at http://twitter.com/tfsbuck

  • Buck Hodges

    Using VS 2012 and getting “TF206018: The items could not be…” when creating a project using Git

    • 1 Comments

    If you go to Team Foundation Service, create a new account, and then create a new team project that uses Git, you may receive the following error message when either you try to connect VS 2012 or use the “Open new instance of Visual Studio” from your project’s web page and try to add a new Visual Studio project to source control.

    TF206018: The items could not be added to source control because either no team projects have been set up, or because you do not have permission to access any of the team projects in the current collection.

    If you run into this situation, it is because Visual Studio 2012 does not know how to handle a team project that uses Git. The normal version control entries for the team project are not there, so when VS 2012 asks for $/<your team project>, the server sends back TF206018.

    To fix this, you need to install Update 2 for Visual Studio 2012 and the Visual Studio Tools for Git, as described in the topic Create a new code project.

    When the next major version of Visual Studio ships, the Git support will be built-in.

    Follow me on Twitter at twitter.com/tfsbuck

  • Buck Hodges

    How to see activity and job history in TFS 2012

    • 9 Comments

    [Update 9/15/14] Here you can find permissions for these pages.

    With TFS 2012, we introduced a new feature in the web UI that makes it easy to look at the activity and job history on your TFS 2012 server (this feature was first introduced in 2012 RTM). Before the 2012 release, you would have had to look at things like tbl_Command directly in the database to get this information.

    To see this feature, just go to http://<yourserver>/tfs/_oi if you have admin privileges.

    Grant Holliday has written a great blog post, TFS2012: New tools for TFS Administrators, that walks you through the feature. One thing that I’ll call attention to is for folks not used to looking at the info in tbl_Command, you’ll need to make sure you notice the Execution Count in the web UI, which we use to record a sequence of the same calls without writing a row per call. Grant explains it in his post, but it’s easy to over look.

    Also, if you are interested in what jobs run and when, check out TFS2012: What are all the different Jobs built-in to TFS?

    Here are a couple of screenshots to whet your appetite.

    Screenshot of TFS Activity Log Web Interface

     

    image

    Enjoy!

    Follow me on Twitter at twitter.com/tfsbuck

  • Buck Hodges

    Team Foundation Server 2012 Update 2 supports 2010 Build Agents and Controllers

    • 23 Comments

    [UPDATE 9/26/13] TFS 2013 will include support for both TFS 2010 build agents and controllers and also TFS 2012 build agents and controllers.

    One of the changes we made in TFS 2012 for Update 2 was to support TFS 2010 build agents and controllers. This provides several major benefits. The first is the obvious one of not having to upgrade your build agents and controllers when you upgrade your server to 2012. The second is that you don’t have to alter your custom build WF activities to be built with 2012. The third is that you will still be able to use Windows XP and Windows Server 2003 to run build agents and controllers – OSes that are not supported with the TFS 2012 release. This feature is available in the currently released CTP 4 of Update 2, and the final version of Update 2 will be available shortly.

    Martin Hinshelwood, a Microsoft MVP, has written an extensive blog post about this feature.

    Visual Studio 2012 Update 2 supports 2010 Build Servers

    Did you know that Visual Studio 2012 Update 2 supports 2010 Build Servers? Being able to connect TF Build 2010 Controllers to TFS 2012 is opening up upgrade paths for customers that are currently blocked from upgrading to TFS 2012.

    more…

    Enjoy!

    Follow me on Twitter at twitter.com/tfsbuck

  • Buck Hodges

    OData Service for TFS v2

    • 0 Comments

    Brian Keller has released a beta of the second version of his OData service. We are also working to bring it to TF Service, so stay tuned. Check out the beta and give him feedback!

    OData Service for Team Foundation Server v2

    Today we are releasing the beta of the OData Service for Team Foundation Server v2 along with a sample Windows Store application

    The purpose of this service is to help developers work with data from Team Foundation Server on multiple device types (such as smartphones and tablets) and operating systems. OData provides a great solution for this goal, and has been embraced by numerous developers for building great device-specific applications. OData is accessible from any device and application stack which supports HTTP requests.

    more…

  • Buck Hodges

    New build of git-tf required for use with Team Foundation Service

    • 0 Comments

    Yesterday’s update of Team Foundation Service requires a new build of git-tf, which is now available for download. Using a version of git-tf prior to the update will result in repeated prompts for your password but will never succeed in authenticating.

    Follow me on Twitter at http://twitter.com/tfsbuck

  • Buck Hodges

    How to connect to TF Service without a prompt for LiveID credentials

    • 20 Comments

    Normally when you connect to the Team Foundation Service you are presented with a web page to log in with your Microsoft Account (aka LiveID). When you log in you can choose to have it remember you and you won’t have to enter your Microsoft Account credentials again (unless you don’t log in again for a long time, and then you’ll be prompted again).

    That’s great for humans, but what about an application or another web service that wants to connect? For that the code will need to use “alternate credentials," which you must enable on your account. This is the same setting used to enable basic authentication for git-tf. Then we can write some code to connect to the service with those credentials.

    Longer term, we will have OAuth support available as well, but that’s not ready yet.

    Enabling Alternate Credentials

    You’ll need to first to turn on this feature. First, visit your account or project in a browser, click on your name in the upper right, and then click My Profile.

    myprofile

    On the User Profile dialog, click on the Credentials tab.

    enablecreds

    Now provide a password and save the changes.

    password

    Using Alternate Credentials in code

    Before going further, you’ll need to make sure that you have Update 1 for Visual Studio 2012 or newer installed. That update includes enhancements to the TFS client object model to support alternate credentials.

    The easiest way to get the latest update is either via clicking on the “toast” notification that pops up from the Windows taskbar or in VS going to Tools –> Extensions and Updates…, clicking on Updates followed by Product Updates and installing the latest update. Alternatively, you can download it here.

    You can verify that you have Update 1 (or newer) installed in VS using Help –> About Microsoft Visual Studio.

    vshelp

    Now that we have the credentials turned on, we’ll now use them from a simple console app.

     

    After creating a new console app, add a reference to Microsoft.TeamFoundation.Client.dll, which you will find under v2.0 in ReferenceAssemblies. The client object model for TFS is almost entirely built with .NET 3.5 (CLR 2.0) in order to support running the TFS web parts in SharePoint.

    image

    Here’s the code.

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Text;
    using System.Threading.Tasks;
    
    using Microsoft.TeamFoundation.Client;
    
    namespace ConsoleApplication1
    {
        class Program
        {
            static void Main(string[] args)
            {
                NetworkCredential netCred = new NetworkCredential(
                    "someone@yahoo.com",
                    "password");
                BasicAuthCredential basicCred = new BasicAuthCredential(netCred);
                TfsClientCredentials tfsCred = new TfsClientCredentials(basicCred);
                tfsCred.AllowInteractive = false;
    
                TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(
                    new Uri("https://YourAcct.visualstudio.com/DefaultCollection"),
                    tfsCred);
    
                tpc.Authenticate();
    
                Console.WriteLine(tpc.InstanceId);
            }
        }
    }

    I’ve added two using statements, one for System.Net to pull in NetworkCredential and one for Microsoft.TeamFoundation.Client for the TFS classes we’ll need.

    The first thing we construct is a standard NetworkCredential object with the username (the email address that you use for your Microsoft Account) and the password that you created for alternate credentials. On the TfsClientCredentials object, we set AllowInteractive to false to prevent a prompt dialog being shown if the credentials are invalid.

    In constructing the TfsTeamProjectCollection, we must specify the URL to the collection and the credentials. Note that all connections to accounts in TF Service require https. Currently, there is only one collection per account in TF Service, so it is always DefaultCollection.

    Finally, we call Authenticate() to verify that we have supplied the correct credentials and test that it is working by printing the unique InstanceId of the collection.

    Now the rest of the TFS client object model is available for use with the TF Service from applications that cannot prompt for credentials.

    Enjoy!

    Follow me on Twitter at http://twitter.com/tfsbuck

  • Buck Hodges

    Bing desktop–set your background to the Bing image of the day

    • 1 Comments

    Okay, so this has nothing to do with ALM, but I really like the Bing desktop app for one feature: It sets the desktop background to the Bing image of the day. I used to run this app on Win7 and had missed it since moving to Win8 (I love Win8 and have it running on all my machines). Before the recent update, installing it on Win8 would result in a message telling you to upgrade to Win7. That’s a good reminder to be careful about what you do with version checks in your code.

    After downloading it, I drag it to the top of the screen and change the option to have it only show when I click on it (first option under settings) so that it doesn’t drop down when my mouse moves across the top of the screen.

    image

    Of course my favorite use of the app itself is to find out more about the image by hovering over the “i" button (clicking on it will let you pick a different Bing image). Yes, I do use Bing as my default search engine these days, so I could find this info in the browser as well, but it’s more convenient.

    image

    Enjoy!

  • Buck Hodges

    Extending Team Explorer in Visual Studio 2012

    • 0 Comments

    Today we posted information on how to extend the Team Explorer window in Visual Studio 2012. Check it out!

    Extending Team Explorer in Visual Studio 2012

    Team Explorer in Visual Studio 2012 offers multiple options for extending the user experience. This sample demonstrates several of the extensibility points by adding a new Team Explorer page as well as by placing a new section onto the Pending Changes page.

    Introduction

    Team Explorer in Visual Studio 2012 offers multiple options for extending the user experience.  This sample demonstrates several of the extensibility points by:

    • Adding a new "Recent Changes" Team Explorer page with two sections.
    • Adding a new "Selected File Info" section to the built-in Pending Changes page.
    • Adding a "Recent Changes" navigation link under the Pending Changes navigation item.

    more…

    Follow me on Twitter at http://twitter.com/tfsbuck

  • Buck Hodges

    TFS 2012 Update 1: Permissions lost on attaching a collection

    • 0 Comments

    I just posted on the ALM blog about this issue.

  • Buck Hodges

    Azure SDK 1.8 now available for build in Team Foundation Service

    • 8 Comments

    Brian wrote a post today about the version control web experience changes that were in today’s update. Today’s update also included Azure SDK 1.8 on the build VMs. I’ve seen quite a few folks asking for it, of course.

    One of the questions we get often is why we don’t have X in the build VMs. Some of Brian’s post today touches on that, mostly in the form of the explanation for our lack of support for building Win8 apps. The other issue we have is keeping up with the new releases of SDKs of all sorts. For a few, like the Windows Phone 8 SDK, we’ll time updates of the build VMs to match the announcement. For most, like the Azure SDK, we will have to align it with a sprint deployment. I very much hope that at some point these SDKs are packaged in NuGet so that they can easily be pulled during the build based on whatever version your app requires. Until then, we are responsible for the installation of SDKs in the VM image.

    Follow me on Twitter at http://twitter.com/tfsbuck

  • Buck Hodges

    Doc on unattended configuration of TFS 2012

    • 0 Comments

    TFS 2012 (RTM and newer) added a new tfsconfigure unattend command that supports unattended configuration of the server, build proxy, and SharePoint extensions. There’s now a new whitepaper available that explains it. While the paper is titled Unattended Installation of TFS 2012, it’s really unattended configuration.

    Unattended Installation of TFS 2012

    Introduction

    Unattended install is a feature of Team Foundation Server that lets a user pre-set all configuration parameters for a desired TFS instance in advance. This allows TFS to be configured from start to finish without pausing for input from the Configuration Wizard during the process. Unattended Installation takes place via the command prompt. This paper describes the two commands through which it is performed: Create and Configure.

    Who Should Use Unattended Install?

    This feature is ideal for users who are very familiar with TFS and the configuration process, and whose environment divides TFS functions over many different machines. For example, many large-scale enterprise systems have several servers that are designated to builds. Unattended install allows an administrator to quickly kick off the Team Build installation process on these machines without having to supervise each one independently. Furthermore, since the configuration for each build server will likely be almost or completely identical, it should be easy to set each machine’s configuration parameters quickly.

    Feature Overview

    The unattended install feature can be used to configure all different instance types of TFS. These include: Basic, Standard, AT-Only, Build, Proxy, and SharePoint Extensions. To do this, you must determine in advance how the instance should be configured — usually by creating an .ini file and editing it — and then run the specified configuration in the command prompt. This paper covers both the Create command to make this file and the Configure command to actually run the configuration. It explains the different options, or parameters, for these commands and touches on a few scenarios that unattended install does not support.

    more…

    Follow me at twitter.com/tfsbuck

Page 1 of 23 (564 items) 12345»