Why You Should Use a Private VSTS Agent for Your CI Pipeline

get_the_author_meta('user_nicename')

We do a lot of ASP.NET Core projects that get deployed to Azure. Continuous integration and testing is important to us, so using Visual Studio Team Services (VSTS) made sense. For most of our projects, we have check-ins to certain branches of our git repositories automatically triggering publishes to Azure staging environments.

We started off using a hosted agent for our continuous build/release pipeline. Hosted agents are great for basic build scenarios, especially if you don’t need your CI pipeline to run often. However, you are limited to 240 minutes of build time/month, unless you pay for additional hosted agents. As you can imagine this time gets eaten up very quickly if you are checking into triggered branches often. Additionally, the build times are fairly slow (a well-known limitation due to these agents needing to work for everyone).

Our builds include NuGet package restores, the build, running unit tests, and deploying build artifacts. On the hosted agent, build times looked like this:

The build times averaged 6 minutes, sometimes going as high as 9 for a small project. Running 2-3 CI builds/day, this would burn up very quickly.

To get around this, we decided to explore the private agent option. The goals with the private agent were to improve build times, while also not spending too much on hosting it ourselves. Referencing a great post by Peter Hauge, we took the approach of setting up our private agent in a DevTest lab and shut it off at night to save cost.

After switching to the private agent, the results were noticeable:

Now the same builds only take about 100 seconds! The other benefit is we can use as many minutes of build time/month as needed since it’s a private agent.

If you are planning on leveraging VSTS for CI, I’d highly recommend setting up your own private agent. The benefits are immediately visible and will only improve in the long term as additional build pipelines are set up.


Are you using the right password manager for your agency?

ElePass is a password management solution built for agencies – developed by DevSquared. With security as the backbone, we built ElePass to drive agencies towards a more secure environment and to ensure your clients can trust you with their accounts. Check out some of the features of ElePass and  give it a try today!