Use the TeamCity as a CD tool


Is there a way to inject passwords during build to app config files?

- X config files with Y placeholders to be replaced during build
- sensitive information (passwords) must be stored as "password" configuration parameter (not visible)
- amount and names of parameters to replace is unknown (dynamic)

1 comment

Hi! Currently, TeamCity doesn't allow to set the parameter type to password in the build runtime, but this feature request should cover that use case:

In the meantime, it should be technically possible to achieve something like that, although the workaround would be a bit hacky. You can create an auxiliary build configuration that would 1) calculate the number of parameters and their names,
and 2) edit the main build configuration by adding the parameters of the 'password' type (related topic: editing build configurations via REST API). Run the auxiliary configuration each time before running the main configuration (e.g. using a snapshot dependency).


Please sign in to leave a comment.