Background
To achieve high availability and minimize downtime, you may need to hot deploy or update your running application in a production environment.

Environment
PowerServer 2022 R3 and later

Resolution
Please make the following preparations before proceeding:
1.    Prepare a separate site to host the new version of the Web APIs, which we will refer to as Web APIs B, alongside the currently running Web APIs A.
2.    Since both Web APIs will run side by side, ensure there are no database compatibility issues before proceeding with the deployment or update.

Solution A: Using the built-in versioning feature
1.    Set a new deployment version in the project object before building and deploying. Set minimum compatible version to the same new version so it will force users to upgrade once they restart your application.
2.    Ensure that the Web API URL in the newly generated app files points to Web API B. You can do this using one of the following methods:
        •    Configure the Web API URL in the project object within the IDE.
        •    Manually modify the URL in the AppRun.json file.
        •    Dynamically set it using SetPowerServerURL.
3.    Notify end users to restart their applications at their convenience.
       This can be done through your application’s custom logic or by simply sending an update notification email.

Solution B: Using manual replacement
1.    Ensure the application is configured to download all app files at startup via Application > Advanced > Client App Download when building the application.
2.    Ensure that the Web API URL in the newly generated app files points to Web API B. You can do this using one of the following methods:
        •    Configure the Web API URL in the project object within the IDE.
        •    Manually modify the URL in the AppRun.json file.
        •    Dynamically set it using SetPowerServerURL.
3.    After deploying Web API B, replace the cloud app files on the Web Server with the new version.
4.    Notify end users to restart their applications at their convenience.
       This can be done through your application’s custom logic or by simply sending an update notification email.
 

0
0