Connectivity, Destinations and Cloud Connector

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

An application you build on SAP BTP rarely lives alone. The partner dashboard of Example Trading Co. (EX01) needs the business partners that sit in the company’s own SAP S/4HANA system, and that system may be on the Internet or inside the company’s private network, behind a firewall that allows no incoming connection from outside. This page explains the three pieces SAP BTP offers for that job. A destination is a named entry that holds the address and the sign-in details of the target system, so the code only knows the name. The Destination service stores those entries and runs the sign-in steps. The Connectivity service, together with a small program called the Cloud Connector that you install inside your network, carries calls to systems that no one outside can reach. It then shows how a CAP application (the Cloud Application Programming Model, SAP’s framework for services) points at a destination from its configuration. It is written for CAP Node.js 10.2 (@sap/cds 10.2.2, Node.js 22.12 or newer) and CAP Java 5.2 (Java 21 or newer, Java 25 recommended), and it says for each fact whether it holds on Cloud Foundry, on Kyma, or on both. SAP BTP is still the documented product name; SAP now presents SAP BTP capabilities as part of SAP Business AI Platform.

Before you read

  • Deployment Options: where SAP S/4HANA runs (on premise, Private Edition, Public Edition), which decides whether a Cloud Connector is needed at all.

  • Security and Operations: the communication destinations, least privilege and TLS ideas that destinations rely on.

  • Clients and System Landscape: why a company has development, test and production systems, and so more than one destination target.

  • A general picture of SAP BTP: a global account holds subaccounts, and the services and apps live in a subaccount.

Key terms

  • Destination: a named set of connection details (target address, proxy type, sign-in method) that an application looks up instead of hard-coding them.

  • Destination service: the SAP BTP service that stores destinations and performs the authentication flows configured in them.

  • Connectivity service: the SAP BTP service that, with the Cloud Connector, lets an application reach systems that run on premises.

  • Cloud Connector: a program you install in your own network that opens a secure tunnel to SAP BTP and exposes only the systems and paths you allow.

  • Virtual host: the made-up host name the cloud side uses for an internal system, which the Cloud Connector maps to the real internal host and port.

  • Subaccount: the unit of an SAP BTP global account in which you run applications, bind services and keep destinations.

The three pieces and how they fit

SAP’s Connectivity documentation describes SAP BTP Connectivity as the set of features that let an application consume or push data to systems that are directly reachable, hosted in public or private clouds, or located on customer premises. Its starting page lists the parts and their jobs.

  • The Destination service lets you find the information that is required to access a remote service or system from your cloud application. It manages routing and authentication details and performs the authentication flows based on the configured details. SAP recommends it for storing the connection configuration (credentials, certificates, URL, headers, queries) at design time and for automating the OAuth2 token retrieval at runtime.

  • The Connectivity service offers the services and software components that let SAP BTP applications securely access remote services that run on premises. Together with the Cloud Connector it provides a secure tunnel from your on-premise network to SAP BTP, and no network ports need to be exposed on the on-premise side.

  • The Cloud Connector is a standalone component installed and configured locally in your on-premise network. SAP describes it as a reverse invoke proxy within a secured network, giving fine-grained control over the accessible on-premise resources.

For an application that talks to an on-premise system, the Destination service is used together with the Connectivity service. For any other web application, the Destination service can be used without the Connectivity service. The Connectivity and Destination services are built-in services of the multi-cloud environment, and the on-premise use cases are also applicable to virtual private cloud (VPC) environments.

Cloud Foundry and Kyma differ in the middle

Both environments use the Destination service. They differ in how a call to an on-premise system reaches the Cloud Connector.

  • Cloud Foundry: the application binds the Connectivity service, and SAP recommends the Cloud Connector together with the Connectivity service for a secure connection between Cloud Foundry applications and on-premise systems.

  • Kyma (Kubernetes): SAP lists two extra components. The Connectivity Proxy is a Kubernetes component that connects workloads on the cluster to on-premise systems exposed through the Cloud Connector, and the Transparent Proxy exposes destination targets as Kubernetes services and automates the handshakes with the Connectivity Proxy. Both are available as modules in the SAP BTP, Kyma environment and as standalone components.

