Uploading Custom Build Task to TFS 2015
In a previous article I wrote on how to write a custom Task For Visual Studio Team Services, but a usual question is: can I use the same technique to write a task to TFS 2015 on-premise?
Join the DZone community and get the full member experience.Join For Free
the answer is yes, and it is really simple, thanks to this fantastic article by jesse, that explains how to use fiddler to being able to authenticate to on-premise tfs without the hassle of enabling basic authentication . thanks to that article and fiddler, you can simply login from tfx-cli to your tfs 2015 without any problem.
figure 1: login against your local tfs service
once i’m logged in, i can simply use the very same command used for vsts to upload the directory where i defined the build task on my local tfs on-premise server .
figure 2: task was uploaded to the server
as you can see the task was uploaded to the server, exactly in the very same way i uploaded to my vsts account. the task is now available to be used in my tfs.
figure 3: custom task in action in a tfs 2015 on-premise build
thanks to the extensibility with powershell i did not need to care about versions of vsts or tfs, because the script does not have reference on any dll or package and the same task can be used both in vsts or in tfs 2015 without changing a single line .
thanks to the new buidl system, extending a build for both vsts and tfs is now a simple and easy task.
Published at DZone with permission of Ricci Gian Maria, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.