How to build, deploy fiori app to SAP Cloud Foundry

0
8193

Dear SAPLearners, in this blog post we will learn how to deploy Fiori app to SAP Cloud Foundry from SAP Business Application Studio.

✋ Prerequisites

To complete this tutorial, you will need:

📚 Step-by-Step Procedure

1. Launch SAP Business Application Studio and continue with the same Fiori app.

Build and Deploy Fiori App

2. Right-click on the mta.yml file and select Build MTA.

Build Deploy and Run Fiori App in SAP Cloud Foudnry Step1

3. MTA build will start and you can see the progress in the terminal.

4. After a successful build, two new folders will be created.

  • mta_archives and .mtar file under this folder.
  • resources and ui-content.zip file under this folder.
Build Depoy and Run Fiori App in SAP Cloud Foudnry Step3

5. The Cloud MTA Build Tool is the tool that generates the deployment-ready multi-target
application (MTA) archive .mtar file from the artifacts of a Fiori project.

6. Now right-click on the .mtar file and choose Deploy MTA Archive from the context menu.

Build Depoy and Run Fiori App in SAP Cloud Foudnry Step4

Also Read: How to create and deploy Node.js App with SCP Cloud Foundry

7. Finally, our fiori app file got deployed to SAP Cloud Foundry successfully. You will see errors here in the terminal if deployment failed.

Build Depoy and Run Fiori App in SAP Cloud Foudnry Step6

8. Navigate to SAP Cloud Platform Cloud Foundry cockpit subaccount and then to dev space. Under Service Instance section you will find 3 instances created for our Fiori application.

Build Depoy and Run Fiori App in SAP Cloud Foudnry Step7

9. From where does these instances created 🧐? These are created based on the services mentioned in the mta.yml file of our project. These are added by the SAP BAS by default based on the options we choose during Fiori project creation.

Build Depoy and Run Fiori App in SAP Cloud Foudnry Step8

Run Fiori App

10. After that, it’s time to run the application. Using app-host service , HTML5 application is deployed to HTML5 Application Repository in SAP Cloud Platform Cloud Foundry.

12. There are 2 ways to run HTML5 applications. They are

  1. Standalone and
  2. Portal

In the blog post, we will look at running the applications in standalone mode, and next tutorial we will show you how to access the Fiori app from the portal site.

13. To run the fiori app in standalone mode we need to construct the URL and the structure is like below.

https://<SubscriberSubdomain>.<PortalHost>.<PortalDomain>/<sapCloudService>.<appName>-<appVersion>/index.html

SubscriberSubdomainYou can get the subdomain from the subaccount Overview section
PortalHostcpp
PortalDomaincfapps.<region>.hana.ondemand.com, replace <region> with subaccount region
sapCloudServiceThe manifest.json file, check screen-shot below
appNameThe manifest.json file, check screen-shot below
appVersionThe manifest.json file, check screen-shot below
Build Depoy and Run Fiori App in SAP Cloud Foudnry Step9

14. Finally, by following above step, the final URL in my case is like below.

Build Depoy and Run Fiori App in SAP Cloud Foudnry Step10

15. Wohooo!!! 🙌 we are able to run the fiori app successfully.

Conclusion

Congrats!! you have successfully learned how to build and deploy fiori app to SAP Cloud Foundry.

Please feel free to comment and let us know your feedback. Subscribe for more updates.

If you liked it ❤️, please share it! Thanks! 🙏

Continue Learning

How to integrate Fiori apps in SAP Cloud Platform Portal

FAQs

What is the HTML5 Application Repository?

The HTML5 Application Repository centrally stores the applications’ static content on the SAP Cloud Platform.

Other References