Update a specific json object's property with a specified value. You can target nested json objects, and even objects that belong to an array. Available on the Visual Studio Marketplace
Note: SetJsonProperty has been designed to work with Azure DevOps pipelines.
Set your property path
To target the above property
MyProperty and update it's value, you would set
MyProperty as your Property Path.
In the above example, you would target
MyNestedObject.MyProperty You don't have to stop there, you can access properties on objects nested much deeper than that.
Nested objects and arrays
In the above example, let's say you wanted to target the second instance of
Providing a new value
There are a number of ways you can provide a value with which to update your property. You can simply enter a value into the "Property Value" field e.g.
MyNewValue. You can specify an environment variable too, for example your build number
This means you can also access an environment variable that has been set by another task, previously in your pipeline.
Need help setting up
Check out the wiki for more information.
Minimum supported environments
My use case example
I need a version number.
I use BugSnag for logging and alerting me of any errors in my app. One feature of BugSnag is, if I set a version number in my project's
appsettings.json file (.net core app), I can associate errors with a specific app version. So, with that in mind, it would be handy if I could somehow get the current version number of my app and apply it to the BugSnag setting.