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.

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.

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/<version>/docker". In this folder, you will find a file named "Dockerfile" and a file named "appsettings.Default.json". Make a copy of the appsettings.Default.json file and name it appsettings.json.

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=<username>;Password=<password>;Host=<hostname>;Port=<port>;Database=<dbname>;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.

Change the <docker_account_name> and <repository_name> values to your Docker account and private repository name from your Docker Hub account. The tag is optional. For example, you can choose the role of your SAP BTP subaccount, such as development, test, production, or anything else that suits your needs.

Push the Docker image to the hub using the following statement.

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.

The application should start immediately and the output of the cf push command should show the route to the application if everything works fine.