Team Foundation Server 2010–Integrate With Existing SharePoint 2010 Farm

A company I was working at went to great lengths to set up a nice SharePoint 2010 farm, complete with high availability, disaster recovery and backups.  This is typical for production environments.  What was interesting is that the development team used TFS and because this was not a software shop, they were the red headed stepchild department with a single VM running TFS with SharePoint Portals and Reporting Services.  When you find yourself in that sort of situation, wouldn’t it be nice to be able to move your Portals to the farm and take advantage of the existing infrastructure and of course the extra goodies that come with running Enterprise?  By being able to take advantage of the enterprise features and of course only having to maintain a single farm environment, it makes a compelling argument to move your SharePoint environments to a single farm and frees up resources on your TFS server (It was only allocated 4 GB or RAM and was always running at about 3.9 GB utilization so was rather slow as well).

So where to start?  Well, SharePoint is probably the next biggest memory/CPU hog behind SQL itself.  SQL Database moves are a little more complex, so for a quick win situation I’m only going to lay out how to migrate your Portals to the SharePoint 2010 farm, as this generally can be done between the development team and the SharePoint admins and don’t need to involve DBAs.

There are a number of features and integration points above and beyond a solution file that requires the install from the TFS media, with the main one being the TFS2010 client API. These allow proper integration with the creation and viewing of Work Items from SharePoint, a new feature with TFS 2010. This works in both SharePoint 2007 and SharePoint 2010 with the level of integration dependent on the version of SharePoint that you are running.

There are three levels of integration with “SharePoint Services 3.0” or “SharePoint Foundation 2010” being the lowest. This level only offers reporting services framed integration for reporting along with Work Item Integration and document management. The highest is SharePoint 2010 Enterprise with Excel Services integration providing some lovely dashboards.

The following are the steps which you need to follow to integrate TFS 2010 with SP 2010

Step 1

The Extensions that you need are on the same installation media as the main TFS install and the only difference is the options you pick during the install.

image

This performs a local deploy of 3 .wsp packages as well as the install, which means a couple things:

  1. It must be installed on every server in the farm
  2. Don’t do this during production hours, unless you have a load balanced environment and can take each server off the LB as you perform the install.
  3. You may need to also perform a reboot

Now that we have the TFS 2010 SharePoint Extensions installed on our SharePoint 2010 farm, we’ll need to configure them both so that they will communicate with each other.

Step:2.a

Once SharePoint extensions installed properly you may need to configure SP 2010 Managed Path for TFS 2010. Every install I’ve seen sets up a managed path so that each TFS Collection can be added as a site collection.  THIS IS NOT NECESSARY!  What I like to do is create a web application with a subweb called “projects” and use that instead of the managed path.  The advantage is that all your portal projects now integrate with the out of the box SharePoint navigation, and you can host multiple TFS collections inside of one “Project Portal”.  This approach also works if you don’t want to break out into separate site collections.

However, the reason for the managed path is that Microsoft wants you to create separate site collections for each TFS collection.  In any case, You will need to add all of the users that will be creating Team Projects to be Administrators of this site so that they will not get an error during the Project Creation Wizard. Later, you may also want to customize this as a proper portal to your projects if you are going to be having lots of them, but it is really just a default placeholder so you have a top level site that you can backup and point at.

However, if you feel the need to use a managed path, now is the time to set one up, so go into Central Admin and choose “Manage Web Applications”

image

Highlight the web application that will host your sharepoint TFS portals and click “Managed Paths”

image

And create a managed path with wildcard inclusion of your choice… When I go this route, same as before I generally use something like “projects” or “tfs”.  I know that some guides say to call it “TFS2010”, but I would recommend against tagging the path with any sort of version number.  Remember once you set this up it may exist for years and survive several upgrades.  You want your users/clients not to have to keep changing URLs every time you upgrade your systems.

 

Step 2.b

If your SharePoint web application authenticates with NTLM instead of kerberos you’ll need to perform this step.  While you’re in Central Admin, go ahead and create an ID in the secure store for “TeamFoundationID” and give it the credentials for your TFS service account.  The reason for this will become clear later when we need to access reporting information.  Kerberos uses a ticketing authentication, NTLM doesn’t, so if we’re trying to access backend data we need to be contentious of not violating the double-hop.  By setting up an ID we can have our Excel services workbooks utilize the ID instead of impersonating for the information.

Step 3

Now that you have set up a home for your project sites, it’s time to let TFS know about it.  Log into your TFS server and open Team Foundation Administration Console

Now you need to configure TFS 2010 connection to SP 2010. In order to have you new TFS 2010 Server talk to and create sites in SharePoint 2010 you need to tell the TFS server where to put them. Navigate to the “SharePoint Web Applications” section. Here you click “Add” and enter the details for the Managed path or site location we just created:

image

 

Step 4

Not done yet… TFS knows where to put the new project portals, but we still need to tell SharePoint that TFS has the permission to create the project sites on the farm.  On your SharePoint 2010 farm, remote into any server and open the Team Foundation Server Administration Console and select the “Extensions for SharePoint Products and Technologies” node. Here we need to “grant access” for our TFS 2010 server to create sites. Click the “Grant access” link and fill out the full URL to the TFS (similar to the Notification URL you see on your tfs server admin console when you select the application tier page)

 

image

Step:5

Once we granted access to the URL now we need to configure the Team Foundation Server 2010 Team Project Collection to create new sites in SharePoint 2010. Click the Edit Default Site Location button. Select our web application “Internal SharePoint 2010 Enterprise Farm” which we have given as “friendly name” in Step 3.  If you are using managed paths instead of a projects parent site, you’ll need to set up a default portal location for each collection that will create a longer url, i.e. “projects/TFS Collection”.  Since most places I’ve worked at don’t use more than one collection, I prefer the parent web approach.  Parent web approach also works with multiple collections wither all pointing to the same default location or broken out into separate URLs.

image

Step 6

Now we’re all set to create new Portal sites in the location we specified.  It is worth noting that it will not create portals for existing Team Projects as this process is run during the Team Project Creation wizard.  Why Microsoft didn’t include the option to create a Portal after the project is created I’ll never know…However, if you really need to create a portal site after the project is created:

  1. You have to create a new temporary project with the create portal option selected and create it in the URL you want for your new portal site for an existing project
  2. Now select the project you want to add a portal to from Team Explorer
  3. Right click the project, select Team Project Settings and select Portal Settings.
  4. Check the Enable team project portal checkbox in the popup window
  5. Then click the Configure URL button. In the popup windows that appears enter the url created at the beginning
  6. Once you’ve pointed to the portal site, you can go back into your TFS admin console and delete the project you used to create the portal site

It’s quite a pain, really hope Microsoft looks at updating this so we can enable a project portal without having to create dummy projects.

You have now integrated SharePoint 2010 and Team Foundation Server 2010!  If you have any existing project portals on your TFS server, now is the time to export/import them to your Enterprise Farm.  After migration I would suggest stopping the “Sharepoint – 80” web application on the TFS server and leaving it off for a couple of weeks before removing it and uninstalling SharePoint from the TFS server.

Leave a Reply