---
schema_version: "1"
id: c925b11a8c9d58f2b0024df52cd51b735ba44804d7f8684fd34d8d2e24924c27
title: Changing App Behavior with Properties
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/cloudhub-2/ch2-manage-props.md
canonical_url: https://docs.mulesoft.com/cloudhub-2/ch2-manage-props
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 802d632d4a885a3ec2d542ed0014d52501065e0e4f0812c5db0a91084e977598
description: MuleSoft Documentation Site
latest: true
---
---
product: CloudHub 2.0
---

# Changing App Behavior with Properties

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

You can change the behavior of the app while it’s running using _properties_.

Application properties are variables that act as placeholders in your Mule application and are set
at runtime. When you deploy an application or update an existing application in Runtime Manager,
Mule runtime engine supplies the values for the property variables using the information you
configure on the **Properties** tab.

For example, you can configure a JDBC connector in which the username is set to `${dbUsername}` and
the password is set to `${dbPassword}`. In Runtime Manager, you can set these two properties as
application properties.

For sensitive information, you can protect the property values so that, after you save them in
Runtime Manager, their values aren’t visible in the console or passed between the console and
CloudHub 2.0. For information, see [Protecting App Property Values](https://docs.mulesoft.com/cloudhub-2/ch2-protect-app-props).

You can set properties in either Anypoint Runtime Manager or a properties file. If you set
properties both in the properties file in your application and in Runtime Manager, the values set in
Runtime Manager always override the values in the properties file when your application deploys.

## Add Application Properties in Runtime Manager

The easiest way to load properties to applications deployed to a private space is to define them on
the **Properties** tab for the application.

To add properties:

1.  From Anypoint Platform, select **Runtime Manager** > **Applications**.

2.  Click the app name.

3.  In the navigation menu, click **Settings**.

4.  On the **Settings** page, click the **Properties** tab.

    ![Properties with New Key and New Value fields on the application Settings page](/mulesoft/current/en-us/cloudhub-2/_images/ch2-props-rtm.png)

5.  Click **Table view**.

    Alternatively, you can click **Text view** and enter the key-value pair in the text field in
    this format: `New Key=New Value`.

6.  In the **New Key** field, enter the property name.

7.  In the **New Value** field, enter the property value. If the property value contains spaces,
    enclose it in quotation marks, such as `"ApiKey 898jdey1-13232"`.

    > [!NOTE] If the save password feature of Chrome is enabled and includes a username for
    > `anypoint.mulesoft.com` that matches the contents of the key field, Chrome overwrites the
    > value field with the stored password associated with that username. To work around this
    > limitation, use Chrome in incognito mode or use another browser.

    In **Table view**, if you want to:

    - Hide the value in Runtime Manager, click **Protect** and then click **Protect value** to
      confirm.

      See [Protecting App Property Values](https://docs.mulesoft.com/cloudhub-2/ch2-protect-app-props).

    - Change a key or value, edit the text in the field.

    - Delete a property, click **…​** > **Delete property**.

8.  Click **Apply Changes**.

    Applying changes creates a new configuration and restarts the replicas. For information, see
    [Updating Apps Deployed to CloudHub 2.0](https://docs.mulesoft.com/cloudhub-2/ch2-update-apps).

### Example: Using Properties to Set Environment Variables

You can configure environment variables for your application. Properties enable you to externalize
settings that change depending on the environment you’re deploying to. For example, if you use a
Mule application locally, you might configure your database host to be `0.0.0.0`. If you deploy the
same app to CloudHub 2.0, you might configure the database host to be an Amazon RDS server.

To set an environment variable using an application property:

1.  From Anypoint Platform, select **Runtime Manager** > **Applications**.

2.  Click the app name.

3.  In the navigation menu, click **Settings**.

4.  On the **Settings** page, click the **Properties** tab.

5.  Define the variable by entering it in the **Text view**, in `key=value` format.

    > [!NOTE] In the **Text view**, use the backslash character (`\`) as an escape character. For
    > example, to use `:` in a key or value, use `\:` in the syntax. To use `\` in a key or value,
    > use `\\` in the syntax. **Table view** syntax requires no escape character.

6.  Use the environment variable in your Mule app configuration.

## Add Application Properties Using a Properties File

You can add properties to an app by including a file in the property placeholder YAML file
deployable application archive file.

See [Configuring Properties](https://docs.mulesoft.com/mule-runtime/latest/configuring-properties).

CloudHub 2.0 then loads these properties into the application when the application starts.

Although this method isn’t the best practice on CloudHub 2.0 (because the **Properties** tab values
override any with the same name in the file), you can work around this by changing options in the
Mule app.

> [!NOTE] To mask secure property values on CloudHub 2.0, set property protection on the
> **Properties** tab in Runtime Manager. Because Runtime Manager properties override archive-bundled
> properties of the same name, masking values through `mule-artifact.json` or a configuration file
> doesn’t take effect on CloudHub 2.0. For information, see
> [Protecting App Property Values](https://docs.mulesoft.com/cloudhub-2/ch2-protect-app-props).

To prevent CloudHub 2.0 properties from overriding properties bundled with the deployable archive,
change options in the `property-placeholder` element in the Mule application. For more information
about nondefault property placeholder options, see the
[Spring documentation on Property Placeholder options](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.html).

## Limitations

- You can add up to 300 properties.

- Property keys and their values cannot exceed 1024 characters.

## Reserved Properties

CloudHub 2.0 reserves a set of properties and prevents apps from overwriting the values of those
properties. If an application attempts to assign a value to a reserved property, CloudHub 2.0
doesn’t use the assigned value. Instead, it returns the value as set internally, without throwing an
error or exception, and adds a warning message to the log.

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Property</th><th>Description</th><th>Example</th></tr></thead><tbody><tr><td><div><div><p><code>${java.runtime.name}</code></p></div></div></td><td><div><div><p>JVM name</p></div></div></td><td><div><div><p>OpenJDK Runtime Environment</p></div></div></td></tr><tr><td><div><div><p><code>${java.version}</code></p></div></div></td><td><div><div><p>JVM version</p></div></div></td><td><div><div><p>1.8.0_342</p></div></div></td></tr><tr><td><div><div><p><code>${java.runtime.version}</code></p></div></div></td><td><div><div><p>JVM version, including dot (point) release</p></div></div></td><td><div><div><p>1.8.0_342-8u342-b07-0ubuntu1~20.04-b07</p></div></div></td></tr><tr><td><div><div><p><code>${http.port}</code></p></div></div></td><td><div><div><p>HTTP port</p></div></div></td><td><div><div><p>8081</p></div></div></td></tr><tr><td><div><div><p><code>${https.port}</code></p></div></div></td><td><div><div><p>HTTPS port</p></div></div></td><td><div><div><p>8081</p></div></div></td></tr><tr><td><div><div><p><code>${http.private.port}</code></p></div></div></td><td><div><div><p>HTTP private port</p></div></div></td><td><div><div><p>8081</p></div></div></td></tr><tr><td><div><div><p><code>${https.private.port}</code></p></div></div></td><td><div><div><p>HTTPS private port</p></div></div></td><td><div><div><p>8081</p></div></div></td></tr></tbody></table>

> [!NOTE] For proprietary reasons, MuleSoft doesn’t make public all internal, reserved properties.
> CloudHub 2.0 runtime release updates might change the reserved properties.

## Access Environment and Organization IDs

CloudHub 2.0 provides environment and organization identifiers through environment variables.
Reference these variables to retrieve the deployment environment ID and organization ID.

These environment variables are available:

<table><colgroup><col> <col></colgroup><thead><tr><th>Environment Variable</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p><code>ENV_ID</code></p></div></div></td><td><div><div><p>Environment ID where the application is deployed</p></div></div></td></tr><tr><td><div><div><p><code>ORG_ID</code></p></div></div></td><td><div><div><p>Organization ID (business group ID) associated with the application</p></div></div></td></tr></tbody></table>

To access these values, reference them using the standard property placeholder syntax: `${ENV_ID}`
or `${ORG_ID}`.

## See Also

- [Configuring Properties](https://docs.mulesoft.com/mule-runtime/latest/configuring-properties)

- [Deploying Apps to CloudHub 2.0](https://docs.mulesoft.com/cloudhub-2/ch2-deploy)

- [Protecting App Property Values](https://docs.mulesoft.com/cloudhub-2/ch2-protect-app-props)
