Saturday 24 August 2024

What is SAP Approuter and its importance?

Introduction


SAP Approuter is a lightweight service, which acts as a single point of entry for various back-end services and applications in SAP ecosystem. In many SAP cloud foundry enterprise applications, Approuter plays an essential role in tying together different pieces of the application landscape and ensuring smooth user experience. In this blog, I am going to share my learning on Approuter and its usage.

What is SAP Approuter


SAP Approuter is a Node.js library used as a single point-of-entry to an enterprise application. The Approuter is used to serve static content, authenticate users, rewrite URLs, and forward or proxy requests to other micro services while propagating user information.

Which environments Approuter can be used in


  • SAP Cloud Foundry, SAP BTP
  • SAP XSA – XS Advanced (On Premise)
  • Kyma Runtime (Standalone Approuter)

Types of Approuter available in SAP BTP


There are two types of Approuter available in SAP BTP, which can be used for the applications deployed in SAP Cloud Foundry.

  • Standalone Approuter :
    • Standalone Approuter needs to be setup and run by application owner, it allows customization/extension as per application need.  
  • Managed Approuter :
    • Managed Approuter is provided by SAP, so application owner need not to maintain own runtime infrastructure.
    • The Managed Approuter is the HTML5 applications runtime capability that is provided by the following products. To use the managed application router, we must be subscribed to one of these services.
      • SAP Build Work Zone, standard edition
      • SAP Build Work Zone, advanced edition
      • SAP Cloud Portal
  • SAP recommends to use Managed Approuter if there is no extension required.

Primary features and functionalities of SAP Approuter

  • Request Routing: The Approuter can route incoming requests to different microservices, or applications based on the URL pattern.
  • Authentication and Authorization: The Approuter is tightly integrated with the SAP Cloud Platform’s authentication and authorization mechanisms. It can facilitate user authentication via various methods like SAML, and then manage user sessions.
  • Destination Resolution: In the SAP Cloud environment, a “destination” is a predefined set of configurations that point to a specific backend system or service. The Approuter can resolve these destinations and direct the requests appropriately.
  • Service-to-Service Calls: Approuter supports scenarios where services need to communicate with each other without the need for user intervention.
  • Serve Static Content: It can also be configured to serve static content, such as HTML, CSS, and JavaScript files.
  • Integration with XSUAA: SAP’s User Account and Authentication (XSUAA) service is commonly used for authentication and authorization in the SAP Cloud Platform, and Approuter is well-integrated with it.
  • Extension and Customization: The Approuter is built on Node.js, which means that developers can extend its capabilities or integrate it with other Node.js modules if needed.

Approuter project structure and it’s components.

<myApproute>

  |- xs-app.json               # Application routes configuration

  |- package.json              # Application router details/dependencies

What is SAP Approuter and its importance?

What is SAP Approuter and its importance?

Architecture diagram of an application

Suppose we have a requirement to develop a Project Management solution for one of the organizations having SAP BTP. The solution needs to integrate with SAP SuccessFactors for employee’s HR related information and needs to integrate with SAP On-premises system for other information. In this case we can develop an SAP UI5 based application for user interface and APIs in Java Spring boot / node JS to save or read data on HANA Cloud DB and to interact with APIs/OData services from SAP and SuccessFactors system. The APIs will be available publicly as this is hosted in SAP BTP, so it is very important to securely expose the APIs by using SAP BTP’s authentication and authorization service, which can be easily done by using SAP Approuter. Here is the architecture of the application.

What is SAP Approuter and its importance?

No comments:

Post a Comment