When running the modify command to update a property using the anypoint-cli-v4 command-line tool for a CloudHub 2.0 application, the previous properties are being erased and replaced by the new ones.
anypoint-cli-v4 runtime-mgr:application:modify --property name:value
Documentation on the command:
https://docs.mulesoft.com/anypoint-cli/latest/cloudhub2-apps#runtime-mgr-application-modify
Unfortunately, CloudHub 2.0 currently does not support updating properties on top of existing properties during the deployment process. Our product team is actively working to add this feature to the CloudHub 2.0 deployment model. However, there is no ETA for its availability at this moment.
The Anypoint CLI V4 release notes will be updated as soon as this feature is released.
https://docs.mulesoft.com/release-notes/cli/anypoint-platform-cli
As all the properties are being replaced, the recommended workaround is to add all the properties each time, instead of a few of them.
It is recommended to use the AMC Application Manager REST API to execute the PATCH endpoint to update the properties, especially, when the application contains "Protected" properties. This is because, currently, the Anypoint CLI V4 command-line tool erases these secured properties with no option to retain as protected values.
Refer to following article that contains the instructions: CloudHub 2.0 - Add or Update Application Properties using REST API
Create a TXT file containing all the properties for the CloudHub 2.0 application including the new or modified properties and execute the below Anypoint CLI V4 command to apply the properties from this file.
Below is an example for passing a properties file in the "modify" command:
anypoint-cli-v4 runtime-mgr:application:modify <appID> --propertiesFile=/users/testuser/downloads/properties.txt
The properties file should have properties listed in it without any formatting. For example, the properties.txt file only has this in it:
env:dev
name:value
001120993

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.