specify environment variables for conf file in windows cmd

120 Views Asked by At

My application.conf uses environment variables like this

cassandraUri = ${?DB_CASSANDRA_URI}

I am starting my Play application using the .bat file created by sbt dist. I have specified the value of DB_CASSANDRA_URI both in the .bat file and also in cmd.

set "PSK"="mysecret"
set "ALLOWED_NODES"="localhost"
set "DB_CASSANDRA_URI"="localhost"
set "DB_CASSANDRA_PORT"="9042"
set "DB_KEYSPACE_NAME"="ksname"
set "DB_USERNAME"="cassandra"
set "DB_PASSWORD"="cassandra"
set "EMAIL_SERVER"=""
set "EMAIL_USER"=""
set "EMAIL_PASSWORD"=""
set "MOCK_EMAIL"="true"

But the application still can't read the variables.

Am I setting the variables incorrectly? What is the right way?

0

There are 0 best solutions below