Skip to content

Install Pleasanter on Azure App Service in a Serverless Configuration (using Azure Database for MySQL)

Overview

These are the steps to build a Pleasanter runtime environment in a serverless configuration using Microsoft Azure App Service and Microsoft Azure Database for MySQL.

Target Environment / Version
Web Microsoft Azure App Service
DB Microsoft Azure Database for MySQL
(MySQL 8.4 LTS)
Runtime stack .NET 10
Pleasanter 1.5.0.0 and later

Precautions

  1. If you run CodeDefiner without specifying arguments, it is set up with the language English and the time zone UTC. Specify the language and the time zone as needed.

Prerequisites

  1. You can log in to the Azure Portal
  2. One instance of Microsoft Azure App Service (Windows/.NET 10) is prepared
  3. One instance of Microsoft Azure Database for MySQL is prepared
  4. The server name, the administrator user name and the administrator user password of Microsoft Azure Database for MySQL are prepared
  5. Connections from the App Service and from the local PC are allowed in the firewall settings of Microsoft Azure Database for MySQL

Steps

The build steps are as follows.

  1. Setting up .NET
  2. Changing the server parameters of Azure Database for MySQL
  3. Downloading Pleasanter and setting the parameters
  4. Placing Pleasanter
  5. Running CodeDefiner
  6. Checking that Pleasanter starts

1. Setting Up .NET

  1. Connect to the Azure Portal.
  2. Open the App Service.
    The Azure Portal with App Service open
  3. Select the App Service instance you created.
  4. Open "General settings" of the "Configuration" menu and set it as shown below.
    The "General settings" screen of the App Service "Configuration" menu
    The "General settings" screen of the App Service, continued

    No. Item Setting
    1 Configuration (preview) Click to select it
    2 General settings Click to select it
    3 Platform 64bit
    4 FTP state Disabled
    5 Always On On
    6 Stack settings Click to select it
    7 Stack .NET
    8 .NET version .NET 10 (LTS)

2. Changing the Server Parameters of Azure Database for MySQL

  1. Connect to the Azure Portal.
  2. Open Azure Database for MySQL.
    The Azure Portal with Azure Database for MySQL open
  3. Select the Microsoft Azure Database for MySQL instance you created.
  4. Open "Server parameters" of the "Settings" menu.
  5. Click the "All" tab.
  6. Search for "sql_generate_invisible_primary_key".
  7. Set "sql_generate_invisible_primary_key" to "OFF".
    The server parameters screen of Azure Database for MySQL, setting sql_generate_invisible_primary_key to "OFF"
  8. Click the "Save" button at the top.

3. Downloading Pleasanter and Setting the Parameters

  1. Download the latest version of Pleasanter from the download centre.
  2. Extract the zip file you downloaded.
  3. Set the parameter files.

    1. Set the connection information for the database.
      Open "pleasanter\Implem.Pleasanter\App_Data\Parameters\Rds.json", set the parameters as follows and save it.

      Parameter Name Value Description
      Dbms MySQL Use Microsoft Azure Database for MySQL as the relational database.
      Provider Local Use Microsoft Azure Database for MySQL as the relational database.
      SaConnectionString null The connection string used to connect to the database instance with SA permission.
      Set null (see step 3.3.2).
      OwnerConnectionString null The connection string used to connect to the Pleasanter database with dbowner permission.
      Set null (see step 3.3.3).
      UserConnectionString null The connection string used to connect to the Pleasanter database with dbreader and dbwriter permissions.
      Set null (see step 3.3.4).
      SqlCommandTimeOut 0 Makes the SQL command timeout unlimited.
      MinimumTime 3 Specifies the smallest unit of time the database can distinguish, in milliseconds. Do not change this parameter.
      DeadlockRetryCount 4 The maximum number of retries when a deadlock occurs.
      DeadlockRetryInterval 1000 The interval before retrying when a deadlock occurs.
      DisableIndexChangeDetection true Does not detect differences in the database indexes when upgrading the version.
      SysLogsSchemaVersion 2 Use the System Log Extended Function.
      MySqlConnectingHost % Specifies a wildcard so that connections from the host of the App Service are allowed.
    2. Set null for the parameter SaConnectionString of Rds.json and set the following value in the environment variable Implem.Pleasanter_Rds_MySQL_SaConnectionString.

      {ServerName}.mysql.database.azure.com;Port=3306;Database=mysql;UID={UserName};PWD={Password}
      

      Rewrite the parts in { } with the appropriate strings, referring to the explanation below.

      No. Part to Rewrite Description
      1 {ServerName} The server name of Microsoft Azure Database for MySQL.
      2 {UserName} The administrator user name of Microsoft Azure Database for MySQL.
      3 {Password} The administrator user password of Microsoft Azure Database for MySQL.
    3. Set null for the parameter OwnerConnectionString of Rds.json and set the following value in the environment variable Implem.Pleasanter_Rds_MySQL_OwnerConnectionString.

      Server={ServerName}.mysql.database.azure.com;Port=3306;Database=#ServiceName#;UID=#ServiceName#_Owner;PWD={SetAdminsPWD}
      

      Rewrite the parts in { } with the appropriate strings, referring to the explanation below.

      Part to Rewrite Description
      {ServerName} The server name of Microsoft Azure Database for MySQL set in No.1 above.
      {SetAdminsPWD} The password of the user you set in CodeDefiner.

      Note that #ServiceName# is a placeholder that represents the value of the parameter Name in Service.json, and means the user name you create in CodeDefiner.

    4. Set null for the parameter UserConnectionString of Rds.json and set the following value in the environment variable Implem.Pleasanter_Rds_MySQL_UserConnectionString.

      Server={ServerName}.mysql.database.azure.com;Port=3306;Database=#ServiceName#;UID=#ServiceName#_User;PWD={SetUsersPWD}
      

      Rewrite the parts in { } with the appropriate strings, referring to the explanation below.

      Part to Rewrite Description
      {ServerName} The server name of Microsoft Azure Database for MySQL set in No.1 above.
      {SetUsersPWD} The password of the user you set in CodeDefiner.

      Note that #ServiceName# is a placeholder that represents the value of the parameter Name in Service.json, and means the user name you create in CodeDefiner.

