on 05-11-2021 10:04 AM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Can you tell me how to fix that?
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?
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...
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
User | Count |
---|---|
77 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.