There are tons of resources online on how to replace JSON configuration files in a release pipeline like this one. I configured this. It works. However, we have multiple integration tests which reach the database too. These tests are run during build time. I haven't seen any option yet to replace config values in the build pipeline. Does it exist? Or do I really have to use this custom task (see screenshot below)?
Asked
Active
Viewed 8,712 times
2 Answers
8
There is an out-of-the-box task since recently by Microsoft. It's called File Transform. It's currently in preview but it works really well! Haven't had any issues whatsoever with it and it works the same as you would configure it in the release pipeline. Would recommend this any day!
Below you can see my configuration.

Vqf5mG96cSTT
- 2,561
- 3
- 22
- 41
4
There is no out-of-the-box task only to replace tokens/values in files (also in the release pipline the task is Azure App Service Deploy and not only for replace json configuration).
You need to use an external extension from here or write a PowerShell script for that.

Shayki Abramczyk
- 36,824
- 16
- 89
- 114
-
As stated above, there is no out-of-the-box way to replace token in files. although it is pretty easy to add this functionality through the marketplace. I personally use these two alot: https://marketplace.visualstudio.com/items?itemName=colinsalmcorner.colinsalmcorner-buildtasks https://marketplace.visualstudio.com/items?itemName=qetza.replacetokens – Remco Brilstra Feb 17 '19 at 16:49