configuration
Configuration support
The IDK has a configuration abstraction. This means there are multiple ways to configure properties. The following options are available by default:
- Properties files
- Programmatic maps
- Environment variables (always take precedence)
The properties can be set application-wide, per tenant, or even per principal.
This means you can use a single programmatic map, properties file, and/or environment files. Although not recommended, you can mix and match properties files by providing a programmatic map. Be aware the resolution order is as follows:
- Properties files,
- programmatic maps,
- environment variables.
This means if the same property is found in both a properties file, programmatic map, and environment variable, the latter will take precedence — i.e., environment variables override programmatic maps, which override properties file values.
Environment variables are automatically mapped to the internal property format, which uses dot (.) notation.
For example, the internal property example.subscription.key can be written exactly like that in a properties file or programmatic map.
However, environment variables typically don't support dots,
so you can replace dots with underscores. For example, both example_subscription_key and EXAMPLE_SUBSCRIPTION_KEY will be normalized and correctly mapped to the internal
example.subscription.key.
This allows for a flexible configuration across different sources while maintaining a consistent internal format.