4. Placing Pleasanter

  1. Stop the instance in the App Service.
  2. Access Kudu.

    1. Click "Advanced Tools" under "Development Tools" in the left menu of the App Service.
      The left menu of App Service, with "Advanced Tools" under "Development Tools"
    2. Click the "Go" link.
      The "Advanced Tools" screen of App Service, with the link that opens Kudu
    3. From the header menu of Kudu, click "Debug console" -> "CMD".
      The Kudu header menu, choosing "CMD" under "Debug console"
    4. Click "site" in the directory list and confirm that the prompt has become "C:\home\site". (For some users it can be D:\home\site or similar. Read it as appropriate.)
      The Kudu debug console with "site" selected in the directory list
  3. Upload the Pleasanter files you prepared in "3. Downloading Pleasanter and setting the parameters" to the App Service.

    1. Move to the "pleasanter" folder.
    2. Rename the "Implem.Pleasanter" folder to "wwwroot".
    3. Compress the wwwroot folder in zip format. (It becomes wwwroot.zip.)
    4. Rename the "Implem.CodeDefiner" folder to CodeDefiner.
    5. Compress the CodeDefiner folder in zip format. (It becomes CodeDefiner.zip.)
    6. Drag and drop wwwroot.zip and CodeDefiner.zip onto the Size column in Kudu, and confirm that they are extracted and stored.
      The Kudu debug console after wwwroot.zip and CodeDefiner.zip have been extracted

5. Running CodeDefiner

  1. Select CodeDefiner from the directory list of Kudu and confirm that the prompt becomes C:\home\site\CodeDefiner.
  2. Run the following command to run CodeDefiner. Run this command only at the first installation.

    dotnet Implem.CodeDefiner.dll _rds /p C:\home\site\wwwroot /l "<language>" /z "<time zone>"
    

    Argument Configuration Example Description
    /l ja Rewrites the value of DefaultLanguage in Service.json
    /z Tokyo Standard Time Rewrites the value of TimeZoneDefault in Service.json

    For details of the languages that can be specified for /l and the time zones that can be specified for /z, refer to the following manual.
    FAQ: I want to know the supported languages and timezone parameter setting values

    An example for a Japanese environment:

    dotnet Implem.CodeDefiner.dll _rds /p C:\home\site\wwwroot /l "ja" /z "Tokyo Standard Time"
    

6. Checking That Pleasanter Starts

  1. Start the instance in the App Service.
  2. Open the Pleasanter login screen in a browser, enter "Login ID: Administrator" and "Initial password: pleasanter", and click the "Login" button.
    The Pleasanter login screen, where the login ID and initial password are entered
  3. After you log in you are asked to change the password of the "Administrator" user, so enter any password you like and click the "Change" button.
    The password change screen for the Administrator user, shown after the first login