-
Notifications
You must be signed in to change notification settings - Fork 20
Credentials in default-env.json #87
Comments
I have the same issue but locally, when checking issue sapmentors/cds-pg#142, the issue is not localhost but the tag relational instead of plain |
Maybe @sjvans can help here. I've worked around this problem by setting the User-Provided Variables CDS_CONFIG to: {
"requires": {
"database": {
"dialect": "plain",
"impl": "cds-pg",
"model": "csn.json",
"credentials": {
"username": "user",
"password": "pass",
"hostname": "host",
"dbname": "db",
"port": "3285",
"uri": "postgres://user:pass@host:3285/db",
"sslcert": "cert",
"sslrootcert": "cert"
}
}
}
} But that is of course not the solution. We either need the SAP BTP PostgreSQL Hyperscaler Service to set the Tag "plain" or that CAP would also search for the tags relational or database that are set in the service binding:
|
OK, thanks to the comment sapmentors/cds-pg#263 (comment) from @sebastianesch regarding the service lookup of CAP I've added:
to main/package.json#L91. I've tested also kind and set it to postgresql-db as this is the label of the service. But that did not produce a match. I think that is a bug in the CAP lookup for services. CC: @sjvans |
At the moment the service from VCAP is only picked up when either the tag is 'db' - as this is the service name from the cds.requires section (which is merged with the cds-pg section) AND/OR 'plain', the dialect from the cds-pg section. You should be able to set the tags for your service instance either in your MTA descriptor or via the CF CLI. |
Hi @sebastianesch thank you for the tip. I've added now
to the PostgreSQL Service section of main/mta.yaml#L113. Now the credential lookup works without any issues. |
Hi @gregorwolf , In my case I am creating the database service using cockpit. In the mta.yaml I am using below code.
How do I update 'plain' service-tags. Can you please help? |
Hi,
I'll try running
npx cds-dbm deploy -create-db --load-via delta
but (in SAP BAS) the default-env.json is not picked up. Here's my file (values replaced)
It tries to connect to localhost...
The text was updated successfully, but these errors were encountered: