cancel
Showing results for 
Search instead for 
Did you mean: 

Can the approuter load provider-level subaccount destinations in multitenant contexts?

bmcdonn2
Participant

Hello all,

As the title suggests, I'm looking for guidance on how to access destinations defined in the provider subaccount via the approuter in a multitenant application.

As a refresher, here are what I understand to be the 3 levels of destinations within SAP BTP deployed multitenant app, ordered from least specific, to most specific:

  1. Provider Subaccount Level
  2. Service Instance Level
  3. Subscriber Subaccount Level

*This is my interpretation of official documentation: Multitenancy in the Destination Service.

Now my initial understanding of these levels is that the progression of locating a destination via the API would progress such that it checks the Subscriber Subaccount level first, then the Service Instance level next and finally the Provider Subaccount Level.

While testing this out using the Destination API within a tenant security context, I found that neither the Service Instance Level nor Provider Subaccount Level are taken into account. Indeed, if I access the API without a tenant context it can load these two destination sources just fine.

Now if I was writing this code by hand I'd know that as a fallback I'd just need to hit the API once more with the tenant context removed but as it stands now I'm relying on the `@sap/approuter` npm package to handle locating destination which means these potentially cross-subscriber destinations are inaccessible.

As a workaround I've just defined the destination in all subscriber subaccounts but this leads to a massive duplication of defined destinations and much more maintenance overhead as it involves keeping credentials in sync across all subscriber subaccounts. I suppose another alternative would be to modify the app environment variables to set the destination manually there but I really believe the cleanest way to handle this would be via a single destination defined in the provider subaccount.

I appreciate any advice that people can offer on this.

*** Edit

According to the docs, this should be possible by using the `preferLocal` option in the xs-app.json file but I'm having trouble confirming this. From the README file:

  • Property - preferLocal
  • Type - Boolean
  • Optional - Yes
  • Description - Defines from which subaccount the destination is retrieved. If preferLocal is true, the destination is retrieved from the provider subaccount. If preferLocal is false or undefined, the destination is retrieved from the subscriber subaccount.

Thanks,

Brian

View Entire Topic
bmcdonn2
Participant

The issue was solved with approuter version 11.3.3