Set Environment Configuration Properties - BloomReach Experience - Open Source CMS

Set Environment Configuration Properties

Introduction

Goal

Specify environment-specific configuration properties using configuration files.

Background

Applications typically require some environment-specific configuration to operate. For example, credentials or an API key to access a third-party service. In Bloomreach Cloud, you can specify such configuration properties using configuration files containing key-value pairs. The configuration files use the Java properties file format and can be used to specify Java system properties as well.

Create a Configuration File

In a plain text file, specify the key-value pairs in the Java properties file format, e.g.:

foo.service.url=https://example.org/foo/
foo.service.key=ABev2c6Rp5tC1YTYiklHn2hvn54XiZhu3Ce9Wte6

Manage Configuration Files

In Mission Control, navigate to the Files screen and select the Configurations tab:

Use the button in the bottom right corner to upload a configuration file.

Use each configuration file's context menu to rename it or delete it:

Configuration files cannot be replaced. If you upload a configuration file with the same name as a previously uploaded file, Bloomreach Cloud will append a suffix to the file name. For example, blue.properties becomes blue (1).properties.

Deploy Configuration Files with a Distribution

Navigate to the applicable environment and click on Deploy an application (or Redeploy an application).

In addition to selecting the distribution, you can select one or more configuration files to copy. Bloomreach Cloud will set a Java system property brc.appconfigfiles with a comma-separated list of file names as value.

Optionally, you can specify a new name for the configuration file. This is useful in case you manage differently named versions of the properties file but want to be able to always refer to the same file name from the distribution. For example, you could use semantic versioning in the names of the uploaded configuration files (blue.1.0.0.properties, blue.2.0.0.properties, blue.2.0.1.properties, etc.) but always use the same non-versioned name (blue.properties) when deploying in an environment.

You can also select on or more configuration files to use as Java system properties. In this case, Bloomreach Cloud will set a Java system property for each key-value pair in the configuration file(s). You can use the CMS admin panel to see the Java system properties with their values.

Retrieve Environment Name

Use the Java system property brc.environmentname to retrieve the name of an environment in your code.

Specify the Location of a Configuration File as Java System Property

Some use cases require that the location of a configuration file uploaded to Bloomreach Cloud is specified as a Java system property. To achieve this, use the variable ${APP_CONFIG_PATH} as in the following example:

spring.config.location=${APP_CONFIG_PATH}/spring.properties

Bloomreach Cloud will replace the variable with the actual path and pass spring.config.location as Java system property.

End of Q4 2019 (7.15 release) we will introduce a Java system property brc.appconfigpath that like ${APP_CONFIG_PATH} specifies the location of the configuration files.

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?