Application Lifecycle Management: an introduction for SharePoint people – part 2
Note: this article was originally published in the DIWUG eMagazine, issue #9
This is a follow up post, see part 1
Where to start?
Well, there is only way to go from here…start playing with it! To get your hands on the software you have a couple of options:
Team Foundation Service is Microsoft’s cloud offering for TFS. At the time of this writing, there was no paid plan published yet and parts of it are still beta. It is freely available for up to 5 users and for certain MSDN subscription levels. You will find more details on http://tfs.visualstudio.com/.
Team Foundation Express is part of the Visual Studio Express products and also available up to 5 users. Limited set of features compared to Team Foundation Service and Team Foundation Server, but still loads of enterprise class functionality.
Team Foundation Server is Microsoft’s on premise server product. You can run the software yourself or involve a 3rd party hosting service. See the links at the end of this article for more information.
Setting things up
This is where the fun starts. The process of setting things up is roughly the same for all aforementioned options (as it should be of course). There are however some caveats with the Team Foundation Service online offering, but I will get to those shortly.
Get the bits at http://www.microsoft.com/visualstudio/eng/products/visual-studio-team-foundation-server-express. If you are opting for the Team Foundation Service, you can skip this step. In that case you would just go to http://tfs.visualstudio.com/ and sign up for free.
As with many Microsoft server products, there is a lot to consider installing Team Foundation Server. If you are completely new to TFS, you might want to start with a single server installation. You can install the software on the same server as SharePoint 2013. Just make sure, you skip the installation of SharePoint 2010 Foundation as part of the TFS installation. You can hook up your local SharePoint 2013 instance if you want to make use of the TFS Project Portal integration. See the “TFS 2012 Install and Administration Guides” in the link list at the end of the article for more information.
Team Foundation Server Core Concepts
If you are completely new to Team Foundation Server, you will need to understand some of the core concepts.
- Team Project Collection. Basic container for Team Projects and the first level of isolation. Kind of analogous to a SharePoint Site Collections, this is where global security groups are created. Every TFS 2012 setup at least has one Team Project Collection, called “DefaultCollection” by default.
- Team Project. Container for your project. Holds your source code, work items, build configuration, etc. You need at least one project to be able to work with TFS. There are some considerations to make around your Team Project Scope, but these are beyond the scope of this article.
- Team. Container for your team members. Used for membership, permissions, but also for assigning responsibilities and tasks.
- Process Template. As mentioned earlier, you can select one of the default process templates. This will create the TFS artifacts for you. If you are not sure, which one to choose: Microsoft Visual Studio Scrum should give you enough to play around with.
- Work Items. Again mentioned earlier these are items like Requirements, Bugs, etc.
- Builds/ build definitions. Remember, local builds are plain evil! You need TFS builds to configure and schedule your Team Builds.
Connect to TFS and create your first project
Launch Visual Studio 2012. You can use Visual Studio 2010, but you’ll need to install Service Pack 1 and KB2662296 first. From the menu option “Team”, “Connect to Team Foundation Server” you have the option to enter a Server Name and details:
Here you can enter your server connection details, in this case it is a Team Foundation Service URL.
Next step: create your first TFS Project:
From the menu option “File”, “New” choose “Team Project”. In the case of Team Foundation Service, you will be redirected to your online account to enter the project details. Other cases allow you to enter those details right from within Visual Studio.
If you now connect to your Team Foundation Server, you should be able to select the newly created project.
Adding a Visual Studio solution to Source Control
Once connected you are ready to add your first VS solution and project to TFS. If you create a new project, you have to option to add it to TFS directly: “Add to source control”.
As the solution gets created, you will be asked where to store your solution in TFS. Again, there are many considerations here but for the sake of simplicity you can just store your solution in a Solution folder within your TFS Project.
You can now work with your Solution as you normally would, albeit with a load of TFS features directly at your disposal.
Checking in your changes
Once you are done with your development work, just right click your solution and choose Check In. You will have the option to add comments to your check in (among many other options). This will save all your local modifications to the TFS Server. Other team members will now be able to download and work with those changes.
Configuring a Team Build
From the menu choose “Build”, “New Build Definition”. If you are using the Team Foundation Service the single option we need to change, is on the “Build Defaults” tab. Set the staging location to “Copy build output to the following Source Control folder…..”. This copies the output to a configured Source Control location for easy access.
Once saved, you can queue a new build through “Build”, “Queue New Build”. Once the build is ready, the Source Control folder will contain your build output. Use the Source Control Explorer to navigate to the configured output folder.
Team Foundation Service caveats
There have long been issues with centrally building SharePoint solutions using a Build Server/ Build Controller. Because of the ton of referenced assemblies you (almost) needed SharePoint installed locally on the Build Server. If you use the Team Foundation Service and don’t “bring” your own Build Controller (thus using the Hosted Build Controller), you will almost certainly run into issues building and packaging your SharePoint 2013 Apps. There are several workarounds for these issues, but I will keep those for a separate post.
“TFS 2012 Install and Administration Guides”
TFS 2012 Hosting