How I use Source Control in the Cloud
Recently I moved the source code for my Team System Café site from TFS on premise to Visual Studio Online. This allowed me to have greater flexibility working on the site from remote locations, enabled me to use continuous deployment at check in, and monitor it’s usage. I now exclusively use VSO for source control, backlog/task/bug/tests management, build services, and continuous integration. Part of my CI build definition is using a continuous delivery model to deploy the binaries to an Azure Website and Azure Virtual Machine.
In addition to the core development features of VSO, I’m using two of the other awesome services; load testing from many points in the world and Application Insights. Load testing allows me to quickly get started without the headaches of setting up my own test rig infrastructure. I use Application Insights to monitor my website to make sure it’s available, performant, and track customer usage. One really helpful piece of the availability metrics is that it uses Azures points of presence across the globe from up to 16 points. I also can monitor the performance of the server that hosts the site on things like CPU usage, network utilization, memory, response time, and events. And last but not least, I get many useful stats on customer usage of this site, such as operating systems, browsers, resolutions, country, languages, and network speed.
What is Visual Studio Online?
Visual Studio Online is a set of development services and offerings that’s closely integrated with Microsoft Azure. With Visual Studio Online, we are extending development tools with services. The Visual Studio IDE combined with those services will provide an incredible experience, but the services can be used separately or from other development tools such as Eclipse. Adding services allowed other possibilities to make every task involved in the development process easier besides just source control:
- Coding – connect it to the information you need from the cloud.
- Work - helping teams be agile and lower the friction to embrace ALM.
- Build - removing the need of any local infrastructure to perform continuous builds.
- Test - dramatically reducing the investments needed for complex scenarios such as load testing by using the limitless scale of Microsoft Azure.
- Deploy - to continuously integrate development and operations (also known as DevOps). Visual Studio Online and Microsoft Azure combined, enable agile operations closely integrated with development, so you can embrace a rapid delivery cadence.
- Application Insights - Visual Studio Online Application Insights provides a 360 degree view of your applications, empowering you to pro-actively monitor that your applications are available and performing as expected, and when they aren’t give you information that helps you to resolve them quickly and continuously improve them. All is this is made possible by collecting rich operational, performance, and customer usage information from your applications whether they run on-premises, in Azure, third-party cloud providers, or a mixture of all three.
What are the major differences between TFS and VSO?
Pros
- Work Item Tracking
- Version Control
- Build Automation
- Agile Product/Project Management
- Test Case Management
- Heterogeneous Development (Eclipse, Git)
Cons
- Data stays outside your network
- No Process Template & Work Item Customizations
- No SharePoint Integration
- No Data Warehouse & Reporting
- No CodeLens Support
- No integration with Active Directory
- No choice in geographic location(data stored in the Chicago datacenter)
- No data export/import
Ok great, so how to get started?
Your Visual Studio Online account gives you a place to store your code, backlog, and other project data with no servers to deploy, configure, or manage. It’s super easy to get started and create your team projects or become a contributor on another team project. It’s very quick to create an account and get started working with your projects. After you create an account you’ll immediately be able to setup code, collaborate on code, build code, test code, and deploy your code seamlessly. Visual Studio Online has several plans, Basic, Professional, and Advanced. Basic is completely free, yep FREE, for up to 5 users and allows you to create unlimited team projects, build backlogs, track bugs, create CI builds, and it integrates with Visual Studio and Eclipse. To learn more and get started today, check out Get Started with Visual Studio Online. Also, Compare the differences between the plans at Visual Studio Online User Plans.
What about Git support with TFS/VSO?
Just in case you’re not familiar with Git, it’s a free and open-source Distributed Version Control System (DVCS) developed back in 2005. It’s considered “the SCM” of choice by many people and for good reason. It’s fast, simple, distributed, can support projects of any size and a variety of workflows. When you create a new team project you choose the version control system your team will use in that project: Team Foundation Version Control (TFVC) or Git. Remember when choosing, this is a permanent choice for each team project created. One nice thing is you can mix and match both TFVC and Git team projects in the same team project collection.
When team members are using TFVC they only have one version of each file on their dev machines. Historical data is maintained only on the server. Branches are path-based and created on the server. There are two models enabled, Server Workspaces and Local Workspaces. With server workspaces, most operations require the developer to be connected to the server. With local workspaces, each developer has a copy of the latest version of the codebase and works offline. At check in, any conflicts are resolved by each developer. Git is decentralized and when using Git, each developer has a copy of the entire source repository on their dev machines. Developers commit changes on their machine and can use the version control operations such as history and compare without being connected to the network. At this point, you can quickly share your code and begin collaborating in TFS or on a third-party Git service.
Are there limitations if I start using Git?
Support for centralized (TFVC) or distributed (Git) version control in Team Foundation Server gives your team the flexibility to use the version control technology that works for them. One of the major reasons to use TFS as a Git repository is that it is backed by SQL Server, therefore having the same backend protection as Team Foundation Version Control. One thing to note is, source code cannot be moved from a TFVC repository to a Git repository. Why might you consider using Git? It’s free, it’s distributed, and branching is easy too. It’s fast in that you can do a lot on the client side since you have the entire repository, but it requires the same amount of time to push to the server as TFVC. Another thing to mention is the offline support – which I think is where it can really excel. You can commit a series of changes locally and just push them to the server when you get connected again.
In my current role, I don’t run into very many customers in the Enterprise space that use Git. Git's disconnected story is excellent, but as an enterprise dev I'm usually always connected at work, right? One of the biggest limitations to date using Git is that the functionality of a Code Review request is not supported. The good news is, this is being worked on for future releases. The biggest disadvantage I see with Git is also it’s biggest strength. Since Git pulls down the entire code repository (latest + history), then it can take up a very large amount of disk space. If you are a large team working on larger, enterprise applications, Git’s repo’s could be several GB’s or more after just a year! New team members or new machines will have to wait a long time to download the repo – if it doesn’t just time out! LOL. For more information, please read Which version control should I use? Also check out, Getting Started with Git in Visual Studio and Team Foundation Service.
On-premises TFS vs Visual Studio Online
In my job, customers ask me all the time to explain what Team Foundation Server (TFS) is and why they should use it. So first things first, why TFS? In a nutshell, a goal of Team Foundation Server is to create a central repository with a set of tools that make it really easy to collaborate between all the roles participating on an application development team. A good Application Lifecycle Management (ALM) system has things like source control, work items, and builds all integrated together and linked to provide you as much transparency, traceability, and metrics available about the relationships between the artifacts in those pieces. Team Foundation Server is available in two different forms, On-Premises and On-Line called Visual Studio Online.
Visual Studio Online is a subset of Team Foundation Server. VSO is a cloud service with some of the features of the on premises version of TFS. What’s really cool is that VSO uses the same codebase as TFS with only minor modifications and runs in Microsoft Azure, Microsoft’s Cloud Services. Now a days TFS is pretty easy to install on premise and can be installed in virtual machines or physical hardware in a matter of hours. Visual Studio Online requires no setup and is easy to get stated in minutes. All you need is a login using a Microsoft Account to get started. Note, Active Directory integration will be coming soon, stay tuned.
The biggest difference between VSO and the on premise version of TFS is customization and extensibility. With TFS on premise you can customize the process templates, integrate with SharePoint, Lab Management, SQL Server Reporting Services, BI, and install extra software on the build server. All that being said, keep in mind that VSO is built on Microsoft Azure, therefore it can automatically create scalable build servers when needed. Also, the product group release new features, fixes, and capabilities every 3 weeks, that eventually get added to the on premise version in every quarterly update.
Happy coding...
Feel free to leave me comments at [email protected]
-Randy