- Manually, like a regular build configuration.
- Extract from an existing build configuration: there is the Extract template option available from the Actions button at the top right corner of the screen. Note that if you extract a template from a build configuration, the original configuration automatically becomes associated with the newly created template.
When you associate an existing build configuration with a template, the build configuration inherits all the settings defined in the template, and if there's a conflict, the template settings supersede the settings of the build configuration (except dependencies, parameters, and requirements). The settings inherited from a template can be overridden.
You can associate a build configuration to a template only if the template belongs to the current project or one of its parents. A template which has at least one associated build configuration cannot be deleted, the associated build configurations need to be detached first. Since TeamCity 2017.2 you can associate a build configuration with multiple templates.
Text field settings
When you specify some fixed value in a text field of a template, it is inherited as is and cannot be changed in an associated build configuration.
However, in most of the text fields of your template settings (except names (build configuration, parameter, build step), descriptions, agent requirements, typed parameters definitions), you can use a reference to a build parameter instead of the actual value. Thus you can define the actual value of this parameter in each particular associated build configuration separately.
See below for an example of configuration parameters usage.
This way you can create a configuration parameter and then reference it from any build configuration, which has a text field.