Technical Articles
SAP Cloud Application Programming Model – Demo5
Hello Community
In this page, Let’s learn how to deploy CAP apps to Cloud Foundry environment of SAP Cloud Platform.
Links to my prior blogs:
https://blogs.sap.com/2020/05/01/sap-cloud-application-programming-model-demo1/
https://blogs.sap.com/2020/05/03/sap-cloud-application-programming-model-demo2/
https://blogs.sap.com/2020/05/10/sap-cloud-application-programming-model-demo3/
https://blogs.sap.com/2020/05/16/sap-cloud-application-programming-model-demo4/
I used my earlier blog: https://blogs.sap.com/2020/05/03/sap-cloud-application-programming-model-demo2/ to structure the project.
Two approaches are available in deploying the application to Cloud Foundry Environment.
- Deployment using cf push
- Deployment using multi target application(MTA) concept
cf push deployment process:
cds add hana: configures the application to SAP HANA db.
cf create-service hanatrial hdi-shared studentreport-db-hdi-container: Create service
cf push -f gen/db/: Push the application
add https:// to above routes and run in new window.
Deployment using multi target application(MTA) concept: builds convenient features compared to cf push deployment approach.
Follow the below steps for second deployment process:
cds add mta: Generate MTA descriptor file.
Above command adds this file to our project.
mbt build: Builds the application archive
cf deploy mta_archives/studentreport_1.0.0.mtar
copy the application name from the terminal, add https:// and run the URL in new window. Finally the output looks the same way as the first approach with minimal steps.
Please Suggest/ Comment..
Thank you!! 🙂
#EnhanceLearning
BR//Dhanasupriya Sidagam
Hi,
Thanks for the blog 🙂
It is also possible to deploy by choosing the mtar file -> right click -> 'Deploy MTA Archive'
Thanks,
Liat
Great post! Thanks!
Good Post, could help us to connect to Hana DB by creating service and connecting the same ?
Hi Dhanasupriya,
When trying to follow these steps.. am getting the below error, could you please help.
Error staging application "nnnnnnn-srv": BuildpackCompileFailed - App staging failed in the buildpack compile phase
Download the application logs via the dmol command and check them for more information.
A step of the process has failed. Retrying it may solve the issue.
Process failed.
This blog may help: https://blogs.sap.com/2020/07/07/escaping-eintegrity-hell/ .
Good luck.
Hi Laszlo Kajan,
Thanks for help.....
Hi Dhanasupriya,
Is it manadatory to create Service like below from command
cf create-service hanatrial hdi-shared studentreport-db-hdi-container: Create service
Here what i understood is you are creating a db Table with name studentreport-db-hdi-container and Pushing the app.
Here studentreport-db-hdi-container is similar to your project name. Now i want my db name different from Project name and i want to push. Is this Possible.
Project Name : Demo_books
DB Name : books_Demo-db
cf create-service hanatrial hdi-shared books_Demo-db-hdi-container: Create service (I created this DB for some project and now i want to use this for Demo_Books Project also)
Regards,
Shekar.
hi Dhanasupriya Sidagam -
I have created two different schemas. Both these schemas have entitties inside them. How can we create assocaition between entities of 2 different schema.
Thanks,
Udita