-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add or replace element in array of Appsettings.Json on Azure Devops #131
Comments
You should be able to use "my_array/@value" = x. |
I tried to replace something like this Transformation found: IDPClientSettings/Scopes: openid profile offline_access api How can I fix that? Thanks |
This tool from my experience isn't great at changing arrays. Had similar issues and had to get creative with the solution. If you are trying to replace those settings for each environment, my suggestion is to have a Powershell script to blank out each option in the array.
Then with magic chunks insert new array values:
What I found with the arrays is that it does not modify them but add a new entry. So if you went with just trying to modify the first entry in the array with the "IDPClientSettings/Scopes[]`0": "value1" what it would do is add value1 to the end of the array and ignore what was already there resulting in..."openid","profile","offline_access","api","value1". Play with this and see if it helps. |
I am trying to add or replace element in array of Appsettings.Json on Azure Devops release pipeline. I can't find instruction how to do it via magic chunks config transformation.But I know that it is possible after 2.0 version.
How to add or replace element in array for the following code :
{
"my_array" : [
{"value" : 1},
{"value" : 5}
]
}
The text was updated successfully, but these errors were encountered: