Hi Guys,
I am trying to read connection url environment variable of CF MySql service inside application.conf file like below:
${?cloud.services.dev5.connection.url}
Note: dev5 is my service name.
Problem: It looks like none of the system provided environment variable are being read whereas if I create user provided environment variable then those are getting read.
Any idea what could be an issue?
Thanks!
PS: It is Play framework with Scala trying to connect to MySql CF service.
I am following this article
https://www.playframework.com/documentation/2.6.x/Deploying-CloudFoundry
My CF env output is like below:
“VCAP_SERVICES”: {
“user-provided”: [
{
“binding_name”: null,
“credentials”: {
“uri”: “someurl”
},
“instance_name”: “somename”,
“label”: “user-provided”,
“name”: “somename”,
“syslog_drain_url”: “”,
“tags”: [],
“volume_mounts”: []
}
]
}
}
I have tried below format to read configuration:
slick.dbs.default.db.url = “jdbc:mysql://x.x.x.x:3306/dev5?serverTimezone=UTC” slick.dbs.default.db.user = {?cloud.services.dev5.connection.username} slick.dbs.default.db.password = {?cloud.services.dev5.connection.password}
any help please?