orkungedik/SAP-basis-dataset huggingface dataset:
## 4.1.3.5.1.12.2  Connect an Application to PostgreSQL via TLS Certificate
## Prerequisites
You have a Java application created and deployed in an enterprise (productive) SAP BTP subaccount, in the SAP BTP, Cloud Foundry environment.
##  Note
This scenario is not applicable for SAP BTP trial accounts.
## Context
Use TLS certificates to provide extra security for your Java applications when connecting them to a PostgreSQL database.
The certificate names described below start with "ssl", which is correct as Transport Layer Security (TLS) is the advanced security successor of Secure Sockets Layer (SSL).
## Procedure
1. Create a service instance of PostgreSQL, Hyperscaler Option with plan development . For example, let's create a service instance with name mydb . Run:
2. Bind the new service instance to your application. To do that, add mydb in the manifest.yml file of your application:
3. Add environment parameter USE\_CERTS\_WITH\_POSTGRES in the manifest.yml file. For example, set it to verify-ca :
```
cf create-service postgresql-db development mydb
```
```
---applications: - name: myapp memory: 512M buildpacks: - sap_java_buildpack_jakarta services: - mydb ... env: TARGET_RUNTIME: tomcat
```
```
---
```
```
applications: - name: myapp memory: 512M buildpacks: - sap_java_buildpack_jakarta services: - mydb ... env: USE_CERTS_WITH_POSTGRES: verify-ca TARGET_RUNTIME: tomcat
```
To learn about all possible values, see PostgreSQL: Protection Provided in Different Modes .
4. Before deploying your Java application, build your project again. Run:
5. Deploy your application. Run:
6. Check the contents of VCAP\_SERVICES. Run:
```
mvn clean install
```
```
cf push myapp
```
```
cf env myapp
```
From the output, go to the " postgresql-db " part of the VCAP\_SERVICES section and check which of the following SSL certificates are available:
- sslcert
- sslkey
- sslrootcert
## Example Output:
```
<path>\java-tutorial>cf env myapp ... System-Provided: VCAP_SERVICES: { "postgresql-db": [ { "binding_guid": "123456789-aaaa-1111-cccc-987654321", "binding_name": null, "credentials": { "dbname": "...", "hostname": "...", "password": "...", "port": "1234", "sslcert": "-----BEGIN CERTIFICATE-----\nMIID/zCCAuegAwIBAg... \...UbBiKPA7lVVhre\n-----END CERTIFICATE-----", "sslrootcert": "-----BEGIN CERTIFICATE-----\nMIID/zCCAuegAwIBAg... \...FDQnKF5OxwbAgip42CD
```
In this example, certificates sslcert and sslrootcert are displayed.
7. Check the contents of directory ./postgresql . T o do that:
1. Run: cf ssh myapp
2. Display a detailed directory listing. Run: ll
3. List the contents of the .postgresql directory. Run: cd .postgresql
8. Check which of the corresponding certificate names are listed in the .postgresql directory:
- postgresql.crt
- postgresql.key
- root.crt
 Restriction If you're using GCP , all these certificates are installed by default. If you're using a different IaaS provider (for example, AWS), only the root.crt certificate will be available.