The path of one call

The figure follows one request of the partner dashboard when EX01’s S/4HANA system is on premise. The left part runs in your SAP BTP subaccount, the right part in your own network.

flowchart LR A["CAP app: partner dashboard"] -- "looks up the name EX01-S4HANA" --> D["Destination service: URL, ProxyType, Authentication"] D -- "ProxyType OnPremise" --> C["Connectivity service"] C -- "secure tunnel" --> CC["Cloud Connector in the EX01 network: virtual host to internal host"] CC -- "only allowed hosts and paths" --> S[("S/4HANA system")]

In words: the application asks for a destination by name, the Destination service returns the address, the proxy type and the authentication details, and for the proxy type OnPremise the request goes through the Connectivity service to the Cloud Connector, which forwards it to the internal system. For a destination of proxy type Internet the application connects directly to the external service.

What a destination holds

An HTTP destination is created in the Destinations editor of the SAP BTP cockpit (Connectivity, Destinations in the subaccount menu). The steps SAP lists are: choose Create, From Scratch; enter a destination name; choose the type HTTP; optionally add a description; choose the Proxy Type (Internet, OnPremise or PrivateLink); specify the URL; choose the Authentication; and optionally add additional properties. If you set an HTTPS destination you also need to add a trust store, and for OnPremise connections you must enter a Location ID only if you use more than one Cloud Connector for the subaccount.

The proxy types that the Connectivity service supports are these.

Proxy type Meaning

Internet

The application can connect to an external REST or SOAP service on the Internet. This is the default value.

OnPremise

The application can connect to an on-premise backend system through the Cloud Connector.

PrivateLink

Selected SAP BTP services can establish a private connection with selected services in your own infrastructure-as-a-service provider accounts.

The proxy type is stored in the destination property ProxyType. For the authentication, SAP lists, among others, No Authentication, Basic Authentication, Client Certificate Authentication, Principal Propagation SSO Authentication for HTTP and several OAuth variants, including OAuth Client Credentials Authentication and OAuth SAML Bearer Assertion Authentication. For most types you can add custom headers and query parameters as additional properties named URL.headers.HEADER_KEY and URL.queries.QUERY_KEY, where you replace the last part with the real name. They are added to every communication with that destination, though SAP notes that not every client supports this.

A destination as JSON

SAP’s Basic Authentication page shows a destination as a small set of properties: Name, Type, ProxyType, URL, Authentication, User and Password. The listing below uses exactly those property names for EX01’s S/4HANA system behind a Cloud Connector, with the proxy type OnPremise. The name EX01-S4HANA and the virtual host ex01-s4.virtual are teaching names defined by this page, and the user and password are placeholders for a technical user.

The listing requires an SAP BTP account; not run here.

{
  "Name": "EX01-S4HANA",
  "Type": "HTTP",
  "ProxyType": "OnPremise",
  "URL": "http://ex01-s4.virtual:8000",
  "Authentication": "BasicAuthentication",
  "User": "<technical-user>",
  "Password": "<password>"
}

Source: Basic Authentication (property names) and Destination Examples (an on-premise destination with the proxy type OnPremise)

The host and port in URL must match a virtual host and virtual port in the Cloud Connector, as the next section explains. The password stays out of any file in a repository; it is entered in the cockpit or the Destination service, never in the application code.

The Cloud Connector and its virtual host

The Cloud Connector is installed in your network, and an administrator tells it which internal systems and which URL paths the cloud may use. The configuration lives under Cloud To On Premises in the Cloud Connector’s subaccount menu, on the tab Access Control, where you add a mapping with these values.

  • Internal Host and Internal Port: the real host and port of the target system inside the intranet. The address must be real and reachable by the Cloud Connector.

  • Virtual Host: the host name exactly as specified in the URL property of the HTTP destination in SAP BTP. SAP states that the virtual host can be a fake name and does not need to exist.

  • Virtual Port: lets you tell different entry points of the same system apart, for example HTTP on 80 and HTTPS on 443, and keep separate access settings for them. It is prefilled with the internal port; if you do not change it, the cloud-side destination must use the internal host and port.

  • Protocol: whether the Cloud Connector uses HTTP or HTTPS toward the back end. This is independent of the cloud-side setting, so a destination with an http:// URL can still lead to an HTTPS connection to the back end.

  • Allow Principal Propagation (from Cloud Connector 2.15): whether the identity of the signed-in user may be sent to the back end over this mapping.

A mapping alone allows nothing. SAP says the Cloud Connector uses strict allowlists: you must also list the URL paths (Resources) that may be called on that host, and all other requests are denied. A path can be allowed as Path only, or as Path and all sub-paths; for the partner dashboard that would be the path of the business partner service and its sub-paths, not the root of the system. The path name is case sensitive. When you save a mapping, the Cloud Connector pings the internal host and shows the state Reachable or a warning, and the check can be repeated later.

Because the virtual host is only a name, the cloud side never learns the real internal host, and you can later point the same virtual name at a backup system without changing the destination. SAP notes that you cannot edit the virtual name of an existing mapping; to use a different name you delete the mapping and create a new one.

If a subaccount uses more than one Cloud Connector, each gets a Location ID, and the destination names the Location ID of the target Cloud Connector (the field Location ID in the cockpit editor).

Naming a destination in CAP

A CAP application consumes a remote system as a remote service: it models the external API (for example an imported OData definition) and reads from it like from a local service. CAP uses the destination capabilities of the SAP Cloud SDK, and in the configuration you give the name of the destination instead of an address. In CAP Node.js the entry sits in cds.requires under the service name, and the destination name goes into the credentials block, usually with a path that is added to the destination’s URL.

The archived CAP guide wraps the destination in a [production] block, because you do not want to use it for local testing. The next listing is a teaching configuration for the partner dashboard: the service is named partners (the name is defined here), the model path srv/external/partners is the place an imported API definition would go, the destination is EX01-S4HANA from the previous section, and the path is the one the archived guide uses for the business partner service. destinationOptions with selectionStrategy set to alwaysProvider makes the destination always be read from the subaccount in which the application runs. This configuration was checked for real in a copy of the expenses lab (scratch directory g9-114) with cds env get, which prints the merged configuration; it does not contact any destination.

"cds": {
  "requires": {
    "partners": {
      "kind": "odata",
      "model": "srv/external/partners",
      "[production]": {
        "credentials": {
          "destination": "EX01-S4HANA",
          "path": "/sap/opu/odata/sap/API_BUSINESS_PARTNER"
        },
        "destinationOptions": {
          "selectionStrategy": "alwaysProvider"
        }
      }
    }
  }
}

Running npx cds env get requires.partners in the project gives the development configuration, and adding --profile production activates the block. This is the real output, unshortened.

$ npx cds env get requires.partners
{
  "impl": "@sap/cds/srv/remote-service.js",
  "external": true,
  "kind": "odata",
  "model": "srv/external/partners"
}

$ npx cds env get requires.partners --profile production
{
  "impl": "@sap/cds/srv/remote-service.js",
  "external": true,
  "kind": "odata",
  "model": "srv/external/partners",
  "credentials": {
    "destination": "EX01-S4HANA",
    "path": "/sap/opu/odata/sap/API_BUSINESS_PARTNER"
  },
  "destinationOptions": {
    "selectionStrategy": "alwaysProvider"
  }
}

Source: output of cds env get with @sap/cds-dk 10.2.1 and @sap/cds 10.2.2 in a copy of the expenses lab; the property names come from the archived CAP guide above.

Without the profile there is no credentials block, so a local run does not look for a destination. With the profile the remote service has the destination name and path it needs at runtime. At runtime, the Destination service must also be reachable from the application, which the deployment section below covers.

The archived guide also says that a property can be set in the deployment by an environment variable whose name follows the configuration path with underscores as delimiters, and that the service name must not contain underscores. The scratch run agreed with this rule: with the service named PARTNER_API an override variable had no effect, and with partners the override cds_requires_partners_credentials_destination took effect.

The same idea in CAP Java

In CAP Java the remote service is configured in Spring Boot’s application.yaml, and the destination name goes under destination in cds.remote.services. The listing follows the archived guide’s example and requires an SAP BTP account; not run here.

cds:
  remote.services:
    API_BUSINESS_PARTNER:
      type: "odata-v2"
      destination:
        name: "cpapp-bupa"
      http:
        suffix: "/sap/opu/odata/sap"

Source: Consuming Services (archived CAP guide), section Use Destinations with Java

The names API_BUSINESS_PARTNER and cpapp-bupa are the guide’s own example names. On a multitenant application, the same guide says the Java property retrievalStrategy with the value AlwaysProvider is the counterpart of the Node.js selectionStrategy.

Which account is read

For a multitenant application the guide explains that the destination is read from the tenant of the request’s JWT token, which is the subscriber subaccount, and for Node.js also from the tenant of the application’s XSUAA binding (the provider subaccount) if no token is present or the destination is not found. That is why a provider can fix a destination name and each customer creates a destination with that name in their own subaccount, pointing at their own S/4HANA system. Setting alwaysProvider ensures a subscriber cannot overwrite your destination.

Source: Consuming Services (archived CAP guide), sections Destinations and Multitenancy and Destination Resolution

Application defined destinations

You can also skip the BTP destination and put the destination properties in the configuration, in credentials. The guide lists the supported properties for these application defined destinations: url, authentication, username, password, headers, queries and forwardAuthToken. Supported authentication types include NoAuthentication and BasicAuthentication in both runtimes. Note the different spelling: the cockpit and Destination service use URL and Authentication, while the application defined form uses lower-case url and authentication. The guide warns against putting sensitive information into this configuration and says to set such values from code or the environment.

This page keeps to BTP destinations, because the Cloud Connector path of the figure is described by SAP for destinations kept in the Destination service.

Source: Consuming Services (archived CAP guide), sections Use Application Defined Destinations and Supported Features for Application Defined Destinations

Deploying so that the services are bound

A microservice needs bindings to the XSUAA and Destination services to access destinations on SAP BTP, and a binding to the Connectivity service as well if it accesses an on-premise service through the Cloud Connector. XSUAA is the SAP BTP authorization and trust service that issues the tokens. For Cloud Foundry with an MTA deployment, the archived guide uses this command and notes that it adds the three services to the mta.yaml file, marking the connectivity service as required for on-premise connectivity only.

The command requires an SAP BTP account for the deployment that follows it; not run here.

cds add xsuaa,destination,connectivity

Source: Consuming Services (archived CAP guide), section Add Required Services to MTA Deployments

On Kyma, the guide says the secret of the connectivity service needs to be modified for the Cloud SDK to connect to on-premise destinations, and refers to open feature requests for the Cloud SDK for both Java and Node.js. Check the current Cloud SDK documentation before relying on that setup, because this support is the part of the guide most likely to change.

To try a BTP destination from a developer machine, the guide describes hybrid testing: bind a local application to an XSUAA and Destination service instance in the same subaccount as the destination (cds bind), put the destination name in a hybrid profile and start with cds watch --profile hybrid. This needs a Cloud Foundry login and an SAP BTP account, so it was not run here.

Source: Consuming Services (archived CAP guide), sections Deployment and Connect to Remote Services Locally

The CAP guides moved

SAP marks the Consuming Services guide as outdated and replaced by the CAP-level Service Integration guide, and keeps it for archival purposes for a limited time. The destination properties on this page come from that archived guide and from the SAP Help Portal pages above. The newer Outbound Authentication guide uses the same credentials.destination and path form for a named BTP destination in its examples. Read the current CAP documentation for new projects.

Summary

  • A destination is a named set of connection details; the application looks up the name, and the Destination service returns the URL, the proxy type and the authentication details.

  • The proxy type Internet is the default; OnPremise sends the call through the Connectivity service and the Cloud Connector to a system inside your network.

  • The Cloud Connector maps a virtual host and port, which must match the destination’s URL, to the real internal host and port, and it allows only the URL paths you list.

  • In CAP Node.js the destination name goes into cds.requires.<service>.credentials.destination (often inside a [production] block), and in CAP Java into cds.remote.services under destination and name.

  • Deployment binds the XSUAA and Destination services, and the Connectivity service for on-premise targets; Kyma adds the Connectivity Proxy and Transparent Proxy.

  • Only the local configuration check was run here; everything that needs an SAP BTP account is described from the official pages.