If you are already using Visual Studio Team Services (or VSTS) for your Source code management you can setup a Build Agent to create automated build.
In this blog I will try and explain how.
Starting from a freshly installed Windows 2016 Server (Nothing else installed) log into your Team Project and click the settings
Than select “Agent Queues”
An option to download the Agent will now show.
Download the Agent
Now install the agent by following the instructions
A few things to know and find before you do the install.
You will need a token which you can find by clicking on you picture
Followed by Clicking on Security
Now click Add and create a new Token.
Make sure you save the token value in a safe space as you will not be able to see it again.
This is it. If you followed the instructions you should now have a working Build Agent installed on your build machine ready to create builds for you on demand.