Clone build definitions across projects in Visual Studio Team Services

If you find yourself creating build definitions for multiple projects on at least semi regular occasion in Visual Studio Team Services, first have a congratulations.   Take a moment to be grateful in the fact that you have work to do.  You haven’t lost sight of that right?

Second, if your build definitions are mostly the same for each project, you can clone them instead of building them from scratch each time.  Cloning a build definition is easy from within the same team project.  Navigate to the main builds page and click the ellipse menu on the build you want to clone, and select clone.  It will create a new build with the same steps and configuration.

VSTS Build Clone or Export

But how would you do this across projects?  Its Easy with a couple extra steps.  In the same context menu as the clone operation, select export.  This produces a json formatted file download that defines your build.  Next, simply navigate to your other project and click the Import button.  Choose the json file you just downloaded and presto, your new build definition is created.

VSTS Build Import