Follow the steps in this guide to deploy an application with a connection to an external SQL Server or Azure Server database from an OutSystems environment (in this case, the Development environment) to the next environment (in this case, the Quality environment).
Use this guide after you created the integration with the external database in your Development environment and if your application needs to connect to a different external SQL Server database in each environment.
Remove database name from the Extension in the Development environment
When connecting to an external database, the configurations set in the Extension override the corresponding configurations set in the environment-specific Database Connection.
In the Extension, the Table or View Name field of each Entity defines the table name, and is set by the Connect to External Table or View... wizard in Integration Studio as a three-part table name,
To make sure your application connects to the correct database in each environment, the Table or View Name field of each Entity must not include the database name and must be defined as a two-part table name,
Follow these steps to remove the database part from the Extension:
Open the Extension that contains the connection to the external database.
Tip: Open the Extension directly from Service Studio by opening the application and then selecting the Extension.
In Integration Studio, connect to your Development environment.
In each Entity, make sure the Table or View Name field is set as two-part table name,
[<schema>].[<table>]. If you used the Connect to External Table or View... wizard to create the Entity, remove the database name from the Table or View Name field.
Select 1-Click Publish to republish the Extension.
In Service Studio, open each consumer Module that references the Entities, refresh the Dependencies and publish.
Define a Database Connection in the Quality environment
In the Quality environment, define a Database Connection:
Open the Service Center management console of your Quality environment.
On the Administration tab, select Database Connections.
Click New Database Connection and fill in the fields to set up the connection to the external database.
Don't forget to set the Database field to the external database for the Quality environment.
Click Test to check if the connection is working correctly.
The database user must have permissions to:
- List the necessary tables and views in the external database.
- Perform the operations Create, Read, Update, and Delete on those tables and views.
Click Create to create the Database Connection.
Deploy the application to the Quality environment
To deploy the application to the Quality environment follow these steps:
Open LifeTime for your Infrastructure.
Tip: Open LifeTime directly from Service Center by clicking Manage all environments.
Select the Applications tab and select the DEPLOY... button between the Development environment and the Quality environment.
Select Add Applications and, in the Choose one or more Applications dialog, select your application and select Add to Deployment Plan.
Select the VALIDATE NOW button between the Development environment and the Quality environment.
Select the CONTINUE button between the Development environment and the Quality environment.
Verify the deployment plan, select Deploy Now and then in the Deploy applications as planned dialog select Deploy Now to start the deployment.
After the deployment stops, click the configuration or confirmation link in the warning banner to open Service Center and map the database name of the extension to the database connection.
Associate the logical database name of the extension to the Database Connection that you created previously.
After the Deployment finishes your Extension is ready to be used by other applications in the Quality environment.