BackendBench
Coffee
Free tool

Spring property โ‡„ environment variable

Turn spring.datasource.url into SPRING_DATASOURCE_URL in bulk, as env lines, Docker flags, Compose or Kubernetes, and flag the secrets.

Result

Spring properties in containers

Spring Boot applications are configured with application.properties or application.yml, but containers are configured with environment variables. Boot bridges the two with relaxed binding: an environment variable named SPRING_DATASOURCE_URL sets spring.datasource.url. The rules are simple but easy to forget, particularly for kebab-case names and lists, and a wrong name fails silently because Spring just ignores variables it does not recognise.

Paste a properties file or simple YAML on the left and pick an output: a plain env file, docker run -e flags, a Docker Compose environment list, or Kubernetes env entries. The tool applies the binding rules to every key and warns about any key that looks like a secret so you can move it to a Secret instead of committing it.

Reading it the other way

The second tab turns an environment variable name back into the property it controls. This direction is lossy: SPRING_MAIN_LOGSTARTUPINFO becomes spring.main.logstartupinfo, because dashes and camel case were discarded. Spring Boot matches the variable to the real property for you, so use the lower-case form only for reading and documentation.

Where this matters

Conversion happens in your browser. Values you paste, including passwords, are not uploaded anywhere.

Frequently asked questions

How does Spring Boot turn a property name into an environment variable?

Replace dots with underscores, remove dashes, and upper-case everything. spring.datasource.url becomes SPRING_DATASOURCE_URL and spring.main.log-startup-info becomes SPRING_MAIN_LOGSTARTUPINFO.

How are list items written?

A numeric index is surrounded by underscores: my.acme[0].other becomes MY_ACME_0_OTHER. The last index in a key has no trailing underscore.

Do environment variables override application.properties?

Yes. In Spring Boot's property source order, OS environment variables win over files packaged inside the jar, and command line arguments win over environment variables.

Should secrets go in plain environment variables?

Prefer a Kubernetes Secret or a secrets manager. The Kubernetes (secrets) output uses secretKeyRef for names that look sensitive, such as password, token or key.

More tools you might need