In the PowerServer project painter > Database page > Advanced tab, you can create various DB connection profiles which include database connections to be used in different environments, for example, database connections for the development environment, testing environment, production environment, etc.
Each DB connection profile will have a corresponding Applications.[DBConnectionProfile].json created in the compiled Web APIs > AppConfig folder (or in the solution > UserExtensions project > AppConfig folder) for storing its settings such as database connection cache(s), transaction-to-cache mapping(s) etc. For example, the default Applications.json stores the settings of the "Default" connection profile, Applications.Test.json stores the settings of the "Test" connection profile, Applications.Production.json stores the settings of the "Production" connection profile.
You can decide which connection profile to be used in the application by selecting the profile and clicking the Set as Current button. The name of the current profile will be stored to the "POWERSERVER_ENVIRONMENTTYPE" setting in the compiled Web APIs > AppConfig folder > AppConfig.json.
To create a new DB connection profile:
-
Click New in the DB connection profile group.
-
In the New DB connection profile dialog box, specify a name for the DB connection profile, for example, production.
It is more efficient to create the new profile from an existing one. You can select the "Clone connection configuration settings from" option and then select an existing profile to clone from.
If you have created multiple DB connection profiles, you can select which profile should be used by the application, by selecting the connection profile from the list and then clicking the Set as Current button.