cancel
Showing results for 
Search instead for 
Did you mean: 

CAP Demo app - Subdomain does not map to a valid identity zone

Sharathmg
Active Contributor
0 Kudos

Hello All,

Good Day!

I have been part of the bootcamp on CAP Modelling - integration and extension. As part of the exercise, I am stuck with a problem to which I find no solution.

The CAP app -s deployed and started. But, I am unable to subscribe it in the consumer - tenant.

On inspection, I found that the routes dont work properly.

I am walking around the cloud development blind and with blinkers :). So any input/tip will help in fixing or learning.

The below screenshots for reference.

Regards,

Sharath

Accepted Solutions (0)

Answers (2)

Answers (2)

This is a typical issue faced. The problem (I am guessing) is in the MTA file. It probably has a property defined for approuter like the following

TENANT_HOST_PATTERN: '^(.*)-${space}-${app-name}.${default-domain}' 

This works fine when (only when) space, app-name are all in lower case and do not include .(dots).

You can see the actual value of this, if you look for the User defined environment variable for the app (approuter) in cockpit or search for this in the output of the command:

cf env <app name for approuter>

The quick fix is to "hard code" the URL pattern.

cf set-env <app name for approuter> TENANT_HOST_PATTERN '(.*)-ntt-btp....'

and restart the app.

You may check if the pattern works using RegEx against the tenant host name from route. The first group extracted should be the tenant.

gregorw
Active Contributor
0 Kudos

The CAP MTX Module doesn't take care about creation the routes of the approuter in the provider account. Without additional coding that uses the Cloud Foundry API's you have to add the route manually. For some inspirations how to get the route created check out Getting your head into Cloud Application Programming model multitenancy.