Using Task Groups in TFS/VSTS

When Microsoft announced Task Groups in TFS and VSTS, I couldn’t think of a practical use for them. When creating build definitions I always try to reduce the number of overall definitions by using prompted variables when possible, this way the user can modify the variable when queuing a build rather than duplicating a definition that has the same steps. Of course this doesn’t work well for things like working directory which warrant a separate build definition. This is where I found Task Groups shine.

When my team started creating microservices the number of build definitions to manage grew exponentially. This was a perfect fit for implementing Task Groups in order to make managing all of these definitions a lot easier. Need to change a build step argument? Update a singleΒ Task Group rather than each build definition. This saves a ton of time.

Here is what an example Task Group looks like:

Use variables wherever the definitions will differ in each build step, then set their values in each build definition. For each Task Group parameter, enter the build variable $(VariableName). That way build definitions can easily be cloned and setup by entering the variable values in the variables tab.

Leave a Reply

Your email address will not be published.