Preparations

Before making changes to the PowerBuilder client app, let's follow the steps below to make sure 1) the PowerBuilder application can run successfully, 2) the app has been deployed as an installable cloud app successfully, and 3) the PowerServer C# solution has been successfully generated.

In this tutorial, we will take Sales Demo as an example.

Step 1: Select Windows Start | Appeon PowerBuilder 2022 R2, and then right-click Example Sales App and select More | Run as administrator.

Step 2: When the SalesDemo workspace is loaded in the PowerBuilder IDE, click the Run button in the PowerBuilder toolbar.

Step 3: When the application main window is opened, click the Address icon in the application ribbon bar and make sure data can be successfully retrieved.

Step 4: Create and configure a PowerServer project for the Sales Demo app (detailed instructions are provided in Quick Start > Guide 1).

IMPORTANT: In the Security page, select Use external Azure Active Directory service from the Auth Template list box, view the license terms, and select the "I have read and agree to the license..." option.


Step 5: Deploy the application as an installable cloud app. The PowerServer C# solution is generated, but the installable cloud app cannot run yet because further settings and changes are required, as explained in the subsequent sections.

The PowerServer C# solution > UserExtensions project provides templates for configuring the address of the authentication server like Azure AD or Azure AD B2C.

  • Authentication.json contains the settings for enabling the authentication feature ("PowerServer:EnableAuthentication") and specifying the address of the authentication server ("Authentication:Authority"). The PowerServer Web APIs will validate the token against the authentication server; and if validation is successful, data will be obtained from the database.

    The "PowerServer:EnableAuthentication" setting is set to true by default. Setting it to false will turn off the authentication feature.

    The "Authentication:Authority" setting is set for JWT by default; you can set the address of Azure AD and Azure AD B2C.