Question: I have a JSON file that I'd like to "overwrite" with data from another JSON, but keep anything that isn't changed. Is there a way to do this out of the box for Azure DevOps pipeline releases? There is a Config transform plugin thingy for it named [magic-chunks](https://github.com/sergeyzwezdin/magic-chunks), but its syntax is really odd and doesn't work properly if I need to overwrite an array.

Destination (JSON that should be "overwritten")

```json
{
    "AppSettings": {
      "AllowSwaggerRequests": false,
      "Secret": "SomeStuff"
    },
    "Logging": {
      "LogLevel": {
        "Default": "Debug"
      }
    }
}

```

JSON that should be used and added on top of the previous one.

```json
{
    "AppSettings": {
      "AllowSwaggerRequests": true,
      "Secret": "Overwritten"
    },
    "TestProperty": "Hello World"
}

```

Expected result:

```json
{
    "AppSettings": {
        "AllowSwaggerRequests": true,
        "Secret": "Overwritten"
    },
    "Logging": {
        "LogLevel": {
            "Default": "Debug"
        }
    },
    "TestProperty": "Hello World"
}

```

Answer: 
> 
> Overwrite JSON in TFS releases
> 
> 
> 

As I know there's no such task from extensions that can be used to `Overwrite+Add node` at the same time.

One alternative way is to use [PS script to modify the Json content](https://stackoverflow.com/questions/37551366/update-json-file-using-powershell) like what **Krzysztof Madej** suggested below your question. (His answer was deleted hours ago but I don't know why...)

Also you can consider overwriting the whole json file via free [File Creator](https://marketplace.visualstudio.com/items?itemName=eliostruyf.build-task) task. You can define different content here for different stages in your release:

[![enter image description here](https://i.stack.imgur.com/kEF0s.png)](https://i.stack.imgur.com/kEF0s.png)

Just write the content you want it to be, and you don't need to care about the transform syntax. (Enable `Overwrite file if exists`).
This is an X/Y problem. You can specify multiple configuration files for a .NET Core application -- i.e. `appsettings.json` which contains general values and `appsettings.dev.json` that contains environment-specific overrides. Refer to the documentation on configuration.