Vqf5mG96cSTT
Vqf5mG96cSTT

Reputation: 2911

Variable substitution in build pipeline

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)?

Update config

Upvotes: 3

Views: 9974

Answers (2)

Vqf5mG96cSTT
Vqf5mG96cSTT

Reputation: 2911

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.

enter image description here

Upvotes: 8

Shayki Abramczyk
Shayki Abramczyk

Reputation: 41755

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.

Upvotes: 4

Related Questions