Connection to Your SAP BTP PostgreSQL Database
Install the Cloud Foundry CLI (if needed)
If you don’t already have the cf
CLI on your machine, follow the installers or download a compressed binary from the V8 CLI Installation Guide:
https://github.com/cloudfoundry/cli/wiki/V8-CLI-Installation-Guide#installers-and-compressed-binaries.
Authenticate
Log in to your Cloud Foundry organization via SSO:
cf login --sso -a <CF_API_ENDPOINT>
You can find <CF_API_ENDPOINT>
under Overview of your Subaccount in the BTP cockpit.
Enable SSH on your app
Using the application name defined in your downloaded vars.yml or the whole name of application including postfix of -app then
run:
cf enable-ssh <app-id from vars.yml>-app
Restart the app
Apply the SSH setting by restarting your application:
cf restart <app-id from vars.yml>-app
SSH into the container
Once the app is running again, open a shell on the instance:
cf ssh <app-id from vars.yml>-app
Extract database connection details
Inside the container, run this to print the host, port, username and database name:
echo $VCAP_SERVICES \
| jq -r '.["postgresql-db"][0].credentials
| "REMOTE_HOST=\(.hostname)\nREMOTE_PORT=\(.port)\nDB_USER=\(.username)\nDB_NAME=\(.dbname)"'
Alternatively, you can copy these values directly from your Figaf DB instance in the BTP cockpit.
Connect with psql
Use the values you retrieved to start a PostgreSQL session:
psql -h <REMOTE_HOST> -p <REMOTE_PORT> -U <DB_USER> <DB_NAME>
Related Articles
Unable to start Figaf App because of missing Database
We experienced an issue that the Postgresql figaf-db did not respond when trying to deploy Figaf Tool. Also the Figaf app was crashed because of something. Once we ran CF deploy we got the error For application 'xxx-figaf-app': For service ...
Postgres Database Resources Monitor
Monitoring the health and performance of your PostgreSQL database is not just a technical requirement—it’s an investment in your users’ experience. A well-tuned, responsive database minimizes delays, ensuring smooth interactions, reducing timeouts, ...
Accessing SMTP Server using XOAUTH2 on SAP BTP
1. Cloud Connector Flow 1.1 Define Cloud Connector Mappings Open your Cloud Connector and configure an SMTP connection to your local mail server. Click on Cloud To On-Premise and then click the Add (+) icon to create a new mapping. (screenshot 1) Map ...
Configure SAP Alert Notification service
1. Go to Service Marketplace and find Alert Notification service. 2. Finish installation wizard and create the instance. 3. Go to your alert-notification instance and configure subscriptions. 4. Create conditions based on the resources that interest ...
Connect to SAP Integration Suite /Cloud Foundry
To connect to SAP Cloud Foundry we have enabled a new way of connecting using SAML. This is because the public APIs of SAP Cloud Integration is not as good as the private APIs used in the Web. The guide video that shows how to connect Figaf to an ...