So I have an appsettings.json file in one of my .net core apps, and it has a section of JSON which is an array of unnamed objects, all of which I want to replace the same variable, “minLevel”
Thanks for getting in touch! Octopus expects a zero-based index identifier when replacing objects in a JSON array. So you will need to create two variables to edit the minLevel for both of these nested objects.
Variable
Value
NLog:rules:0:minLevel
NewValue
NLog:rules:1:minLevel
NewValue
Our documentation on structured configuration variables covers this with some example. As a note, I just did a quick test with wildcard indexing and can confirm that it doesn’t work. Hence the need for a unique variable for each index in the array.
Let me know if this helps, and if you have any questions at all, don’t hesitate to ask.