Skip to Content
Technical Articles

Serverless SAP Fiori Apps on SAP BTP, Cloud Foundry environment

In this post, I show-case the latest innovation for web apps in SAP BTP, Cloud Foundry environment – hosting them without an approuter. With this new capability of the SAP Launchpad service, you no longer need to deploy backend components to host web apps – which, therefore, run serverless on SAP BTP.


29th Jan 2021: Rebranding to SAP BTP

16th Feb 2021: Switch to instance-level destinations

Now that the HTML5 Application Repository gets more and more popular, I received a couple of questions about whether it is possible to use only one approuter for multiple web apps to lower the total cost of ownership (TCO). The good news is that this can be done fairly easily. The even better news is that you don’t need an approuter at all! The existing SAP Cloud Portal subscription and the new SAP Launchpad subscription service already come with an integrated HTML5 application runtime that will allow you to access web apps directly via the Launchpad URL. In this blog post, I will explain how to deploy regular web apps and SAP Fiori apps and let them be managed by SAP BTP. Fiori Apps can then easily be found by the Content Explorer of the Launchpad service and directly be added to a Launchpad.

The Content Explorer of the Launchpad service detected an available SAP Fiori app automatically and suggests adding it to the SAP Fiori Launchpad.

Old state

Several things need to happen in SAP BTP, Cloud Foundry environment to run a web app. For once, the application needs to be hosted somewhere. As I explained in a talk earlier this year, many reasons speak for the HTML5 Application Repository service. Therefore, we need to (a) upload the web app into this repository during the deployment. Next, we need an approuter to (b) redirect incoming traffic to the web app that resides in the repository service. If the web app is an SAP Fiori application, we might have used the Cloud Foundry service “portal” to embed it in an SAP Fiori Launchpad. For this, we needed a (c) deployer application to upload the configuration file to the service instance bound to the approuter. For most apps, there are also destinations involved which point to the backend systems that provide data. So we also need to (d) maintain destination in the SAP BTP Cockpit. 




d) <Done manually in the SAP BTP Cockpit>

The architecture of the old approach

For two (b and c) out of these four tasks, we typically leverage the Cloud Foundry tasks, which are Node.js modules. These modules run for a short time and stop once the job is completed. During this time, they consume memory and CPU resources, which has a small (but present) impact on your TCO. The most immense impact on the TCO is caused by the approuter. It runs 24/7 and scales with the complexity and usage of the web app. In many scenarios, developers use even one approuter per web app, which multiplies the TCO.

This also explains why I got asked by multiple developers, whether it’s possible to use a single approuter for multiple SAP Fiori apps. In the next section, I will show you something even better: You’ll be able to serve your web apps with NO backend component at all.

Make your web apps “serverless”

The core idea is quite simple: The SAP Fiori Launchpad itself also a web app that is connected to an HTML5 application runtime. The advantage of that service is that it’s hosted by SAP for you, so you don’t need to manage the HTML5 application runtime, and you can simply consume it.

This post described how you can use the SAP Business Application Studio to create a new SAPUI5 app managed by SAP BTP out-of-the-box.

The URL of your SAP Fiori Launchpad service typically looks like this:


We can now reuse the approuter of this application and make our web apps accessible under:


As you can see, each web app needs to contain a unique appId, the version, and refer to a service to form this URL – all three values are maintained in the manifest.json . If you want to build such a web app “by hand,” start with a minimal version of this manifest.json file:

  "_version": "1.12.0",
  "": {
    "id": "helloworld",
    "applicationVersion": {
      "version": "1.0.0"
  "": {
    "service": "basic.service"
  "sap.ui5": {
    "dependencies": {
        "minUI5Version": "1.65.0"

Besides this, you need to create service keys for certain Cloud Foundry service instances. These keys are necessary for destinations that are created during the deployment of your application. You can use the following snippet to define the keys and destinations in your mta.yamlfile.

  - name: hello-world-destination-content
      no-source: true
      - name: hello-world_uaa
            name: hello-world_uaa-key
      - name: hello-world_html_repo_host
            name: hello-world_html_repo_host-key
      - name: hello-world-destination-service
          content-target: true
              existing_destinations_policy: update
                - Name: my_service_hello_world_html_repo_host
                  ServiceInstanceName: hello-world_html_repo_host
                  ServiceKeyName: hello-world_html_repo_host-key
                - Authentication: OAuth2UserTokenExchange
                  Name: my_service_uaa_hello_world
                  ServiceInstanceName: hello-world_uaa
                  ServiceKeyName: uaa_hello-world-key

  - name: hello-world-destination-service
    type: org.cloudfoundry.managed-service
      service: destination
      service-name: hello-world-destination-service
      service-plan: lite
  - name: hello-world_html_repo_host
    type: org.cloudfoundry.managed-service
      service: html5-apps-repo
      service-plan: app-host
  - name: hello-world_uaa
    type: org.cloudfoundry.managed-service
      path: ./xs-security.json
      service: xsuaa
      service-plan: application

You can now remove the approuter module from your project as you don’t need it anymore. This helps you a lot to reduce the TCO footprint of your project. In case you defined routes on the approuter ( router/xs-app.json ), you need to copy these routes to the xs-app.json file of your web app. When you do this, you move the route to the URL suffix of the web app. E.g. the URL will be


instead of


To account for this change, you need to switch from absolute to relative URLs in your web app. Most likely you’ll need to make changes to the datasources property in the manifest.json.

"": {
    "dataSources": {
        "mainService": {
            // OLD: "uri": "/v2/Northwind/Northwind.svc/",
            "uri": "v2/Northwind/Northwind.svc/",

You can find the entire sample project on GitHub if you want to clone it from there. Once you run the typical build and deploy commands, you will be able to see your web app listed under “HTML5 Applications” on your subaccount.


The cockpit shows a list of all web apps that are available in this subaccount.

Note: This UI is not available in trial accounts at the moment. You will only be able to see this in production accounts!

Click on the application name to open the web app. You’ll notice that the URL is different than the URL of typical approuter apps because there is not Cloud Foundry application involved here. 

Deploy without a Cloud Foundry task

In the old approach, we used CF modules of type to zip and upload the static web app resources to the HTML5 Application Repository. In the new approach, we will use the native GACD interface to upload the web application directly into the HTML5 Application Repository. This means we don’t need a Cloud Foundry task for b) any longer, and therefore it won’t consume memory and CPU.

For this, we need to make sure the web app is zipped during the build process. This can be achieved in multiple ways, either with a package from npm or with this custom task for the UI5 tooling builder.

Once the zip archive has been created, you just to reference it from the new MTA module:

  - name: hello-world_ui_deployer
    path: .
      - name: hello-world_html_repo_host
          content-target: true
      build-result: resources
        - artifacts:
          name: HTML5Module
          target-path: resources/

Notice that the module type has been changed and that there is no package.json file needed anymore. With this, you reduced the footprint of your overall projects a little more.

Expose SAP Fiori apps in the Content Explorer

In this new approach, we won’t be using the “developer sandbox” of the Fiori Launchpad (aka the Portal service instance) but the actual management UI that comes with the full Launchpad subscription. In other words, we don’t need the service instance in the mta.yaml file, and therefore task c) is also out of the game. We just made the footprint of the project a little bit smaller.

Your Fiori app needs to fulfill the following criteria when you want to make it accessible via the Content Explorer:

  1. Contain an inbound navigation intent in the manifest.
      "": {
          "crossNavigation": {
              "inbounds": {
                  "fe-inbound": {
                      "signature": {
                          "parameters": {},
                          "additionalParameters": "allowed"
                      "semanticObject": "masterDetail",
                      "action": "display",
                      "title": "Available Categories",
                      "subTitle": "",
                      "icon": ""
  2. Include a “” file that includes the manifest.

Redeploy your project after you made these changes. Now, navigate to the management user interface for the Launchpad subscription and go to the Provider Manager. You should see a content provider named “HTML5 Apps“, use the refresh button to sync with the HTML5 Application Repository. You’ll also need to click this button every time when a changed application should be updated on the launchpad site.


The HTML5 Application Repository as a Content Provider

Next, switch over to the Content Manager and choose the tab Content Explorer. You are now able to see your Fiori App and to click the “Add to My Content” button.


The Content Explorer found one SAP Fiori app.


Congrats! You have now removed all Cloud Foundry modules that consume memory and CPU from your project and therefore reduced the footprint of your SAP Fiori app significantly.


The architecture of the new approach

You can find an entire sample Fiori app in our Multi-Cloud HTML5 Apps Repo on GitHub.

Or you can follow this tutorial to write new SAP Fiori apps from the scratch with easy-ui5.

Destinations as code

Infrastructure as code is used to define compute resources in a text file and to provision them automatically when needed. Similarly, this feature can relieve you of configuring the destinations manually in the SAP BTP Cockpit and automating your development flow.

I recently learned that you can define destinations in a JSON file, similar to the xs-security.json file that we already know. This feature can be used to declutter the destinations on the subaccount level and move them to the service instance-level. You only need to make sure that HTML5 runtime is enabled for the service instance and that the update strategy of the destinations is defined in the configuration file:

  "HTML5Runtime_enabled": true,
  "version": "1.0.0",
  "init_data": {
    "instance": {
      "existing_destinations_policy": "update",
      "destinations": [
          "Name": "Northwind",
          "Description": "Automatically generated Northwind destination",
          "Authentication": "NoAuthentication",
          "ProxyType": "Internet",
          "Type": "HTTP",
          "URL": "",
          "HTML5.DynamicDestination": true

Do not add credentials in such a file because then you might accidentally include them in the git history of your repo.

And last but not least, you need to include this JSON file in the resource definition of the destination service instance in the mta.yaml file:

  - name: mock-destination
    type: org.cloudfoundry.managed-service
      service-plan: lite
      service: destination
      path: ./destinations.json

More information on this can be found in the documentation.


So task d) from above is not needed any longer either. With this, we got rid of all tasks that required manual work or consumed compute resources to deploy a web app. Hurray!

You can find an entire sample Fiori app in our Multi-Cloud HTML5 Apps Repo on GitHub.


Check out this video tutorial which will show you how to use the managed application router in SAP Business Application Studio:

Watch it here


I already mentioned it a couple of times across this post; the most significant advantage of this approach is the reduced footprint that saves you money. But this is, by far, not the only benefit. It also helps you scale your web apps because you won’t need to decide how much memory you want to allocate to the approuter. By reducing the included modules, you can simplify the architecture of the project significantly and, therefore, also reduce the planning overhead when designing such a Fiori App. This simplified architecture also accelerates the deployment. It now only takes about 30 seconds to deploy a Fiori Application and to create the needed service keys and destinations, whereby it took a few minutes and required manual configuration in the past.


Even though many reasons speak for the new approach, there are also a couple of reasons that speak for an approuter that is entirely under your control. One reason might be that you prefer to keep the routes on the approuter-level. Or maybe you want to configure or extend the default approuter. It could also make sense to keep the approuter combined with servers written with the Cloud Application Programming Model.


In this post, you have learned:

  • that an approuter is no longer needed to host web apps in SAP BTP, Cloud Foundry environment
  • how to let SAP BTP manage your web apps
  • how to make an SAP Fiori app detectable via the Content Explorer
  • how to define destinations with text files
  • that it can still make sense to use an approuter
You must be Logged on to comment or reply to a post.
  • Thanks for sharing this Marius, we'll try this approach for our CAP + Fiori apps. I have one question though, what do you mean with this statement:

     It could also make sense to keep the approuter combined with servers written with the Cloud Application Programming Model.

    If I understand correctly we should have a CAP project with app (only the approuter), srv & db modules and a separate project for the Fiori app using the approach described in your blog?


    • Hi Pierre,

      awesome, I'd be happy to learn how much you like this new approach once you implemented it.

      What I meant to say is there can be many good reasons to continue using an approuter. Not more and not less than that 🙂

      Personally, I like to manage all modules of one project in one mono repo. E.g. you could have a project that includes CAP artifacts (approuter, srv, db) and one or more SAP Fiori Apps. As you already have an approuter in this scenario anyway, you could just use it for routing to your web apps as well.

      I guess it should also be possible to leave the approuter out entirely. Then you only had a srv and db module and you would need to add the "srv destination" somehow to your subaccount. But I haven't tried this yet so I don't want to promise too much now.

      I hope this answered your question.

  • Again great article Marius, thank you for your contributions to the community!

    One thing I want to point out: you position this concept as "serverless" and I think it might be mixed up with Serverless Architecture like FaaS / BaaS which is sort of "backend upon request". In your case I guess what you mean is serving HTML5 from the approuter without another "serving" app required, but if you go for a "full" setup with DB, APIs etc. you would still need a proper backend / server. Please correct me if I'm wrong.

    • Hi Maxim,

      I deliberately choose this bold title to create an association with FaaS. When talking about “serverless”, most people think of FaaS but to me, serverless is the more general concept of not having to worry about compute resources and perfect scalability. And this concept is also used here.

      You are right, in most of today’s use-cases with CAP, there will most-likey be a backend component such as the srv or db module. But that doesn’t need to be true by-default. You could also create destinations that point to the SAP Cloud Platform Serverless Runtime and then your entire stack would be serverless.

  • It works like a charm ! Thank you Marius.

    I finally found my mistake thanks to you.

    The issue was that the part was missing in my manifest.json.

    Best regards,


    • I have to admit that I haven't tried this because I don't work with the Workflow service. My gut feeling tells me that it should be possible.

    • Did you check the following documentation for Integrating SAP Cloud Platform Business Services:

    • Yes, it is possible.

      Just define route in xs-app.json to the correct router. Thats it.

      You can also can use such apps (deployed to saas router) in port site.

      You have to make destination with SaaS approuter - same as your custom approuter and then just use that destination in an application tile definition.

  • Hi Marius,

    First of all thanks for your clean explanation and effort I’m really getting benefit from your blog series.

    I’m trying to create some structure and guidebook for migrating our current Fiori applications (Standard, extended and custom) from NEO to Cloud Foundry cloud portal/launchpad service. I’m able to create custom application and deploy with or without approuter with BAS but the issues are starting;

    • When I try to adapt traditional Fiori aplications to the cf portal. I can’t able to use yeoman ui generators because it is not compatible with your structure or existing Fiori app’s structure. (When I try to add new html5 module to your Fiori MTA than it fails to create mtar archive)
    • I was trying to follow official migration steps, that document was not clear enough but at least it was something and I can’t reach anymore till from this morning. Migrating HTML5 Applications from the SAP Cloud Platform Neo to the Cloud Foundry Environment
    • S/4 is not available for us yet and we would like to complete this migration. I will appricate if you guide me to apply best practice for complete this neo to cf migration.

    Kind regards,


      • Hi Ari,


        • When I try to reach first link that you have shared I'm getting 403 error.
          • 403
        • If I follow your second link and try to search html5 migration guide, it brings me the link that I shared on previous comment and it is not reachable anymore. (issue started this morning)

        Kind regards,


      • Hi Marius,

        Thanks for your prompt response.

        I will try to migrate extended Fiori app (from NEO to CF) according to blog that you have shared, it looks promising.

        I tried to reproduce the other issue (it is not my primary focus for now) to explain you better. Briefly; I have cloned the repo , cd to managed-html5-runtime-fiori-mta and try to add new html5 module with:

        I'm using online SAP Business Application Studio because the local VS Code with yeoman generator extensions (Fiori) is not the same and has other major issues.

        $ yo fiori-module

        I’m selecting no auth and adding some flight service from our on-prem gateway.

        user: multi-cloud-html5-apps-samples $ cd managed-html5-runtime-fiori-mta/
        user: managed-html5-runtime-fiori-mta $ yo fiori-module
        ? Enter the module name sampleHTML5Module
        The "sampleHTML5Module" module will be generated in the "sampleHTML5Module" folder located at /home/user/projects/multi-cloud-html5-apps-samples/managed-html5-runtime-fiori-mta.
        ? Select the template you want to use SAPUI5 Application
        ? Do you want to add authentication? No
        ? Enter a namespace com.companyname
        ? Do you want to enable Karma tests? No
        ? Enter a view name View1
        ? Do you want to add a data service? Yes
        ? Select a system My SAP systems
        ? Select a source SOMEONPREMGATEWAY (Catalog)
        ? Select a service ZEXAMPLE_FLIGHT_SRV
        $ npm install
        $ npm run build

        The mta.yaml file is not correct anymore and it is giving the errors like below:

        2020-10-27 09:26:08] ERROR the "mta.yaml" file is not valid: 
        line 61: the "managed-html5-runtime-fiori-mta_html_repo_host" property set required by the "managed-html5-runtime-fiori-mta_ui_deployer" module is not defined
        make: *** [Makefile_20201027092608.mta:26: pre_validate] Error 1
        Error: could not build the MTA project: could not execute the "make -f Makefile_20201027092608.mta p=cf mtar= strict=true mode=" command: exit status 2
        npm ERR! code ELIFECYCLE
        npm ERR! errno 1
        npm ERR! managed-fiori@1.0.0 build: `mbt build`
        npm ERR! Exit status 1
        npm ERR! 
        npm ERR! Failed at the managed-fiori@1.0.0 build script.
        npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
        npm ERR! A complete log of this run can be found in:


        I’m aware that it can be fixed with editing mta.yaml manually but my target is avoiding manual editing and create some standard guide and use existing SAP standard tools, with this approach all developers can able to follow this standards to create/extend/migrate different kind of Fiori apps on the CF Portal/Launchpad.

        Kind regards,


  • Hi Marius,

    Thanks for the great blog! When you pull an app via the content provider HTML5 Apps, it doesn't allow you to change the app/tile settings. Is there a way to make such changes? In my scenario, I'd like to setup a couple of tiles for the same app, each passing a different set of params to the UI5 app to control its behavior.



    • I received the feedback that this is not possible at the moment 🙁
      A workaround could be the usage of multiple apps with slightly different manifest files or using the old approach for now.

      • Thanks Marius for your quick feedback. This really helps demystify that challenge that I was facing. For now, we have created a couple of versions of the same app as suggested. However, it would be really great if at some point soon SAP addresses this issue to avoid maintenance of multiple versions of essentially the same app.

  • Struggling with the destination settings

    How does this work if you want a connection to an HANA Cloud oData service

    I do not know the url beforehand so how can I set this in mta.yaml / destinations.json ?

    Is there some placeholder / variable I can use from my module (gen/srv) ?


    • Hi Bert,

      a really good question! I have to confess that I haven't found a good way to this myself yet. Usually, when we do have an approuter, we inject this destination via the environment variable. But this option is not possible as there is no approuter any longer. The best solution imho would be to use the "srv_api" placeholder and to use it to configure a destination in the mta.yaml - but that would be a new feature that needs to be implemented first.

      I'm curious how you create the HANA Cloud OData service. Are you using CAP? And if so, do you have an approuter involved? It might make sense to use this one to inject the destination.

      If not, I would create the destination manually for now.

      I hope I could answer the question at least partially.

      • Hi Marius

        Seems to work now.

        I copied the destinations.json in your example into my mta.yaml file

        My odata-service-module has a section:

             - name: kgk_srv_api
                 url: ${default-url}
        I am using this url property in my resource to create a destination with the correct url from my odata-service-module:
           Type: HTTP
           URL: ~{kgk_srv_api/url}
           HTML5.DynamicDestination: true
           ForwardAuthToken: true
  • Hi everyone,

    I have a (beginner) question about the "xs-app.json" files. Did I understand it right that you have to define two "xs-app.json" files when you want to use the HTML5 Application Repository Service. One for the application router and one for the UI5 web application?
    If yes, which definition do you have to do in the file for the app router and which in the UI5 web application? Especially for the "routes" definition?

    Is it right, that you have to define all the destination and external routes in the "xs-app.json" for the app router and JUST the following in the "xs-app.json" for the UI5 web application:

        "welcomeFile": "index.html",
        "authenticationMethod": "route",
        "routes": [				
            "source": "^(.*)",                                    
            "target": "$1",                                        
            "service": "html5-apps-repo-rt",
            "authenticationType": "xsuaa"                     

    Thanks in advance,


    • Hi Markus,

      If you want to go for the "managed approach", you only need one xsapp in the web app. You're right in case you want to use an approuter. In this case, it's up to you which xsapp file defines the route - both will be able to redirect traffic to the destinations you created. Be aware that the URL depend on the file that you defied them in.

      The section <Make your web apps “serverless”> explains this in more detail.


        • I'm not aware of an official best practice but I would recommend grouping the routes logically.

          Do you use one approuter for multiple (web) apps? Then that approuter should define the routes that all apps commonly share. Do you have routes that only one app needs? Then define them in the app itself.

          • Central approuter xs-app.json routes should be used for routes that are not html5 application dependent. For example if you use some backend application that also exposes a UI like x-ray or sap-analytics you can model the corresponding routes in central xs-app.json.

            Routes that are used by html5 applications (for example the html5 application backend), should be modeled in html5 application xs-app.json. The main reasons for this:

            a. html5 application and it's routes have a common lifecycle

            b. If you model routes in central xs-app.json, you will have to push and re-start the approuter on every route change, causing downtimes.


  • Can I make a non-fiori app also available in the Portal/LaunchPad?

    I created the minimal requirements for the manifest.json but the app is not getting visible in the Content Manager (also not if I refresh the saas_approuter)

    I am wondering if it is possible what I am trying to accomplish or is the LaunchPad / Portal strictly for Fiori apps?





  • hello Marius Obert ,


    where can I find log from that Saas approuter? In normal approuter you can go into space and in detail of approuter application, you can find events and logs. Is it possible to find something similar in saas one?

    • Hi Balko,

      In your subaccount, in SAP Cloud Platform Cockpit, you can access HTML5 Applications UI (from the side-bar menu). For each application, it is possible to see the relevant runtime logs in the actions column.

      Please try it out and let me know if it covers your requirement.

      Best Regards,



      • Hello Ari Lulu ,

        I`m aware of that possibility (logs for apps in html5 menu) but that logs are always empty - I dont understand why. So I guess, that should be some other logs.

        My problem is, that I have UI5 app deployed to SaaS app router and that app uses workflow API. I added wf into requires (into resources also), but I still got html 500 error when I try to call wf api.

        Here is part of my mta.yaml

        - name: capexui-destination-content
          - name: uaa_capex
                name: uaa_capexUI-key
          - name: capex_html_repo_host
                name: capex_html_repo_host-key
          - name: destination
              content-target: true
          - name: wf_zentiva
                name: capex_wf-key
                - Name: showCapex_capexUI_html_repo_host
                  ServiceInstanceName: capex_html_repo_host
                  ServiceKeyName: capex_html_repo_host-key
                - Authentication: OAuth2UserTokenExchange
                  Name: showCapex_uaa_capexUI
                  ServiceInstanceName: capex-ui-xsuaa-service
                  ServiceKeyName: uaa_capexUI-key
                - Name: showCapex_capexUI_wf
                  ServiceInstanceName: wf_zentiva
                  ServiceKeyName: capex_wf-key
                existing_destinations_policy: update
        - name: wf_capex
          type: org.cloudfoundry.existing-service
            service: workflow
            service-plan: standard


        Marius Obert do I need to add also destination into parameters: content: subaccount for wf? How to add it in case of existing service?

        • Yes. a destination to bs is required:

  • Hi Marius,

    great informational blog!

    Dou you know maybe any documentation ressource concerning exposed business service api's from SAP Managed ApPRouter?

    I am currently using comsapuitheming.runtime, but i am missing an overview off available business services (like new approuter sap-approuter-userapi and especiall addtional UX endpoints).

    Best regards

      • All business services are actually the services available in the market place.

        You can see all available services here:

        sap-approuter-userapi is a special service provided as part of approuter application: