cancel
Showing results for 
Search instead for 
Did you mean: 

Documentation: Deploy SaaS Solutions (MTX) - Dependencies to Destination / Connectivity Service

gregorw
Active Contributor
3,750

Hello CAP Team, Hi iwona.hahn,

in the last days I've spent quite some time to get remote services, defined in destinations of the Subscriber Subaccount working. The most crutial part was to return the xsappname as described in Register the Multitenant Application to the SAP SaaS Provisioning Service from the Variable: <VCAP_SERVICES.<service>.credentials.xsappname.

The Cookbook - Deploy SaaS Solutions does mention the SAP BTP Dependencies but uses this example

"mtx": {
  "dependencies": ["xsappname-1", "xsappname-2"]
}

to be put into the package.json. But as the xsappname is dynamic I would suggest to replace this with the code I've added to the server.js:

const xsenv = require("@sap/xsenv");
xsenv.loadEnv();
const services = xsenv.getServices({
  dest: { tag: "destination" },
  conn: { tag: "connectivity" },
});

cds.env.mtx.dependencies = [services.dest.xsappname, services.conn.xsappname];

In addition the section Use Destinations from Subscriber Account should mention that for On Premise destination also the connectivity service must be bound. Especially as an S/4HANA System is given as an example.

Best Regards
Gregor

chgeo
Advisor
Advisor

Thanks for the great suggestion. We are anyways about to overhaul the deploy and SaaS guides.
Stay tuned!

Regards,
Christian

gregorw
Active Contributor

Hi christian.georgi,

do you have any update on this topic? SaaS Service Dependencies wasn't changed yet.

CU
Gregor

MustafaBensan
Active Contributor
0 Kudos

Great suggestion, gregorw. I am also keen for an update on this important topic.

Regards,

Mustafa.

sreehari_vpillai
Active Contributor

gregorw Can you please share the mtx projects , where you tried this ? I am stuck at similar issue.

gregorw
Active Contributor

Hi rene.jeglinsky,

can you check with the MTX(S) experts if this could be added to the documentation?

Best Regards
Gregor

Attila
Active Participant

+1 vote for this Christian christian.georgi , and Rene rene.jeglinsky if You could help on this documentation update. It would be a great help to many of us fighting daily with such problems and debugging to get the expected result if we can, sometimes not. At the moment I have a feeling we get answers from the tears of debugging of the SDKs instead of simply reading the documentation because we have no such putting the pieces together. If we newcomers to a topic are lucky, we might get help from pioneers, and this is why this community is so awesome.
Thank You
Best regards
Attila

Steven-Mason
Explorer
0 Kudos

Thanks Gregor! This was very helpful this week trying to accomplish this exact task.

Regards,

Steven

Accepted Solutions (0)

Answers (1)

Answers (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi gregorw,

I know this question is a bit old, but there is also a "catch" related to the usage of destinations via Cloud SDK on a Multitenant Application.

For future reference and for those that are using Cloud SDK, please check the following documentation at session dedicated to Multitenancy:

https://sap.github.io/cloud-sdk/docs/js/features/connectivity/destinations#destination-service

Best regards,
Ivan

gregorw
Active Contributor
0 Kudos

Hi Ivan,

my"Question" is actually more of an improvement request regarding the pre-requisite to use subscriber subaccount destionations. Because you need to return the destination service, and when using on premise destination you also need to return the connecitvity service as a dependency while subscribing in the dependency callback.

Best Regards
Gregor