Help Center/ ServiceStage/ User Guide/ Application Management/ Managing Environment Variables of an Application
Updated on 2025-08-12 GMT+08:00

Managing Environment Variables of an Application

Environment variables of an application are parameters set in the system or user applications. You can obtain the values of environment variables by calling APIs. During deployment, parameters are specified through environment variables instead of in the code, which makes the deployment flexible. Environment variables added to an application are global environment variables and take effect for all application components.

To add environment variables for a specific component:

For details about environment variables of an environment, see Managing Environment Variables of an Environment.

Before using environment variables of an application, add environment variables for the application. You can add environment variables of an application by Manually Adding an Environment Variable or Importing Environment Variables, or Editing an Environment Variable and Deleting an Environment Variable based on service requirements.

Manually Adding an Environment Variable

  1. Log in to ServiceStage.
  2. Choose Application Management.
  3. Click the target application. The Overview page is displayed.
  1. In the left navigation pane, click Environment Variables.
  2. Select a created environment from the drop-down list.

  3. Set the policy for the environment variables to take effect.

    • First Time Effective: The environment variables take effect only when the component is created for the first time. Subsequent modifications to the environment variables will not be synchronized to the existing components of the application.

    • Continuously Effective: The modification of environment variables will be synchronized to the existing components of the application through component upgrade.

  4. Click Add Environment Variable and set Name and Variable/Variable Reference.

    Exercise caution when inputting sensitive information in configuring environment variables, or encrypt sensitive information to avoid information leakage.

    • Name: application environment variable name, which must be unique in the same application environment. Enter 1 to 64 characters. Start with a letter, underscore (_), or hyphen (-). Only use letters, digits, underscores (_), hyphens (-), and periods (.).
    • Variable/Variable Reference: application environment variable value.

    For example, if you set Name to User and Variable/Variable Reference to admin, when the program code reads the User environment variable, admin is obtained. Or, you can start a subprocess or read a file as user admin. The actual execution effect depends on the code.

  5. Click Submit.

    After an environment variable with Continuously Effective selected changes, you can:

Importing Environment Variables

The file must be a key-value pair mapping file in JSON or YAML format. A maximum of 200 environment variables can be imported at a time. Example file content and format:

{"key1": "value1", "key2": "value2"}

  • key1 and key2 are the environment variable names, which must be unique in the same application environment. Enter 1 to 64 characters. Start with a letter, underscore (_), or hyphen (-). Only use letters, digits, underscores (_), hyphens (-), and periods (.).
  • value1 and value2 are the environment variable values.

Exercise caution when inputting sensitive information in configuring environment variables, or encrypt sensitive information to avoid information leakage.

  1. Log in to ServiceStage.
  2. Choose Application Management.
  3. Click the target application. The Overview page is displayed.
  1. In the left navigation pane, click Environment Variables.
  2. Select a created environment from the Environment drop-down list.
  3. Set the policy for the environment variables to take effect.

    • First Time Effective: The environment variables take effect only when the component is created for the first time. Subsequent modifications to the environment variables will not be synchronized to the existing components of the application.

    • Continuously Effective: The modification of environment variables will be synchronized to the existing components of the application through component upgrade.

  4. Click Import and select the created environment variable file.
  5. Click Submit.

    After an environment variable with Continuously Effective selected changes, you can:

Editing an Environment Variable

  1. Log in to ServiceStage.
  2. Choose Application Management.
  3. Click the target application. The Overview page is displayed.
  1. In the left navigation pane, click Environment Variables.
  2. Select a created environment from the Environment drop-down list.
  3. Set the policy for the environment variables to take effect.

    • First Time Effective: The environment variables take effect only when the component is created for the first time. Subsequent modifications to the environment variables will not be synchronized to the existing components of the application.

    • Continuously Effective: The modification of environment variables will be synchronized to the existing components of the application through component upgrade.

  4. Select the target variable and click Edit in the Operation column.
  5. Reset Name and Variable/Variable Reference.

    Exercise caution when inputting sensitive information in configuring environment variables, or encrypt sensitive information to avoid information leakage.

    • Name: environment variable name, which must be unique in the same environment. Enter 1 to 64 characters. Start with a letter, underscore (_), or hyphen (-). Only use letters, digits, underscores (_), hyphens (-), and periods (.).
    • Variable/Variable Reference: environment variable value.

  6. Click Submit.

    After an environment variable with Continuously Effective selected changes, you can:

Deleting an Environment Variable

  1. Log in to ServiceStage.
  2. Choose Application Management.
  3. Click the target application. The Overview page is displayed.
  1. In the left navigation pane, click Environment Variables.
  2. Select a created environment from the Environment drop-down list.

    • Single deletion: Select the target variable and click Delete in the Operation column.
      Figure 1 Single deletion
    • Batch deletion: Select the target variables and click Bulk Delete.
      Figure 2 Batch deletion

  3. In the displayed dialog box, click OK.

    After an environment variable with Continuously Effective selected changes, you can: