Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs - configuration reference - environment variables #34366

Merged
merged 1 commit into from
Jun 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions docs/src/main/asciidoc/config-reference.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -58,21 +58,15 @@ the value `youshallnotpass` to the attribute `quarkus.datasource.password`.
* For a runner jar: `export QUARKUS_DATASOURCE_PASSWORD=youshallnotpass ; java -jar target/quarkus-app/quarkus-run.jar`
* For a native executable: `export QUARKUS_DATASOURCE_PASSWORD=youshallnotpass ; ./target/myapp-runner`

[NOTE]
====
Environment variables names follow the conversion rules specified by
link:https://github.com/eclipse/microprofile-config/blob/master/spec/src/main/asciidoc/configsources.asciidoc#default-configsources[MicroProfile Config].

Config searches three environment variables for a given property name (e.g. `foo.BAR.baz`):

- `foo.BAR.baz` - Exact match
- `foo_BAR_baz` - Replace each character that is neither alphanumeric nor `\_` with `_`
- `FOO_BAR_BAZ` - Replace each character that is neither alphanumeric nor `\_` with `_`;
then convert the name to upper case
====

[NOTE]
====
SmallRye Config specifies link:https://smallrye.io/smallrye-config/Main/config/environment-variables/[additional conversion rules].

- A property with double quotes `foo."bar".baz`, replace each character that is neither alphanumeric
Expand All @@ -82,6 +76,8 @@ nor `\_` with `_`: `FOO_BAR_BAZ`
- An indexed property `foo.bar[0]` or `foo.bar[0].baz`, replace each character that is neither alphanumeric
nor `\_` with `_`: `FOO_BAR_0_` or `FOO_BAR_0__BAZ`

[CAUTION]
====
In some situations, looking up the exact property name is impossible. For instance, when looking
up a configuration that is part of a `Map`, and the property name contains a dynamic segment (the `Map` key). In this
case, Quarkus relies upon each source’s list of property names. These must be converted back to their most likely
Expand All @@ -95,6 +91,7 @@ To correctly lookup `Map` properties where `FOO_BAR_BAZ` is the property name an
`foo.bar-baz` in a source with an ordinal lower than the EnvConfigSource (`300`).
====


[[env-file]]
=== `.env` file in the current working directory

Expand Down