0
votes

In Azure deployment pipelines (YAML), I want to perform JSON patching/transforms on an appsettings.json file. (ie the ability to insert/remove sections of a JSON file, not just variable substitution). The only task I can find that even remotely entertains this concept is the task:FileTranform@2 Unfortunately for JSON files, it only performs variable substitution, not transforms. (It does mention it will transform XML)

What options exist then to transform/patch JSON files in the deployment pipeline phase?

1

1 Answers

1
votes

What options exist then to transform/patch JSON files in the deployment pipeline phase?

There is no built-in tasks/extensions can transform json files directly, but there are two related extensions you can use to patch Json file:

File Patch Build and Release Tasks:

Tasks included:

Patch JSON Files: Patch JSON files using JSON patch syntax

Magic Chunks