Installation on SAP BTP (Connect 2024)
The Connect Server can be hosted on a SAP BTP Cloud Foundry environment. This chapter describes the procedure how to deploy the Connect Server on SAP BTP.
You can either create your own image and save it in a private Docker repository or obtain the current standard image from a Docker repository from Galileo Group AG.
- Custom image on a private docker repository
- Create a new PostgreSQL instance
- Create a Service Key
- Configure the application settings and build a docker image
- Deploy the Connect Server to SAP BTP
- Use the image of the Galileo Group AG Docker Repository
- Bind a database to the application
- Define customer-specific environment variables
Custom image on a private docker repository
As a prerequisite you need at least the version 2022.1.0.1108 of the Connect Server and an account on Docker Hub with a private repository and access to the Docker Desktop Application to be able to build the container. You must also have installed the Cloud Foundry Command Line Interface cf CLI on your local computer. The cf CLI can be downloaded from GitHub.
Create a new PostgreSQL instance
This section assumes that a Space has already been created that is assigned to a Quota Plan.
For hosting a Connect Server on SAP BTP in Cloud Foundry, currently only Postgre SQL is supported for storing persistent data. To create a new PostgreSQL instance, navigate to "Instances and Subscriptions" in your preferred Subaccount.
Click the "Create" button, select "PostgreSQL, hyperscaler option" as your service and "Cloud Foundry" as the runtime environment. Choose an appropriate plan, e.g. the free plan, assign the Space you created earlier and enter the name for the instance, e.g. "connect-postgresql".
On the next screen you can configure the engine version and locale or finish the creation by clicking the "Create" button.
Create a Service Key
After the PostgreSQL instance is created, you can create credentials for database access. To do this, click the Meatballs menu (the icon with three horizontal dots) and select the "Create Service Key" item to open a new dialog. In this dialog you only need to specify the name of the service key. When you are done, close the dialog with the "Create" button.
If the credentials has been created, you can click on the link in the column "Credentials" to look at the details. In the dialog switch to the "Form" tab and note down the following values.
dbname
hostname
port
username
password
Configure the application settings and build a docker image
If you have the credentials for the PostgreSQL database, you need to define a connection string to the database in the application settings.
Unzip the Docker version connect file to a temporary folder and navigate to "/bin/server/
Here you can make the settings of the application according to your wishes. To access the Postgre SQL database from the application, please make the following settings in the "Workspace" section.
Set "PostgreSql" as the value for the "DbType" property.
Set "Database" as the value for the "Provider" property.
In the "DataSource" section, add a new property named "ConnectionString".
Set the "ConnectionString" property to "User ID=
;Password= ;Host= ;Port= ;Database= ;Pooling=true;". Replace the values in <> with the values of the PostgreSQL instance credentials. Optionally, delete the "RootPath" property in the "ConnectObjects" section because it is not needed when objects are stored in a database.
Now, open the Dockerfile and make following adjustments.
Add a # in the first column of line 39.
Remove the relative path in line 55 after "settings=".
Delete the port 443 in line 57.
Now we want to create our Docker image. To do this, let's open a shell and navigate to the folder where the Dockerfile and appsettings.json file are located.
Create the Docker image using the following statement.
Rendering...
Change the
Push the Docker image to the hub using the following statement.
Rendering...
Deploy the Connect Server to SAP BTP
In order to deploy the docker image to SAP BTP open a shell and login to Cloud Foundry using the cf login statement. Then use the following statement to deploy the Docker image to Cloud Foundry.
Rendering...
The application should start immediately and the output of the cf push command should show the route to the application if everything works fine.
Use the image of the Galileo Group AG Docker Repository
As a prerequisite you must have installed the Cloud Foundry Command Line Interface cf CLI. The cf CLI can be downloaded from GitHub.
Deploy the Connect Server to SAP BTP
Open a shell and use the following command to log in to your Cloud Foundry environment on SAP BTP.
Rendering...
The -a parameter specifies the API endpoint of the Cloud Foundry environment. You can find the API endpoint of your SAP BTP sub-account on the overview page of the sub-account in the Cloud Foundry section, see next screenshot.
Once you have successfully logged into your SAP BTP sub-account, use the following instructions to create a new app from an image of the Galileo Group AG Docker repository.
Rendering...
Please replace
Username and password are provided by Galieo Group AG. Please get in touch with your contact person to obtain read-only credentials for the Docker repository.
Bind a database to the application
After the image has been successfully deployed, the application attempts to start, but fails at this point because no information has yet been provided for the database to be used. Stop the application for the time being to set up the database connection.
To set up the database, first navigate to Service Bindings in the navigation area on the left-hand side of the application overview page. Click on the Bind Service button and select Service from the catalog. Click on Next.
On the next screen, search for the PostgreSQL service. Select this service and click Next to continue.
On the next screen, you can either create a new PostgreSQL instance or reuse an existing instance. If you create a new instance, start with 2 GB of storage space. Click Next and then confirm your choices.
If you have decided to create a new instance, the creation process will take some time. Once the database has been bound to the application, you will see a button for displaying sensitive data on the Service bindings page. In the sensitive data you will find the login information for a database user, the name of the database and its host and port.
From the sensitive data, the following information is needed.
username
password
hostname
dbname
port
Define customer-specific environment variables
After the database has been created and bound to the application, the application must know the connection string to the database, which can be realized with customer-specific environment variables.
Open a notepad and prepare a database connection string that should look like this:
Rendering...
Replace the placeholders in the connection string with the values from the sensitive data of the database.
Navigate to User-provided Variables of the application and create the following 3 variables.
DOTNET_Workspace__DataSource__DbType = PostgreSql
DOTNET_Workspace__DataSource__ConnectionString = the prepared connection string.
DOTNET_Workspace__DataSource__DbRole = dbo
After creating the variables, the page should look like the screenshot below.
At this point, everything should be set up to start the application successfully. Go back to the application overview page and click on the Start button.