When developing with Oracle Application Express (APEX), you can follow standard development lifecycle practices, such as having different environments for Development, QA/Test and Production. These environments generally reside in separate databases and these environments can either be on-premises or use hosted services, such as the Oracle Autonomous Database Cloud Service, or a combination of both.
Oracle APEX enables you to export and import apps to and from the Oracle Autonomous Database Cloud Service, private and public clouds, on-premises, and even the free public evaluation service, apex.oracle.com. APEX application export files can be imported into any other Oracle Database, providing APEX (that release or higher) is installed in the target database. You may choose to perform development and testing in the Oracle Autonomous Database Cloud Service, but deploy the production applications on premise, or vice versa.
To deploy an application from one APEX instance to another, you must copy both the application definition and underlying database objects used by the application. In APEX, you can package the app definition along with database objects, images, and seed data necessary for your application to run correctly using functionality in APEX called Supporting Objects. You can then export this app and deploy into your target Oracle APEX instance, which will both install the application definition and create the underlying database objects.
Oracle APEX 20.1 simplifies this process by introducing the One-click Remote Application Deployment wizard. Using a simple wizard, you can now directly export and deploy your application along with the supporting objects into the target system. You no longer need to separately export the app and its objects from the source system into files and then import into the target system. With just one-click, you can directly deploy your app definition along with the objects from the source system to the target system. For example, from within your development environment, you can deploy your app to the remote production environment. You do not need to directly access your production environment to import the app.
The physical location of your APEX environments does not impact the application deployment. For example, you can use the One-Click Remote Application Deployment option in any of the following scenarios:
To use Remote Application Deployment, a developer simply REST Enables the schema associated with their target workspace. This can easily be done in RESTful Services in the SQL Workshop. One-click Remote Application Deployment leverages the Oracle REST Data Services (ORDS) REST Enabled SQL Service.
To perform One-click Remote Application Deployment, the following are the prerequisites:
Your DBA will use DBMS_NETWORK_ACL_ADMIN package to configure a network access control list (ACL) to permit outbound web service calls from your APEX instance. For more information, see the Oracle Application Express Installation Guide.
Your DBA must create a Wallet on the database server. The instance administrator must configure the Wallet attributes on the Instance Settings page to specify the file system path to the Wallet and the Wallet password (if required). To learn about how to create a Wallet and enable it for Oracle APEX Workspaces, see the APEX, HTTPS, certificates and the Oracle Wallet blog post. For more information, see the Oracle Application Express Administration Guide.
Note: Once Oracle APEX 20.1 is available on the Autonomous Database, you will be able to use your APEX on Autonomous instance for remote deployment. The Autonomous Database is pre-configured with an Oracle Wallet and a network access control list (ACL). No further configuration is necessary.
In this example, you will deploy an application from your development environment – APEXDEV to your testing environment – APEXSTAGE. In the first scenario, you will deploy your app along with its underlying supporting objects into the target system. In the second scenario, you will overwrite this app and upgrade the supporting objects in the target system.
To perform the steps in this example, download and unzip the remote_app_dep_example.zip to your working directory. This zip file includes two scripts: demo_emp_table.sql and demo_emp_update.sql.
In this section, you will create the DEMO_EMP table and then build an application on top of that table. Next, you will add the supporting objects installation script to this app definition. Finally, you will use the One-click Remote Application Deployment wizard, to deploy this app to the testing instance.
Create a table and then create an application on top of this table. Perform the following steps:
Add the supporting object installation scripts so that you can include them along with the application definition. In this example, you will add demo_emp_table.sql under Installation scripts. This script includes the DDL for DEMO_EMP table and also the INSERT statements for the sample data.
Your application along with the supporting objects is now ready for deployment. Perform the following steps:
In a new browser tab, log in to your deployment workspace and navigate to SQL Workshop > Restful Services.
Expand RESTful Data Services > Modules > oracle.example.hr > empinfo/ GET. Copy the Full URL.
Switch to the browser tab of your development workspace (APEXDEV) and in the Create REST Enabled SQL Service wizard, for Name, enter APEXSTAGE. For Endpoint URL, paste the base URL copied from the deployment instance in the previous step. The base URL should include the ORDS context root and schema URL prefix. For example, https://host:8096/ords/apexstage Then, click Next.
Select the credential to authenticate against. If you have an existing credential, navigate to Credentials in Shared Components. In this example, you create new credentials.
ORDS REST Enabled SQL Service supports Basic Authentication and OAuth2 Client credentials flows. Oracle recommends always using empty credentials for remote application deployment in shared development environments so only those with the knowledge of those credentials can deploy applications or run SQL or PL/SQL on the REST Enabled SQL reference. If Store Credentials is turned off, the named credential will be created, with NULL values stored as Client ID and Client Secret.
In essence, this allows you to just create the reference to the REST enabled SQL without supplying credentials.
Enter APEXSTAGE for Credential Name, select Basic Authentication for Authentication Type, and turn off the Store Credentials switch. Click Create.
Now you see a message that REST Enabled SQL Service has been created. From the Deployment Server select list, choose the one that you just created. Click Next.
Enter the values for Client ID and Client Secret and click Next. In this example, you use Basic Authentication. Therefore, enter the database user name (deployment schema) for Client ID and the corresponding password for Client Secret.
Note: User names for Basic Authentication are converted to upper case. To include a case-sensitive user name, prefix it with exclamation mark (!).
You see the Remote Deployment Successful message. Your application has been successfully deployed to remote server (APEXSTAGE in this example).
Log in to your remote APEX instance. Make sure that the application is available and with the same application id as in the source system. Navigate to Object Browser and verify that the DEMO_EMP table has been created and the data is available. Run the application to verify.
In this section, you will make some changes to your application and the database objects in the development instance (APEXDEV in this example). You will add a chart to the Employees App and add a new column to the DEMO_EMP table. You will then push these changes to the testing environment. The One-click Remote Application Deployment wizard lets you overwrite the existing application and upgrade the database objects as well.
Perform the followings steps:
In this blog post, you are introduced to the One-click Remote Application Deployment feature in Oracle APEX 20.1. Using One-click Remote Application Deployment, you can deploy an application along with supporting object definitions to another workspace or to remote Oracle APEX instances. You Access the Remote Deployment option from the Export/Import option in App Builder. You learned how to override an existing application deployment and upgrade the database objects in the remote instance.
Application Express (APEX) is the low-code application development platform which is included in every Oracle Database and is also provided with every Oracle Database Cloud Service, including Oracle Autonomous Database and the Oracle Cloud Free Tier. APEX, combined with the Oracle Database, provides a fully integrated environment to build, deploy, maintain and monitor data-driven business applications that look great on mobile and desktop services. To learn more about Oracle Application Express, visit apex.oracle.com. To learn more about Oracle Autonomous Database, visit oracle.com/autonomous.