## Related Information
Using Secure Socket Layer (SSL) Encryption for PostgreSQL DB Instances
## 4.1.3.5.1.12.3  Configure a Database Connection for the TomEE Application Container
## Context
##  Note
The examples below refer to TomEE 10 and SAP Java Buildpack 2.
## Procedure
1. Create a resources.xml file.
- If the data source is to be used from a Web application, you have to create the file inside the WEB-INF/ directory.
- If the data source is to be used from Enterprise JavaBeans (EJBs), you have to create the file inside the META-INF/ directory.
The resources.xml file has to be inside the application's WAR file, and has to contain information about the data source to be used.
##  Sample Code resources.xml &lt;?xml version='1.0' encoding='utf-8'?&gt; &lt;resources&gt;
```
<Resource id="jdbc/DefaultDB" provider="xs.openejb:XS Default JDBC Database" type="javax.sql.DataSource" > service=${service_name_for_DefaultDB} </Resource> </resources>
```
2. Add the default keys and their values. You need to include the data source information in directory METAINF/sap\_java\_buildpack/config/resource\_configuration.yml of the WAR file.
- Define a default service name for a Web application:
- Define a default service name for an EJB:
3. Add the key values to be updated. You need to include the data source information to be updated in the manifest.yml file.
- Define the new service name for the look-up of the data source in a Web application:
- Define the new service name for the look-up of the data source in an EJB:
```
 Sample Code resource_configuration.yml ---tomee/webapps/ROOT/WEB-INF/resources.xml: service_name_for_DefaultDB: di-core-hdi
```
```
 Sample Code resource_configuration.yml ---tomee/webapps/ROOT/META-INF/resources.xml: service_name_for_DefaultDB: di-core-hdi
```
```
 Sample Code manifest.yml env: TARGET_RUNTIME: tomee JBP_CONFIG_RESOURCE_CONFIGURATION: "['tomee/webapps/ROOT/WEB-INF/ resources.xml': {'service_name_for_DefaultDB' : 'my-local-di-corehdi'}]"
```
```
 Sample Code manifest.yml env: TARGET_RUNTIME: tomee JBP_CONFIG_RESOURCE_CONFIGURATION: "['tomee/webapps/ROOT/META-INF/ resources.xml':{'service_name_for_DefaultDB' : 'my-local-di-core-hdi'}]"
```
## Results
As a result of this configuration, when the application starts, the com.sap.xs.jdbc.datasource.TomEEDataSourceFactory factory takes the parameters bound to the my-local-dicore-hdi service from the environment, creates a data source, and binds it under jdbc/DefaultDB . The application then uses the Java Naming and Directory Interface (JNDI) to look up how to connect with the database.
## Related Information
SAP HANA HDI Data Source Usage [page 350] Database Connection Configuration Details [page 342]
## 4.1.3.5.1.12.4  Configure a Database Connection for the Tomcat Application Container
## Procedure
1. Create a context.xml file.
This file has to be inside the META\_INF/ folder of the application WAR file, and has to contain information about the data source to be used.
```
 Sample Code context.xml <?xml version='1.0' encoding='utf-8'?> <Context> <Resource name="jdbc/DefaultDB" auth="Container" type="javax.sql.DataSource" factory="com.sap.xs.jdbc.datasource.tomcat.TomcatDataSourceFactory" service="${service_name_for_DefaultDB}"/> </Context>
```
2. Add the default keys and their values. You need to include the data source information in directory METAINF/sap\_java\_buildpack/config/resource\_configuration.yml of the WAR file.
Define a default service name:
<!-- image -->
3. Add the key values to be updated. You need to include the data source information to be updated in the manifest.yml file.
Define the new service name for the look-up of the data source:
<!-- image -->
## Results
When the application starts, the factory named com.sap.xs.jdbc.datasource.TomcatDataSourceFactory takes the parameters bound for service mylocal-core-hdi from the environment, creates a data source, and binds it under jdbc/DefaultDB . The application then uses the Java Naming and Directory Interface (JNDI) to look up how to connect with the database.
## Related Information
Database Connection Configuration Details [page 342]
## 4.1.3.5.1.12.5  SAP HANA HDI Data Source Usage
If you want your Java application to consume SAP HANA Database (for example, to use an HDI container), follow the steps below.
## Procedure
1. Create a service instance for the HDI container, using the cf create-service command.
2. Bind the service instance to a Java application.
```
cf create-service hana hdi-shared my-hdi-container
```
Specify the service instance in the Java application's deployment manifest.yml file.
<!-- image -->
```
- my-hdi-container
```
3. Add a resource reference XML block. Its technical name must be the same as the name of the service instance.
```
 Sample Code <resource-ref> <res-ref-name>jdbc/my-hdi-container</res-ref-name> <res-type>javax.sql.DataSource</res-type> </resource-ref>
```
Add this resource reference to the following files, respectively:
- For Tomcat: web.xml and context.xml
- For TomEE: web.xml and resource.xml
4. Look up the data source in your code.
You can find the reference to the data source in two ways - by using annotations or with JNDI look-up. Add the relevant code to your Java servlet:
- Annotations
- Java Naming and Directory Interface (JNDI) look-up
```
@Resource(name = "jdbc/my-hdi-container") private DataSource ds;
```
```
Context ctx = new InitialContext(); return (DataSource) ctx.lookup("java:comp/env/jdbc/my-hdi-container");
```
## Related Information
```
SAP HDI Containers Set Up a Schema or an HDI Container (Cloud Foundry)
```
## 4.1.3.5.1.13  Dynatrace Integration
Dynatrace OneAgent is a Java agent that sends all captured monitoring data to your Dynatrace monitoring environment for analysis.
## Context
Dynatrace supports full-stack monitoring for Cloud Foundry - from the application to the infrastructure layer. To integrate it with your Java application, follow the steps below.
## Procedure
1. Obtain an environment ID and an API access token .
2. Create a user-provided service.
The service name should contain the string "dynatrace" (for example, dynatraceservice ). The environmentid and apitoken parameters have been generated in the previous step. You also need to set up the apiurl , which depends on the Dynatrace type you want to integrate.
- SaaS Dynatrace
- Managed Dynatrace
```
"apiurl": "https://<environmentid>.live.dynatrace.com/api"
```
```
"apiurl": "https://<your_domain>/e/<environmentid>/api"
```
Then, in cf CLI, run the following command:
```
cf cups dynatraceservice -p "environmentid, apitoken, apiurl"
```
For more information, see:
- Dynatrace Docs: Create a user-provided service in your SAP BTP, Cloud Foundry Environment
- Cloud Foundry Docs: User-Provided Service Instances
3. Bind the application to the service instance created in the previous step, by using the manifest.yml file.
```
 Sample Code ---applications: - name: myapp memory: 1G instances: 1 buildpack: sap_java_buildpack_jakarta services: - dynatraceservice
```
NOTE: If there are more than one Dynatrace services bound to the application, the service that's going to be used is the one that was chronologically bound first.
4. Deploy the application to the SAP BTP, Cloud Foundry environment with the updated manifest.yml file. Run:
```
cf push myapp
```
Once the application receives Web traffic, monitoring data will show up in Dynatrace.
## Related Information
```
Dynatrace Docs: Access tokens API Dynatrace Docs: Cloud Foundry Monitoring
```
## 4.1.3.5.1.14  SAP Connectivity ApiExt
Use the SAP Connectivity ApiExt feature (provided by SAP Java Buildpack) to retrieve destination configurations or authentication headers ready to be used against the remote target system.
<!-- image -->
##  Restriction
SAP Connectivity ApiExt is only available for Tomcat application containers included in SAP Java Buildpack.
Also, Spring Boot works with SAP Connectivity ApiExt only when using WAR deployment.
##  Note
SAP Connectivity ApiExt is not the recommended way for consuming the Destination service as it only covers a subset of the service's APIs. It's primarily meant to be used internally by SAP Java Connector (SAP JCo) and for Neo migration scenarios, where there are limited possibilities to modify the code.
The recommended consumption mechanism for Java applications is SAP Cloud SDK for Java or using the Destination service REST API.
## Prerequisites
To use SAP Connectivity ApiExt during runtime, you first need to create:
- A service instance for the Destination service
- A destination entity in the Destination service that you want to retrieve from the application. See: Managing Destinations
- (Optional) A service instance for the Connectivity service - only needed if you plan to use it for destinations of type ProxyType = OnPremise
## Activate the API
1. Open the pom.xml file of your T omcat-based Java application and add the following dependency:
2. Now open the manifest.yml file and set environment variable USE\_CONNECTIVITY\_APIEXT to true :
```
<dependency> <groupId>com.sap.cloud.connectivity.apiext</groupId> <artifactId>com.sap.cloud.connectivity.apiext</artifactId> <version>${connectivity-apiext.version}</version> <scope>provided</scope> </dependency>
```
```
---applications: - name: <APP_NAME> ... env: TARGET_RUNTIME: tomcat
```
```
USE_CONNECTIVITY_APIEXT: true
```
3. Bind the previously created service instances to your application. To do that, add their names at the end of the manifest.yml file. For example:
```
---applications: - name: <APP_NAME> ... env: TARGET_RUNTIME: tomcat USE_CONNECTIVITY_APIEXT: true services: - my_destination - my_connectivity ...
```
For more information, see ConnectivityConfiguration API: Procedure
## Related Information
```
Create Destinations from Scratch SAP Java Connector [page 354]
```
## 4.1.3.5.1.15  SAP Java Connector
You can use the SAP Java Connector through the SAP Java buildpacks.
## Activation
SAP Java Buildpack (1 and 2) provide an option to use SAP Java Connector (SAP JCo) .
To activate SAP JCo in the buildpack, set the environment variable USE\_JCO to true .
<!-- image -->
The previous method of activating the SAP JCo feature, by defining a service instance for both the connectivity and destination services in the manifest.yml file, has been deprecated and stops working at the end of a transition phase.
The activation of SAP JCo provides all relevant libraries in the application container, so that SAP JCo API can be used. To use SAP JCo during runtime, a destination and an SAP Authorization and Trust Management (XSUAA) service instance are mandatory. Additionally, if you want to set up on-premise connectivity, a connectivity service instance is required.
## Limitations
SAP JCo is only available for the Tomcat-based application containers that are included in the SAP Java buildpacks. Spring Boot applications only work with SAP JCo if you're using WAR deployment.
## Related Information
Invoking ABAP Function Modules via RFC Invoke ABAP Function Modules in On-Premise ABAP Systems
## 4.1.3.5.1.17  Application-Provided Library Components
SAP Java Buildpack can automatically provide JDBC drivers for SAP HANA and PostgreSQL in the classpath if the respective service instance is bound.
The application can also provide its own version of these drivers in the relevant directory:
- WEB-INF/lib - for standard Java applications. It's loaded for all Java buildpacks
- BOOT-INF/lib - for Spring Boot applications. It's only loaded for SAP Java Buildpack 2.
In this case, the application-provided version of the driver will be set in the classpath, not the one that comes with SAP Java Buildpack.
##  Note
When using this mechanism, the application developer is responsible to keep the JDBC drivers up-to-date. Also, note that SAP Java Buildpack will move the JDBC driver from its original location ( WEB-INF/lib or BOOT-INF/lib ) to one of the following:
- META-INF/.sap\_java\_buildpack/hana\_jdbc
- META-INF/.sap\_java\_buildpack/postgresql\_jdbc
If you want to keep the driver in its original location, set up environment variable JBP\_SKIP\_PROVIDED\_LIBRARY\_COMPONENTS. To learn how, see the section below.
The drivers have to follow the respective file name pattern:
- ngdbc*.jar - for SAP HANA Driver
- postgresql*.jar - for PostgreSQL JDBC Driver
## JBP\_SKIP\_PROVIDED\_LIBRARY\_COMPONENTS
If you use environment variable JBP\_SKIP\_PROVIDED\_LIBRARY\_COMPONENTS and set it to true , SAP Java Buildpack will keep the library components in their original location ( WEB-INF/lib or BOOT-INF/lib ).
This way, the new location ( META-INF/.sap\_java\_buildpack/hana\_jdbc or METAINF/.sap\_java\_buildpack/postgresql\_jdbc ) will not be created by the buildpack, nor will be added to the classpath.
## Auxiliary Library Components
The application developer can provide additional components alongside the aforementioned libraries. For example, this can be a custom SSL factory for the PostgreSQL JDBC Driver, which has to be accessible to the class loader that loads the actual library.
To do so, the additional libraries have to be placed in a JAR file in the WEB-INF/lib or BOOT-INF/lib directory. The JAR file has to follow the respective file name pattern:
- sjb-ngdbc-aux*.jar - for SAP HANA Driver
- sjb-postgresql-aux*.jar - for PostgreSQL JDBC Driver
Any number of files following these patterns can be placed in the WEB-INF/lib or BOOT-INF/lib directory and will be handled by SAP Java Buildpack.
<!-- image -->
This mechanism works with both application-provided and buildpack-provided libraries.
## 4.1.3.5.1.18  Bill of Materials (BOM)
For Maven projects, the versions of SAP Java Buildpack dependencies and the APIs provided by supported runtime containers can be consumed through a Bill of Materials (BOM).
The BOM contains the dependencies you can rely on in a runtime environment provided by SAP Java Buildpack. It can also be used to control the versions of a project's dependencies without the need to manually maintain the version of each single artifact.
The BOMs of SAP Java Buildpack are provided through Maven Central .
## Usage
There are two runtimes for which a BOM is provided: Tomcat and TomEE.
The version of the BOM must match the version of the sap\_java\_buildpack or sap\_java\_buildpack\_jakarta you're using. For example, if your application uses sap\_java\_buildpack\_jakarta version 2.24.0, the BOM must be in version 2.24.0 as well.
If you want to use version control, add the desired BOM artifact to your project's pom.xml file in the section dependencyManagement . The following codes are exemplary.
- For Tomcat 10:
- For TomEE 10:
```
... <dependencyManagement> <dependencies> <dependency> <groupId>com.sap.cloud.sjb.cf</groupId> <artifactId>cf-tomcat-bom</artifactId> <version>2.24.0</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> ...
```
```
... <dependencyManagement> <dependencies> <dependency> <groupId>com.sap.cloud.sjb.cf</groupId> <artifactId>cf-tomee-bom</artifactId> <version>2.24.0</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> ...
```
To add the dependencies you want, use groupId and artifactId :
```
... <dependency>
```
```
<groupId>com.sap.cloud.sjb</groupId> <artifactId>xs-env</artifactId> </dependency> <dependency> <groupId>com.sap.cloud.sjb</groupId> <artifactId>xs-user-holder</artifactId> </dependency> <dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-annotations</artifactId> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jul-to-slf4j</artifactId> </dependency> <dependency> <groupId>ch.qos.logback</groupId> <artifactId>logback-access</artifactId> </dependency> ...
```
If you want to have all dependencies in your project, you can add the BOM to your project's section as well. By doing so, you don't need to enumerate single dependency artifacts.
## Related Information
Maven Repository: SAP Java Buildpack BOM
## 4.1.3.5.3.1  Tips and Tricks for Python Applications
Get to know the Python buildpack for the SAP BTP, Cloud Foundry environment.
Check the following Cloud Foundry documentation: Python Buildpack
## Vendor Application Dependencies
Sometimes, productive Cloud Foundry applications might need to be deployed as self-contained. That means, they need to carry all of their dependencies so that the staging process does not require any network calls. For more information, see: Vendor App Dependencies
Depending on the region where the application is deployed:
- Running on the China (Shanghai) region: it is mandatory for the application to be deployed as selfcontained
- Running on the AWS, Azure, or GCP regions: it is only recommended but not mandatory for the application to be deployed as self-contained.
## Specify a buildpack version in manifest.yml
At some point, you might need (or decide) to deploy your application with a particular buildpack version from the community python-buildpack repository. For example, if this buildpack contains a Python version that is no longer supported by the SAP BTP, Cloud Foundry environment.
Let's say, you want to pin version 1.8.4 . T o do that, proceed as follows:
1. Open the manifest.yml file of your Python application.
2. For the buildpack attribute, add the URL to version 1.8.4, like this:
3. Redeploy your application. Run:
```
---applications: - name: myapp random-route: true buildpack: https://github.com/cloudfoundry/python-buildpack.git#v1.8.4 memory: 128M
```
```
cf push myapp
```
## Alternative way:
If you don't want to make changes in your manifest.yml file, you can include the buildpack version in the cf push command.
- To deploy just a single application with this particular buildpack version, run:
- To pin this buildpack version for all applications running in your SAP BTP , Cloud Foundry environment subaccount, run:
```
cf push myapp -b https://github.com/cloudfoundry/python-buildpack.git#v1.8.4
```
```
cf push -b https://github.com/cloudfoundry/python-buildpack.git#v1.8.4
```
## Specify application memory in manifest.yml
When deploying an application in the SAP BTP, Cloud Foundry environment without specifying the application memory requirements, the Cloud Foundry controller assigns the default (1G of RAM currently) for your application. Many Python applications require less memory and assigning the default is a waste of resources.
To save memory from your quota, specify the memory size in the deployment descriptor of your Cloud Foundry application manifest.yml . For example:
```
---applications: - name: myapp memory: 128M buildpack: python_buildpack ...
```
## Additional Tips
- The cfenv package provides access to the Cloud Foundry application environment settings by parsing all the relevant environment variables. The settings are returned as a class instance. See: https:/ /github.com/ jmcarp/py-cfenv
- When developing Python applications, it's a good practice to use virtual environments. The most popular Python package providing such a functionality is virtualenv . See: https:/ /virtualenv.pypa.io/en/ stable/
- The PEP 8 Style Guide for Python will help you improve your applications.
## 4.1.3.5.4 Troubleshooting
While using the buildpacks, you might encounter issues or have questions regarding specific settings, limitations, or other aspects.
The following troubleshooting pages are related to the relevant development languages and buildpacks:
- SAP Java Buildpack [page 384]
- Node.js Buildpack [page 385]
- Python Buildpack [page 387]
If you cannot find a solution to your problem among these pages, you can create a support incident.
## Create a Support Incident
1. Log in to SAP Support Portal .
2. Choose Get Support . The Services and Support dashboard opens in your personal SAP for Me platform.
3. Choose Report New Issue and select the relevant customer name.
4. For Component , enter: BC-CP-CF-BLDP
5. Fill in the mandatory fields.
6. Explain your problem. See section Initial Problem-Related Data .
## Initial Problem-Related Data
When creating an incident, please provide the following information, which will help the support team to investigate and resolve your issue faster:
1. Type of buildpack Java , Python , or Node.js
2. Environment Cloud Foundry or XSA
3. Description of the issue
4. Steps to reproduce the issue
5. Expected result
6. Actual result
7. Logs in a .txt file. T o collect the latest logs, run the respective command.
- For Cloud Foundry, run:
- For XSA, run:
```
cf logs --recent <app_name>
```
```
xs logs --recent <app_name>
```
##  Note
If possible, collect logs shortly after failure.
8. Specific files per buildpack (language), respectively:
- Java: manifest.yml or MTA (if applicable)
- Node.js: manifest.yml and package.json
- Python: manifest.yml , runtime.txt , and requirements.txt
## 4.1.3.5.4.1  SAP Java Buildpack
This page provides solutions on known issues related to SAP Java Buildpack 1 and 2.
If you can't find a solution to your problem, create an incident to component BC-CP-CF-BLDP .
## Application Deployment on TomEE 1.7 Fails
## Problem
When trying to execute a Java application running on Apache TomEE 1.7, the following error appears:
SEVERE: Unhandled exception in Buildpack main method: None of the available runtimes [Tomee7, Tomcat, Java Main] supports the application in the specified path.
## Reason
Since May 5, 2022 , Apache TomEE 1.x is no longer supported by SAP Java Buildpack 1 (effective version 1.53.0 ). See: Release Notes
You need to modify your Java applications to run on Apache TomEE 7 instead. To do that, follow the solution below.
## Solution
1. Configure the manifest.yml file of your Java application:
- Make sure that the buildpack variable is set to sap\_java\_buildpack . If pinned to a particular version, it must be at least 1.53.0.
- For the TARGET\_RUNTIME variable, replace tomee with tomee7 . T o learn more, see TomEE 7. For example:
2. Check the information provided for Apache TomEE: Migrate from TomEE 1 to TomEE 7
3. Besides the TARGET\_RUNTIME variable, additional setups are needed. Please follow the guide for using TomEE 7.
4. After applying the new change, if your application fails with an OutOfMemoryError exception, change your memory size configuration. See:
```
---applications: - name: myapp path: .\target\myapp.jar buildpacks: - sap_java_buildpack . . . env: TARGET_RUNTIME: tomee7 JBP_CONFIG_COMPONENTS: "jres: ['com.sap.xs.java.buildpack.jdk.SAPMachineJDK']"
```
```
Memory Calculator V1 [page 312] XS Advanced Model: Memory Size Options
```
## 4.1.3.5.4.3  Python Buildpack
This page provides solutions on known issues related to the Python buildpack.
If you can't find a solution to your problem, create an incident to component BC-CP-CF-BLDP .
## Error: Could not install python: no match for 3.x.x
## Problem
You are trying to deploy or restage a working Python application but it suddenly fails.
## Reason
If an existing application was working fine, and after being redeployed or restaged it fails for no logical reason, take a look at the logs. It might be that the Python version you're using has been recently removed from the latest releases in the community buildpack .
For example: You are using Python v 3.10.1 , and in the logs you see:
Could not install python: no match found for 3.10.1 in [3.8.19 3.9.19 3.10.14 3.11.9 3.12.5]
## Solution
To make your application work again, go to the runtime.txt file and update the Python version like this:
python-3.10.x
You can also upgrade to a higher major version (11, 12 or 13). In this case, set the runtime analogically:
- python-3.11.x
- python-3.12.x
- python-3.13.x
## 4.1.3.6.2 Deploy the Multitenant Application to the Provider Subaccount
After you have developed your multitenant application and authorizations, you need to deploy the application in a Cloud Foundry space in the provider's subaccount.
## Context
To make the application available to subaccounts in multiple regions, you need to deploy the application to a provider subaccount in each of the regions.
## Procedure
1. Create a subaccount in the Cloud Foundry environment in the global account of the application provider. This subaccount will host the multitenant application for the provider tenant.
For general instructions, see Create a Subaccount [page 2249].
2. In the subaccount, create a space in a Cloud Foundry organization.
For general instructions, see Create Spaces [page 2520].
3. Assign the appropriate quota for the application runtime memory to the provider's subaccount.
For general instructions, see Configure Entitlements and Quotas for Subaccounts [page 2269].
4. Deploy the application to the Cloud Foundry space and start it by executing the push command in the command line interface (cf CLI).
For more information, see Deploy Business Applications in the Cloud Foundry Environment [page 742].
## 4.1.3.6.4 Bind the Multitenant Application and Application Router to the xsuaa Service Instance
Bind your multitenant application and the approuter application to the SAP Authorization and Trust Management service (technical name: xsuaa ) instance, which acts as an OAuth 2.0 client to your application.
## Procedure
Execute the following commands in the Cloud Foundry command line interface to bind both your multitenant application and the approuter application to the xsuaa service instance.
```
cf bind-service <APP_NAME> <XSUAA_INSTANCE_NAME> cf bind-service <APPROUTER_APP_NAME> <XSUAA_INSTANCE_NAME>
```
Specify the following parameters:
| Parameter            | Description                                                                                           |
|----------------------|-------------------------------------------------------------------------------------------------------|
| APP_NAME             | The name of the deployed multitenant application.                                                     |
| XSUAA_INSTANCE_NAM E | The name of the xsuaa service instance you created in Develop the Multitenant Application [page 391]. |
| APPROUTER_APP_NAME   | The name of the xsuaa application you deployed in Configure the approuter Application [page 395].     |
## 
```
Sample Code cf bind-service saas-app xsuaa-application cf bind-service approuter-saas-app xsuaa-application
```
##  Tip
You can also bind the application to the xsuaa service instances directly in the SAP BTP cockpit.
## 4.1.3.6.5.1  Unregister a Multitenant Application from the SAP SaaS Provisioning Service
Unbind and delete the service instance you have created during the registration of your multitenant application to complete the unregistration process.
## Prerequisites
Make sure that no tenant is subscribed to your application before you initiate the deletion of the service instance.

Tip
Use the Get Application Subscriptions API to get the application subscriptions.
In case there are subscribed tenants, unsubscribe them first by calling the Unsubscribe the tenant from an application API.
For more information, see Using SAP SaaS Provisioning Service APIs to Manage Multitenant Applications [page 407].
## Context
The procedure described in this section uses the cf CLI.

Tip
You can delete a service instance directly in the SAP BTP cockpit, in the Service Instances page.
## Procedure
1. Use cf CLI to remove any existing service keys and app bindings:
- a. Run the following command to delete the service key:
<!-- image -->
- b. Run the following command to unbind your application from the service instance:
- c. Run the following command to delete the service instance:
2. The deletion process is asynchronous. Run cf services to view the current status of the process.
```
cf unbind-service APP-NAME SERVICE-INSTANCE-NAME
```
```
cf delete-service SERVICE-INSTANCE-NAME
```
## 4.1.3.6.6 Providing Multitenant Applications to Consumers in the Cloud Foundry Environment
Once you have built a multitenant application in the Cloud Foundry environment using SAP BTP, you can then share the application with multiple consumers, such as business units in your organization.
## Consumer Subaccounts and Subaccount Members
To use multitenancy in the Cloud Foundry environment in SAP BTP, the application provider must create a subaccount for each consumer in the same global account where the multitenant application is deployed.
The multitenant application is deployed to one subaccount only, which is the hosting subaccount of the application provider. Consumers simply subscribe to the provider application from their subaccount through the SAP BTP cockpit, the SAP BTP command line interface, or dedicated REST APIs.
The application provider is responsible for:
- Creating and managing the tenant subaccounts.
- Setting up the necessary role access authorizations.
- Subscribing each tenant to the application.
Typically, consumers of multitenant applications provided by a non-SAP application owner, such as an IT department of an organization, do not own or have access to their tenant subaccount.
Account setup for an application owner provisioning a multitenant application to its consumers.
<!-- image -->
Subaccount members are users who are registered via the SAP ID service. Subaccount members may have different privileges regarding the operations that are possible for a subaccount (for example, subaccount administration, deploy, start, and stop applications).
The subaccount-specific configuration allows application providers to adapt the consumer subaccounts to their specific needs.
## What Do You Need to Do, and How?
Once you have developed, deployed, configured, and registered your multitenant application, your account administrator is ready to do the following.
1. Create a subaccount in your global account for each application consumer. See Create a Subaccount [page 2249].
2. Subscribe each consumer subaccount to the hosted application deployed in the provider account. See:
- Subscribe to Multitenant Applications Using the Cockpit [page 2274]
- Working with Multitenant Applications Using the btp CLI [page 2440]
- Subscribe the tenant to an application using the REST API. For more information, see Using SAP SaaS Provisioning Service APIs to Manage Multitenant Applications [page 407]
3. Set up application roles and assign users. See Configure Application Roles and Assign Roles to Users [page 2277].
## Viewing and Managing of Your Multitenant Application's Subscriptions
Once you've provided your multitenant application to consumers to subscribe to it, you can view and manage all the subscriptions by using a dedicated interface called SAP BTP subscription management dashboard.
For more information, see Using the Subscription Management Dashboard [page 412].
## 4.1.4  Developing User Interface
Get information on user interface development in the SAP BTP, Cloud Foundry environment.
The key to a modern user interface is pairing great performance with a consistent and recognizable design across applications, platforms, and devices. To keep the user experience homogenous, you can establish a
flexible implementation paradigm based on reusable components. Doing so enables extensibility and easier maintainability.
We know that it can be difficult to decide this up front. You can find information about UI development options in the SAP BTP, Cloud Foundry environment in the following sections.
## Fiori Design Guidelines
The SAP Fiori Design Guidelines define design solutions that are easy to use, robust, scalable, and of enterprise-grade quality. The guidelines are independent of the implementation technology.
The modular design approach focuses on user tasks and workflows. It enables seamless transitions between applications and offers clear guidance for extension and integration design. To ensure a consistent user experience, we recommend following the Fiori Design Guidelines independent of the UI technology you plan on using.
## SAPUI5
SAPUI5 is a JavaScript framework for building cross-platform, enterprise-grade web apps with modern, responsive, and rich user interfaces. For more information, see Developing SAPUI5 [page 416].
## HTML5
On SAP BTP, you can access and run HTML5 applications in a cloud environment without the need to maintain your own runtime infrastructure. For more information, see Developing HTML5 Applications in the Cloud Foundry Environment [page 419].
## 4.1.4.1 Developing SAPUI5
Get to know certain aspects of SAPUI5 development, to get up and running quickly.
If you are about to decide which UI technology to use , read everything you need to know about supported library combinations, the supported browsers and platforms, and so on, at the Read Me First section that contains the following topics and more:
- Supported Library Combinations
- Supported Combinations of Themes and Libraries
- Browser and Platform Support
## Quick Start
<!-- image -->
- #unique\_280/unique\_280\_Connect\_42\_subsection-im1 [page 417]
- #unique\_280/unique\_280\_Connect\_42\_subsection-im2 [page 418]
- #unique\_280/unique\_280\_Connect\_42\_subsection-im3 [page 418]
- #unique\_280/unique\_280\_Connect\_42\_subsection-im4 [page 418]
Select the tiles to discover SAPUI5 Development. The references guide you to the documentation of the SAPUI5 Demo Kit. Besides the entry points we provide here on each tile, start exploring the demo kit on your own whenever you feel comfortable enough.
## SAP Business Application Studio
Use the SAP Business Application Studio to develop on Cloud Foundry. You just need to create a dev space, which is a preconfigured development environment with the tools, capabilities, and resources needed for developing your application.
1. Register for an SAP BTP trial account at https:/ /account.hanatrial.ondemand.com/ and log on afterwards.
2. Set Up SAP Business Application Studio in a trial account.
3. Create a SAP Fiori dev space.
4. Create a Project - either using the wizard or the terminal.
Learn how you can use SAP Business Application Studio together with UI5 Tooling to develop state-of-the-art UI5 apps.
## Tutorials
Depending on the project template you're using you have a project that is more advanced than what you see in the following tutorials. Those tutorials show you the basics and you can start a new and empty project to follow along those SAPUI5 tutorials from the demo kit.
Have a look at the Get Started: Setup and Tutorials section that contains the following topics and more:
- 'Hello World!'
- Data Binding
- Navigation and Routing
- Mock Server
- Worklist App
- Ice Cream Machine
## Essentials
This is reference information that describes the development concepts of SAPUI5 , such as the Model View Controller, data binding, and components.
The following topics are excerpts from the Essentials section:
- Bootstrapping: Loading and Initializing
- Structuring: Components and Descriptor
- Model View Controller (MVC)
- Data Binding
- Reusing UI Parts: Fragments
## Developing Apps
Create apps with rich user interfaces for modern Web business applications, responsive across browsers and devices, based on HTML5.
The following topics are excerpts from the Developing Apps section:
- App Templates: Kick Start Your App Development
- App Overview: The Basic Files of Your App
- App Initialization: What Happens When an App Is Started?
- Folder Structure: Where to Put Your Files
- Coding Issues to Avoid
- Securing Apps
## 4.1.4.2 Developing HTML5 Applications in the Cloud Foundry Environment
SAP BTP enables you to access and run HTML5 applications in a cloud environment without the need to maintain your own runtime infrastructure.
HTML5 applications consist of static content that runs on a browser. Then you develop your applications either in SAP Business Application Studio, or in your own IDE (integrated development environment) - and deploy them to the HTML5 application repository [page 420].
Depending on your backend application setup, you either configure the destinations during development, or define them after deploying the application. Finally, to consume the applications, you can create a site using SAP Cloud Portal service or SAP Build Work Zone, build the URL, and define custom domains.
On the Cloud Foundry environment of SAP BTP you can run an application that was uploaded to HTML5 application repository using one of the following options:
- Use the application router that is managed by SAP. For more information, see Managed Application Router [page 518].
- Set up and maintain your own application router in your own space. For more information, see Application Router [page 439].
Both options allow you to serve static content from HTML5 application repository, authenticate users, rewrite URLs, and forward or proxy requests to other micro services while propagating user information. However, the managed application router [page 518] brings many benefits, such as:
- Simplify and speed up your development and deployment experience
- Save resources by running a serverless HTML5 application, which doesn't require any application runtime
- Lower maintenance efforts by leveraging the most up-to-date routing capabilities
- Meet the changing demand for HTML5 applications by automatically adjusting the service to maintain consistent and predictable performance
- Monitor and run your HTML5 applications from the HTML5 Applications UI in the SAP BTP cockpit
Therefore, we recommend running your own application router [page 439] only in advanced cases, for example when application router extensibility is required.
##  Note
When using the managed application router [page 518], you can monitor and run your HTML5 applications from the HTML5 Applications UI for your subaccount in the SAP BTP cockpit.
For monitoring and running HTML5 applications served by a standalone application router [page 439], you can use the CF HTML5 applications repository CLI plugin .
## Related Information
HTML5 Application Repository [page 420] Application Router [page 439] Managed Application Router [page 518]
## 4.1.4.2.1 HTML5 Application Repository
HTML5 application repository enables central storage of HTML5 applications' static content on the SAP BTP, Cloud Foundry environment. This service can be consumed from the SAP BTP, Cloud Foundry runtime, the SAP BTP, Kyma runtime, Kubernetes, or by creating a service instance on the subaccount level regardless of an environment.
HTML5 applications consist of static content such as HTML, CSS, JavaScript, and other files, that run on a browser. For more information, see Basic Template and openui5-basic-template-app .
HTML5 application repository allows application developers to manage the lifecycle of their HTML5 applications. In runtime, the repository enables the consuming application, typically the application router, to access HTML5 application static content in a secure and efficient manner. For more information, see Configure Application Router.
## Features
## Zero Down-Time Enablement
- The HTML5 applications are decoupled from the consuming application router. This enables updating the static content of the HTML5 applications without restarting the application router.
Versioning and Authorization
- Exploration of HTML5 application content by version.
- Access control that is based on private or public authorization. When the HTML5 application is public, the service enables sharing this content with consuming application
- routers from different spaces.
## Availability and Performance
- During runtime, the HTML5 application content is cached and optimized to provide high performance with minimal network load.
- The service provides several instances for a runtime to serve a high load of application requests.
## Environment
This service is available in the following environments:
- Cloud Foundry environment
- Kyma environment
## Multitenancy Support
This service supports multitenancy. It can be used by tenant-aware applications.
## Technical Constraints
- The size of an application deployed to the repository is limited to 100 MB per service instance of the app-host service plan.
- Since the applications stored in HTML5 application repository can be shared, it is advised not to add personal data to them.
- You can perform up to 50 deployments per minute at design time per SAP BTP subaccount. If you exceed this rate limit, the HTTP error code 429 is returned.
- You can make up to 300 requests per second at runtime per SAP BTP subaccount. If you exceed this rate limit, the HTTP error code 429 is returned.
## See Also
If you want to learn more about services in the SAP BTP, Cloud Foundry environment, see Using Services in the Cloud Foundry Environment [page 252].
## 4.1.4.2.1.1  Service Plans
The HTML5 Application Repository service comprises the following service plans:
- app-host Use this service plan to deploy HTML5 applications to the repository. For more information, see Deploying
Content [page 421].
- app-runtime
Use this service plan to consume HTML5 applications stored in the repository. For more information, see Consuming Content [page 431].
## 4.1.4.2.1.2  Deploying Content
Learn how to deploy, redeploy, and undeploy content from the HTML5 Application Repository.
In the Cloud Foundry environment, the Generic Application Content Deployer (GACD) is the preferred module for the application deployment. GACD deployment enables asynchronous uploads, making it more suitable for handling large content. This method helps mitigate the risk of network-related timeouts due to long response times. Additionally, with GACD, you do not need to deploy a Cloud Foundry application within your space. See Deploy Content Using the Generic Application Content Deployer [page 423].
In the Kyma environment, you use the HTML5 Application Deployer. See Deploy Content Using HTML5 Application Deployer [page 425].
The following applies to deployment with both modules:
##  Note
The HTML5 Application Repository service does not provide the technical capabilities to support the collection, processing, and storage of personal data. The file names used for deploying the HTML5 applications are not intended for personal data.
You use a service instance of the app-host service plan to deploy your applications to the HTML5 Application Repository.
##  Note
If you delete an app-host service instance, the apps that are deployed with this app-host service instance are deleted from the HTML5 Application Repository.
<!-- image -->
##  Restriction
Delta deployments are not supported.
If you deploy new application content using an existing app-host service instance, the new application content will completely replace the old application content that had been previously deployed with this service instance in the HTML5 Application Repository.
For example, if you have already deployed the applications a, b, and c with the instance 123 and now want to deploy the new applications d and e, you can do one of the following to avoid overwriting the applications a, b, and c:
- Redeploy instance 123 with applications a, b, c, d, and e (with the new and the old applications).
- Create a new instance 456 and use this instance to deploy the applications d and e.
## Related Information
Deploy Content Using the Generic Application Content Deployer [page 423]
Deploy Content Using HTML5 Application Deployer [page 425]
Redeploy Content [page 430]
Undeploy Content [page 431]
## 4.1.4.2.1.2.2.1  Asynchronous Upload Using the HTML5 Application Deployer
You can specify that the upload of content is performed asynchronously by adding the environment variable ASYNC\_UPLOAD to the manifest.yaml or mta.yaml files.
The asynchronous upload is especially useful, if you want to trigger the upload of service instances with a large content (more than 10 MB). A synchronous upload of service instances with a large content can result in health check errors or a connection timeout during the upload. You can avoid this by using the asynchronous upload.
During an asynchronous upload, the html5 applications content is handled synchronously to the HTML5 Application Repository, while the internal file validation and processing is performed asynchronously. To verify that the upload has completed successfully, you have to check the HTML5 Application Deployer logs.