Overriding configuration settings using environment variables
To change a PingFederate server’s configuration, you can use environment variables to override the settings in multiple configuration files instead of modifying those files.
If you use an environment variable to override a configuration file setting, you don’t need to remove the setting from the configuration file. If a setting exists in both a configuration file and an environment variable, the environment variable always takes precendence.
You can use a script or command line to assign values to environment variables. Then when PingFederate starts, it overrides the values in the configuration files with the values of the environment variables. During startup, PingFederate logs all the environment variables that start with "PF_" in the init.log.
You can override any property value in the following files:
<pf_install>/pingfederate/bin/
-
*.properties
<pf_install>/pingfederate/server/default/conf/
-
*.properties -
*.conf
|
The format of an environment variable is PF_<FILE_NAME_WITHOUT_EXTENSION>_<property_name>.
The filename part of the variable is uppercase. The property name part is lowercase and case-sensitive for properties handled by both PingFederate and external libraries like jetty.
Here are some examples of environment variables:
The environment variable for the pf.admin.https.port property in the run.properties file is PF_RUN_pf_admin_https_port.
In a Unix-based environment, the following command sets the value of that environment variable to 9998:
export PF_RUN_pf_admin_https_port=9998
The environment variable for the track.state property in the cluster-adaptive.conf file is PF_CLUSTER_ADAPTIVE_track_state.
In a Unix-based environment, the following command sets the value of that environment variable to false:
export PF_CLUSTER_ADAPTIVE_track_state=false
|
The |
OpenTelemetry environment variables
The process to override configurations using environment variables is different for opentelemetry.properties.
To convert an OpenTelemetry property to an environment variable:
-
Convert the name to uppercase.
-
Replace all
.and-characters with_.
For example, the otel.sdk.disabled property is equivalent to the OTEL_SDK_DISABLED environment variable.
If a property is defined as both a system property and environment variable, the system property takes priority.
You can find the full list of configurable OpenTelemetry properties in the OpenTelemetry SDK documentation.