SAP Tech Bytes: FAQ Managed Approuter vs. Standalone Approuter
In the past two years, I wrote a few posts that explained the nature of the managed approuter and when it can be helpful to use this feature (here and here). In parallel, we created a GitHub repository that contains sample projects and diagrams to make the differences between both options more tangible. Overall, there’s a lot of content that explains why it makes sense to favor the managed over the standalone approuter. (I highly recommend that you make yourself familiar with the linked resources above if you don’t know them yet). Once you read the content, you have a good understanding of the managed approuter’s advantages. And with this, it makes sense that the managed option is the default setup for newly generated SAP Fiori apps in the SAP Business Application Studio.
Update: August 2021: Added a new question Q9
But, naturally, many developers are new to SAP Business Application Studio and SAP BTP, which can cause confusion about the standalone approuter (as they only know the managed approuter). For those developers, I compiled this short FAQ to help them understand the differences when you come “from the other direction”:
Q1: Is the managed approuter a service in SAP BTP?
No, the managed approuter is not a service. It is a feature of various SaaS subscriptions that SAP provides in SAP BTP. Both the SAP Launchpad service and the SAP Cloud Portal service come with that feature. This is why you don’t find the managed approuter in the Discovery Center.
Q2: Why don’t I see my app in the Cloud Foundry space?
A: Cloud Foundry spaces only contain applications that consume runtime memory. HTML5 applications won’t show up here as they are a set of static content files (.html, .js, .css) that are run by the browser. In SAP BTP, HTML5 Applications are stored in HTML5 Application Repository service. During runtime, HTML5 Application files are served to the browser by the managed or standalone approuter.
If you have a standalone approuter, you will see it in the space, unlike the HTML5 Applications hosted in HTML5 Application Repository. These applications can be visualized using HTML5 Applications UI (in the SAP BTP Cockpit) or via cf html5-list.
Q3: I used the default option (managed approuter) when I created the SAP Fiori app, and I could deploy it. But now I get the following error “Error No client with requested id”. (or here)
A: This most likely means you didn’t subscribe to the correct subscription service. As mentioned above, here are two services: The SAP Launchpad Service and the SAP Cloud Portal service, both of which should work for what you want to do. Make sure you are subscribed to these subscriptions. Depending on your account, you might also see service instances with these names. Please don’t use service instances for this; they won’t help you here!
The URL of the managed approuter contains either
cpp (pointing to the SAP Cloud Portal service) or
launchpad(pointing to the SAP Launchpad service). Both segments are substitutable, but you need to verify to use the segment of your enabled subscription.
Q4: Can I change the URL of the managed approuter?
A: Th default URL is determined by the subscription service and your subaccount subdomain. But you can change the URL in production accounts via the custom domain service.
Q5: When using the managed approuter, should I use subaccount- or instance-level destinations?
A: Instance-level destinations should be used from now on forward as they avoid subaccount-wide access and enable better mta lifecycle handling. Note that when undeploying with instance-level destination, the destination configurations get deleted as well, unlike subaccounts destinations.
Q6: I neither want to use the SAP Launchpad Service nor the SAP Cloud Portal service. Can I use the managed approuter anyway?
A: You can subscribe to these products just to get managed approuter functionality (no need to model launchpad tiles, etc.); just run the applications from HTML5 Application UI. We recommend using a standalone approuter only if you need to implement approuter extensibility for some special use cases.
Q7: How can I build an SAP Fiori app that leverages the standalone approuter?
A: The SAP Business Application Studio offers a shortcut for the default option that uses the managed approuter. Look at this video which explains the longer flow (create empty MTA, add managed approuter, add Fiori app). Follow this flow but select the “standalone” approuter when prompted. I also added a few screenshots below that you can follow to see all the needed steps.
Q8: Can I change the URL of the standalone approuter?
A: Yes. The default URL can be customized via the “host” property of the mta.yaml file. The
*.cfapps.eu10.hana.ondemand.com-suffix is usually given, but you can change this as well with a custom domain.
Q9: Can I use the approuter to host web apps that provide UI5 flexibility features?
Yes, this is possible with both options. If you use the standalone approuter, you need to integrate it with a key-user service instance and make some configuration changes. In case you go with the managed approuter, you don’t need to integrate this service. It’s worth mentioning that this option currently doesn’t allow key-user changes. Other features of the UI5 flexibility service such as custom filter variants will work out of the box with the managed approuter if you embed the application in an SAP Fiori Launchpad.
Q10: I want to built an application that can handle multiple tenants. Which approuter option should I choose?
As of September 2021, MTX apps are not supported by the managed approuter. Therefore, you should go with the standalone approuter in this case.
Attachment to question 7:
Now you are ready to build and deploy the project with the standalone approuter.
you mentioned Portal and Launchpad. Does this also work with the SAP Workzone for HR subscription?
Hi Martin, SAP WorkZone for HR only offers limited usage for HR Szenarios. It has to be setup the same way like other Editions of WorkZone or Launchpad.
What Sissy says 🙂
You have mentioned the recommendation of "using a standalone approuter only if you need to implement approuter extensibility for some special use cases." Do you have any further advice or clarification on approuter choice in the case of multi-tenant web app development?
Good point! As of now, I'd say that multi-tenancy requirements are also a legit use case for a standalone approuter.
Can we still configure the managed approuter with environmental variables, for example to send custom headers?
yes and no. It is not possible to change the environment variables for the managed approuter BUT you can make use of all properties of the xs-app.json configuration file:
With the custom response header property, you can add headers, which the application router returns to the client in its responses.
The property is an array of objects, each object having the following properties:
The blog was very useful and informative related to Application router Feature in BAS (IDE).
I had created an MTA Project , the project structure is
and then Deployed the Application to CF Space. while logging in to CF in terminal through Commands.
I am able to get Application URL but unable to open the App when opened the URL showing "Not Found".
The App is working fine Business Application Studio but after deploying the Standalone App to CF Space the application is getting Visible in my Dev Space but when clicking on the generated URL it is showing the Not Found Error.
Could you please help me out with this issue.
Thanks in Advance.
It seems like a route points to a target but the approuter cannot find anything there. This could either mean the route points to the wrong target or that the target is right but empty.
Here are a few questions that might guide you to the solution:
Where does this route point to?
Is there something at the target (either in the local directory or in the HTML5 app repo)?
Does the log of the approuter provide any additional information?
Here there is no target i.e.., no destinations I have taken a sample App with static Data, created app with standalone appRouter and deployed it to Cloud Foundry Space there after deployment I can get the App is started and App URL but when I am opened it is getting either "Not found" or "Internal server error" .
I tried with managed approuter, deployed the app to CF space, app getting started but still same I am getting like shown below
I have sample Static data in my application which runs fine in BAS but when I deploy the same app and after clicking on the generated URL it is showing error.
please let me know where I am getting wrong do we need to add any piece of code in package.json, xs-app.json, ui5.yaml files to get the app to be displayed. In Xs-app.json file given
So you added your web app manually and did not follow the wizard to add it, right?
This would explain why the connection between the approuter and the HTML5 application repository isn't working.
Can you execute "cf html5-list" from the terminal to see whether the web app has been uploaded to the HTML5 application repo?
The next step, would then be to change the xs-app of the standalone approuter to point to this web app like shown here.
No I didn't add webapp Manually I followed the wizard process only while creating the Application. If I execute the "cf html5-list" the application is successfully uploaded to HTML Application repo. But I am unable to get the Application Displayed and I tried with taking destination while connecting to Odata Service if I tried to deploy in CF Space it is showing
"For application 'Demo': Routes cannot be mapped to destinations in different spaces"
in terminal while I try to push the App to CF.
I would assume that something is wrong with your destination. Can you confirm that the destination that you referenced in the xsapp exists in your target space?
No Actually I didn't taken any Destination at first I have taken sample UI5 App without any Destination only with static Data to load UI. Later I tried with Northwind.
With Destination xs-app file code
but still same problem persists.
WIthout Destination xs-app.json file
Now needed without destination just UI to load in the App. Have deployed the app to CF Space, the generated URL is not getting opened showing some errors like follows:
"Not Found", "Internal Server error" or "Requested route does not exists"
Either By taking MTA or Freestyle SAP UI5 Template getting same issue, URL is not getting opened.
Suggest me where I goes wrong.
Thanks in Advance
You use destinations in both cases. The upper file uses a "northwind" destination and the lower one uses a "ui5" destination.
If you use any type of destination, you need to (a) create a destination service instance, (b) bind it, and (c) add the destination configuration (this tutorial might help you).
if we use the UI5 as destination we wont take any service right so we couldn't bind anything. what is the use of creating the destination service instance, after creating the Destination service instance, what is the next process.
I followed the same what was given in tutorial. I am able to access the Entitysets and able to bind. But after deploying the App to CF. The Application generated Routes URL doesn't work. This is the main issue I am facing.
I think you might have missed a step in the wizard or in the instructions. I can confirm that the scenario works as I described it above.
Please mind the captions of the screenshots above.
Thank you. I will follow like you described above.
Hi Mamatha, same happened to me, you need to check the file xs-app.json inside the approuter directory and be sure there is a destination, I had to add it manually, try something like this:
Hope it helps.
Thanks for quick reply, Actually I don't have any destination as I am doing without destination static data but I will try now adding destination and will let you know.
I have the same problem ,
Did I find the solution?
Is it possible to change approuter config from managed to standalone? If yes, can you pls guide how it can be done?
are you asking for a "wizard" option to change the selection that has been made previously? The answer to this question would be no, it's not possible.
But you can remove the files of the standalone approuter and then add a managed approuter manually (and vice-versa). That works.
Thanks for your response.
Incase I want to change approuter configuration from Managed to Standalone, which files should I be deleting, as I don't see any files related to approuter in case of managed. Please advise.
In this case you need to remove some lines of the mta.yaml. You can find a list of the respective lines in this post (in section 'Make your web apps “serverless”')
Thank you for the blog post and the valuable information about the Managed App router!
Could you please tell a bit about the support of the Managed App Router for Single Sign-On scenarios?
Thanks a lot in advance!
SSO is not a feature of the approuter per se (that depends on the IdP), so it doesn't differentiate from the standalone approuter.
We have a development scenario where we have a SAP Cloud Freestyle Portal with Ui5 applications in the Cloud Foundry Environment.
As per functionality we have to use Assertion attributes passed by Custom IDP in the ui5 applications. We have achieved this by using Standalone Approuter with User Api service and Jwt decode.
The issue with this approach is that this is causing issues at Portal level with Custom Themes and Cross- Navigation between apps as the ui5 apps have to be deployed as Iframe objects with Dynamic URL configuration on the Portal.
We did not use Managed approuter approach as the Ui5 app did not have access to the approuter which resulted in us not getting access to assertion attributes.
Is there a way to get assertion attributes at app level using Managed Approuter?
That's a good question. But I need to confess that I'm totally blank on this topic. I did ask a colleague and this is the response that I got:
I hope this helps (as this is the only answer I can provide). But it'd be great if anyone else from the community could jump in here.
Is it possible to let Managed Approuter be the router(or proxy server) for micro-services deployed in BTP CF(like the services developed with CAP)?
Thanks & Best Regards,
Nice idea 🙂
Yes, that should be possible! But you need to have a (dummy) web app that contains a xs-app.json file and this file needs to reference destinations that point to your microservices.
first time a nice blog and thanks for sharing!!
I have the following problem, I use the SAP-Approuter and my request to the backend is greater than 30 seconds, normally these settings are set in the destinations for the Approuter, but since this does not exist, I currently can not find a setting how I can override the attribute "timeout". Do you know a way to do this?
Thanks & Best Regards
Have you tried to use the destination property "timeout" (mentioned in section "environment destinations")? I haven't used this particular one but I would assume that it does the job.
If that doesn't help, you might fall in the "customization" category where you need to use the standalone approuter.
thank you for your Help.
I have solved my problem by adding the "timeout" in the mta.yaml in the subsection of my cap-service.
Where exactly did you put the timeout property? Would be helpful for us as well
How to run HTML 5 module with Stand alone App router locally from Business Application Studio
You usually don't run the standalone approuter in the SAP Business Application Studio but you use the Fiori Tools that start a development server that exposes the static content. The appserver is usually only run when the project is deployed.
That doesn't mean you cannot run the approuter as well. But in this case, you need to take care of mapping the right values in the default-env.json.
Hi Marius, In case our API requires an API key, we NEED a standalone approuter to set it to all API calls. Is it the right understanding?
Having said that, it is probably possible to solve that API-key-problem with SAP API Management and then you'll be able to use the managed approuter as well.
Thanks for your good blog!
I have two questions about scalability of managed application router.
As you know, in the case of standalone application router, it can be scaled out using autoscaler.
Can managed application router be scaled-out?
if possible, how can I do it?
How can I monitor the managed application router?
Just in the case we have a performance issue, we should have the way that we can check if the standalone application router is root cause of the performance issue or not in the production system.
A1: That's the cool thing about the managed approuter. It's managed for you and you don't need to care about scaling 🙂
A2: You can use the CF CLI (or other tools) to check on the resource consumption of the standalone approuter. Or are you looking for something else?
Question 2 is the question about how to check the resource consumption for the MANAGED approuter, not the STANDALONE approuter.(Sorry, It seems that I wrote "standalone" in the question2....It was my mistake..) But thanks to the A1 I could understand monitoring the managed approuter is not needed, because the managed approuter is perfectly managed like any other BTP CF services.
Here again, thanks, Marius!
We need to switch from the SAP Cloud Portal Service to SAP Launchpad Service soon.
At the moment we use standalone approuters for our apps. We need access to shell functions such as CrossApplicationNavigation and therefore integrate the apps into our launchpad via a destination to the approuter and the component name of an app. To do this, we need an FLP module for the standalone approuter, which is no longer available with the SAP Launchpad service.
We thought about to switch to managed approuter but first wanted to check if it´s still possible with our current solution. Is there a similar or even better option in the SAP Launchpad Service?
I don't see why it shouldn't work but I should also say that I haven't tried this before.
the problem is, that we don´t have the SAP Cloud Portal Service in the subaccount in the future. Our current solution uses, as said above, the FLP module for the standalone approuter. The flp module uses a service that is an instance of the portal service. The SAP Launchpad Service is just a subscription, therefore we can´t create the instance needed for the flp module.
Is there another way to integrate apps, that running with standalone approuter, in the launchpad with access to shell functions (CrossApplicationNavigation)?
Fyi: Other solutions like direct integration via URL or dynamic URL didn´t work unfortunately. At the moment the possibility to expose the standalone approuter as content provider via provisioning service is not an option.
You should use a subscription, according to the way I understand it. The service instance (aka the launchpad module) was only a temporary solution and not intended for production use-cases.
Yes we use the subscription of both, the SAP Cloud Portal Service (past) and the SAP Launchpad Service (now) as central Launchpad for the apps. The service instance was just the "enabler" to integrate the apps in the launchpad (subscription of the services) by using the Standalone AppRouter to provide them.
I see. I'm afraid I'm (as of now) not aware of another service instance that can take over the role of this "enabler" for you.
I've created a Freestyle Fiori app which is using a managed app router. I am using a destination to connect this app to an iFlow developed in CPI. While I am able to invoke this destination just fine while running the application locally from within BAS, once I deployed this application to CF, I'm always getting a 401 while triggering this destination. Since the destination is working fine locally and also from postman using the same credentials I am able to reach the CPI iFlow, I do not think if auth credentials have something to do here. Can you advise what might be the problem here?
Not sure what might cause this. Maybe it helps if you try to run this in a standalone approuter to see if it works then?
Marius Obert Hi Marius,
I have created Fiori App using Managed app-router. Please let me know how to access logged in user detail from cloud foundry using managed app router.
for this, you need to use the included User API service with a dedicated route. You can find all details and a sample here.
Thanks for the wonderful blog.
I was trying to build and deploy MTA application using Managed App Router also followed complete SAP developer tutorial . But when I deploy application and try to access it using given command cf html5-list -di <APPNAME>-destination-service -u. It gies the URL. But when I am opening the app in new tab it is giving me internal server error. It is also not showing in HTML5 repository.
I have the correct destination reference also in my XS-app.json and also I created the application using wizard. Any hint what is getting wrong?
Below is the screenshot for reference.
I noticed you also asked the question here so I suggest to use the Q&A instead as it's more suited for your kind of question.
About the enviroment variables of managed approuter , can it be changed by requesting an incident ?
I'm not sure if I understand, which env vars are you referring to? The managed approuter is not an application and there has no env vars that are exposed to the user.
The env var is 'INCOMING_CONNECTION_TIMEOUT'.
Ah, I see. You want to set environment variable for the managed approuter.
No, this is not possible.
How are timeouts managed in that case? Is there any way to increase that?
Marius Obert, thanks for the blog!
We are subscribed to the free tier SAP Launchpad service in our Pay-As-You-Go subaccount, but I do not see the Managed App Router on the HTML5 Repository screen like I see in the trial account. Also, I cannot access my HTML5 Apps content provider from the Launchpad application. I don't see any documentation in the discovery center regarding the Managed App Router being limited to Standard plans, so why can I not use it in the Free plan?
Marius Obert , oddly I was able to resolve my own issue. I deleted the Launchpad subscription, then created it again - viola! The HTML5 Repository now has the "Managed App Router provided by SAP Launchpad" header and the HTML5 Apps provider appears in the Launchpad application. So, for anyone else who encounters this issue, delete the subscription and create it again. A "special" feature of Cloud Foundry, I guess.
Hi Marius Obert and all others here,
thank you for this and all the other blog and you numerous answers to the questions.
Unfortunatly I have to ad another question: In some cases I need to do a additional request in a standalone server to an onpremise server.
I have already a beforeRequestHandler and noticed that in req.app.services are the details to connect to the destination and connection services.
However I am lacking some example code how to best do a second request inside beforeRequestHandler. Is anybody aware of such a code snippet?
Thank you all, have a great time and stay healthy,
Marius Obert thanks for the blog!
I would appreciate if you could look at SAP BTP Launchpad Services- Integrate the REST API via Destination Service for Fiori app so as to share your thoughts.
Thanks for the blog.
Testing SAP BTP destinations with standalone approuter, as described here
Is the above possible with Managed approuter (SAP Build Workzone - Standard Edition)? No fiori apps, or HTML5 apps, just expose the external on-premise application using managed approuter.