Now, that you made some progress locally, let's make this application available in the cloud.
You need to log in to Cloud Foundry in SAP Business Technology Platform using the Cloud Foundry CLI. First, you need to set an API endpoint. The exact URL of this API endpoint depends on the region your subaccount is in. Open the SAP Business Technology Platform Cockpit and navigate to the subaccount you are planning to deploy your application. Click on Overview
on the left and you can see the URL of the API endpoint.
Copy the URL and paste it into the following command in your command line (if you haven't logged in before):
cf login -a https://api.cf.YOUR_REGION.hana.ondemand.com
Enter your credentials and choose an organization and space if necessary.
We will need some services for deployment to Cloud Foundry. We will need a service for Authorization and Trust Management (XSUAA) and destination service. Set them up as described in the following.
Take a look at the xs-security.json
file. It contains some configurations for the XSUAA service. The tenant-mode
indicates that we want to share the OAuth client secret for all subaccounts that subscribe to this service instance, allowing for multi-tenancy. The xsappname
must be unique throughout all spaces.
For more information take a look here.
Run the following to create an xsuaa service instance:
cf create-service xsuaa application my-xsuaa -c xs-security.json
The SAP BTP destination service serves technical information on remote services or systems. Create an instance of this service:
cf create-service destination lite my-destination
This is what the service instances should look like in the SAP BTP cockpit:
Run the following to build and package your application:
npm run ci-build && npm run ci-package
Eventually, push it to Cloud Foundry:
cf push
As this will take a moment, proceed to the next step in the meantime.
Login to the SAP BTP cockpit and find your subaccount. Check the Connectivity
tab on the left. Here you will find your configuration for connectivity services: destinations and cloud connectors.
You will need to configure a cloud connector when you want to connect to an on-premise system.
As we will retrieve data from SAP S/4HANA and SAP SuccessFactors, we have to configure those systems as destinations. Click on the destinations and add two new destinations:
SAP S/4HANA destination:
Name: S4HANA
Type: HTTP
URL: S4_SERVER_URL
Proxy type: Internet
Authentication: S4_AUTHENTICATION_TYPE
SAP SuccessFactors destination:
Name: SFSF
Type: HTTP
URL: SFSF_SERVER_URL
Proxy type: Internet
Authentication: SFSF_AUTHENTICATION_TYPE
Refer .env
file if you don't remember the URL
and Authentication
as you defined them in exercise 1.
This is what the configured destinations should look like in the SAP BTP cockpit:
In the SAP BTP cockpit, go to the Spaces
tab on the left and select the space that you logged into on the command line before. Select your application team-calendar
and click on the application route to see the application running.
Congratulations, you deployed an extension to SAP S/4HANA to the SAP BTP!