cancel
Showing results for 
Search instead for 
Did you mean: 

Missing .cdsrc.json in deployed version of CAP application

carlonnheim
Participant

Hi,

We are setting up a CAP application and are unsure about the relation between package.json and .cdsrc.json. The way we read the capire documentation they seem to be interchangeable (.cdsrc.json takes priority) but when we deploy to Cloud Foundry the .cdsrc.json file is not included ("cds build" does not include it in the "./gen" folder).

How should we interpret this? Is the .cdsrc.json file only intended for overriding settings when running locally and/or impacting the build process while the production settings (databases, authorization strategies, external services etc.) should go into package.json?

Thanks!

//Carl

Former Member
0 Kudos

I would also like to know, why the .cdsrc file is not copied over into the gen folder after build. What is the reason? Should we prefer using package.json instead of .cdsrc?

View Entire Topic
lothar_bender
Advisor
Advisor

Hi Carl,
your observations are correct and reflect the current implementation.

CDS config options defined in package.json and .cdsrc.json are resolved in priority order. For example, a setting in package.json will overwrite the corresponding setting in .cdsrc.json.

We will add best practises and more detailed documentation to https://cap.cloud.sap/docs/.

Regards,

Lothar

0 Kudos

Hello Lothar,

unfortuantely when doing a deployment while having all configuration in cdsrc json and having none in the packackage.json, it is failing to resolve the config from cdsrc json that I defined depending on the profile/environment

"[development]": { "requires": { "auth": { "strategy": "mock" "db": { "kind": "sql" "hana": { "deploy-format": "hdbtable" "[production]": { "requires": { "auth": { "strategy": "JWT" "uaa": { "kind": "xsuaa" "db": { "kind": "hana" "hana": { "deploy-format": "hdbtable" "[hana]": { "requires": { "auth": { "strategy": "mock" "db": { "kind": "hana" "hana": { "deploy-format": "hdbtable" "[dummy]": { "requires": { "auth": { "strategy": "dummy" "db": { "kind": "sql" "hana": { "deploy-format": "hdbtable"

Can you tell me how to fix that?

gregorw
Active Contributor
0 Kudos

Why don't you move it to the package.json?

Because I like the option to outsource it to the cdsrc. But anyway, if it only works within the package.json, why should the cdsrc be provided?

M_Zimmermann
Explorer
0 Kudos

IMO it's a bug that the .cdsrc.json is not included in the build process.

I tried to get the destination service working in the SAP BTP and was wondering why it couldn't find my destination. Locally everything was working find. I took some time until I recognized that the .cdsrc.json was missing...

gregorw
Active Contributor
0 Kudos

Hi Manuel,

I can't agree. Never had to use .cdsrc.json. Access to destinations in the deployed version work using the destination service and for on premise using the connectivity service. You have to bind that services using the mta.yaml. To achieve different local and deployed configurations you should use Configuration Profiles.

CU
Gregor