varsub
To variable substitution in json
files, we used the FileTransform
task in our CD pipelines. Unfortunately, it does not allow you to process multiple .zip
files at once. (Although it supports GLOB pattern, but the result of the pattern must be exactly one file)
This is very important to us. And that’s why the varsub
dotnet tool was created.
It is a dotnet tool, so it can be installed as follows:
dotnet tool install -g Kros.VariableSubstitution
If you want to replace the variables in the json
file with environment variables, you can do so with a simple command:
varsub -w d:\Projects\artifacts -j **/appsettings.json
You can find more information about the parameters directly in the repository. Kros-sk/Kros.VariableSubstitution