Azure DevOps offers a hosted build pool. This pool requires no installation on the customer’s part. If your project only depends on the software installed on our hosted build agents, this is a great way to get started quickly building your project.
We also offer a private agent option. This is where the customer installs the build agent on their own personal machine running Windows, Linux, or macOS. I have even seen the agent installed on a Raspberry Pi. This machine can be anywhere. It could be a physical machine or virtual machine, in your datacenter or in the cloud.
When I mention the private build agent option, to my disbelief, it is often met with concern and negativity. This post offers some food for thought on why you need to rethink the private agent option. You need to stop looking at this as something you have to do and be thankful it is something we allow you to do.
1. Your server can cache dependencies. When you are using the hosted build agent, it will be forced to resolve all your packages upon each build even if they have not changed. When you have a private build agent that is not the case. You can benefit from caching dependencies to greatly speed up your build.
2. You can perform incremental builds. When using the hosted build, all the source for your project must be downloaded. Depending on the size of your code base, this could be a considerable amount of time. Because the code had to be downloaded, no binaries from previous builds will be available on the agent and will required a complete build of the code base even if only a few files were changed. A private agent can use the existing code and binaries to do an incremental build which can reduce your build time drastically.
3. You can build an enormous machine. Your build machine can have the fastest CPU, solid state disk, and tons of memory. This will allow the build to complete in a fraction of the time.
4. You are the only one in line. The queue time for each build be will be greatly reduced because this is a private agent just waiting for you or your team. The queue time is also reduced because the machine does not have to be provisioned. The machine is ready and waiting for build requests.
5. You can install anything you want on it! We do our best to have the latest versions of tools on our hosted build agent. However, if you want to start testing with beta versions of software, that will not be possible on our hosted build agents. It also takes time for us to create new build images when new versions of software are released. With a private agent, you can update it whenever you need to whatever version you desire. Furthermore, there are products you may use that will simply never be installed on a hosted build agent.
6. You can run your agent in interactive mode. Our hosted build agents run as Windows services which prevents them from interacting with the desktop. Therefore, you cannot run UI tests that attempt to start applications on the build agent, such as Coded UI Tests.
7. You can install on Apple OS X. Our hosted pools are Windows and Linux (coming soon) machines only. Therefore, if you want to build for iOS on a Mac, you cannot in our hosted pools.
8. You have unlimited build minutes. With your Azure DevOps account you are allotted a fixed number of free build minutes each month. If you have a very long build, this could result in you having to purchase additional minutes. However, on a private build agent, your builds can take as long as they need at no additional cost.
9. Your first private agent is free. Included with your Azure DevOps account is the right to install a private build agent at no additional cost.
10. You can log into the machine. This might not seem like a big deal while your builds are working, but I find it very useful when trying to troubleshoot a build. When something goes wrong I can log onto the machine and look around to see what is going one. Once I have it working I can then target Hosted Pool with a higher degree of confidence that the build will succeed.
11. You can run as administrator. Depending on what you are trying to do, you might have to run the agent as administrator. That is only possible on a private build agent.
12. You can produce builds of any size. Some projects produce a large amount of output. If your output is greater than 10 GB you cannot run that build on the Hosted pool.
For the reasons listed above, I almost exclusively use private build agents. The installation of the agent is as simple as running a script, and the power and control it offers more than outweighs the occasional need to install updates and reboot the machine.