Install Pleasanter on Azure AppService with serverless configuration
## Overview
This is a step-by-step guide to building an operating environment for Pleasanter in a serverless configuration using Microsoft Azure's AppService and SQL Database.
| Subject | Environment/version |
| ------------------ | :--------------------------- |
| Web | Microsoft Azure AppService |
| DB | Microsoft Azure SQL Database |
| Runtime stack | .NET8 |
## Prerequisites
1. Be able to log in to the Azure portal
1. One instance of Microsoft Azure App Service (Windows/.NET8) is ready
1. One instance of Microsoft Azure SQL Database is ready
1. Microsoft Azure SQL Database connection string is ready
1. Microsoft Azure SQL Database firewall settings allow connections from App Service and PC
## Procedure
The construction procedure is as follows.
1. Prepare
1. .NET settings
1. Download Pleasanter and Set Parameters
1. Place Pleasanter
1. Run CodeDefiner
1. Check that Pleasanter is running
## 1. .NET settings
1. Connect to the [Azure Portal](https://portal.azure.com/).
1. Open App Service.
![image](https://pleasanter.org/binaries/dfab7699785f485697502a1e0e0f51c4)
1. Select the App Service instance you created.
1. Open "General Settings" in the "Configuration" menu and set it as shown in the image below.
![image](https://pleasanter.org/binaries/e38bffa2780d4224a577f749c1431a5a)
|Column|Setting details|
|:--|:--|
|.NET version|.NET 8 (LTS)|
|Platform|64bit|
|FTP status disabled|Invalid|
|Always connected|On|
## 2. Download the Pleasanter and Set Parameters
1. Download the latest version of Pleasanter from the [GitHub release notes](https://github.com/Implem/Implem.Pleasanter/releases).
1. Unzip the downloaded zip file.
1. Set the parameter file.
1. Set the connection information to the database.
Open "pleasanter\Implem.Pleasanter\App_Data\Parameters\Rds.json", set the parameters below and save.
|Parameter name|Value|Description|
|:--|:--|:--|
|Dbms|SQLServer|Uses Microsoft Azure SQL Database as the relational database. |
|Provider|Azure|Uses Microsoft Azure SQL Database as the relational database. |
|SaConnectionString|**\*\*\*\***|Connection string for Microsoft Azure SQL Database. |
|OwnerConnectionString|**\*\*\*\***|Connection string for Microsoft Azure SQL Database. |
|UserConnectionString|**\*\*\*\***|Connection string for Microsoft Azure SQL Database. |
|SqlCommandTimeOut|0|Sets the SQL command timeout to unlimited. |
|MinimumTime|3|Specifies the minimum time unit that the database can identify in milliseconds. This Parameter cannot be changed. |
|DeadlockRetryCount|4|Maximum number of retries when a deadlock occurs. |
|DeadlockRetryInterval|1000|Interval before retrying when a deadlock occurs. |
|DisableIndexChangeDetection|true|Do not detect differences in database indexes when upgrading. |
1. Set the service information.
Open "pleasanter\Implem.Pleasanter\App_Data\Parameters\Service.json", set the parameters below, and save.
|Parameter name|Value|Description|
|:--|:--|:--|
|Name|(Database name)|Set the name of the database created in Azure|
|TimeZoneDefault|Tokyo Standard Time|Specify the default time zone with a name that is valid in Windows (※1)|
(*1) Please set the character string listed in the TimeZone field in the Time Zones list below. https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11
## 3. Placement of Pleasanter
1. Stop the instance in App Service.
1. Visit [Kudu](https://learn.microsoft.com/en-us/azure/app-service/resources-kudu#access-kudu-for-your-app)
1. Click "Advanced Tools" from "Development Tools" in the left menu of App Service.
![image](https://pleasanter.org/binaries/3790b21fe7a1404f9b38296017bd592a)
2. Click the [Move](https://pleasanter-cms-1112983746-staging-en.azurewebsites.net/en/manual/table-record-move) link
![image](https://pleasanter.org/binaries/77edc9569124415dafb4f5d6a1b385b9)
3. Click “Debug console” > “CMD” from the Kudu header menu
![image](https://pleasanter.org/binaries/54c6d7f10efd448b95fd520004236ae4)
4. Click "site" from the directory list. After making your selection, make sure the prompt reads "C:\home\site". (Depending on the user, it may be D:\home\site. In that case, please read it as appropriate.)
![image](https://pleasanter.org/binaries/3fc8f09aa37047ee8778f28965b0c41b)
1. Upload the Pleasanter file prepared in "2. Download the Pleasanter and Set Parameters" to App Service.
1. Go to the "Pleasanter" folder.
2. Rename the "Implem.Pleasanter" folder to "wwwroot".
3. Compress the wwwroot folder in zip format and make it "wwwroot.zip".
4. Rename the "Implem.CodeDefiner" folder to "CodeDefiner".
5. Compress the CodeDefiner folder in zip format and make it "CodeDefiner.zip".
6. Drag and drop wwwroot.zip and CodeDefiner.zip to Kudu's Size target and ensure they are expanded and stored.
![image](https://pleasanter.org/binaries/d0167154cccb4840a42e450ad9a00d6e)
## 4. Run CodeDefiner
1. Select CodeDefiner from the Kudu directory listing and make sure the prompt reads C:\home\site\CodeDefiner.
2. Execute the following command to run CodeDefiner.
```
dotnet Implem.CodeDefiner.dll _rds /p C:\home\site\wwwroot
```
## 5. Confirm the startup of Pleasanter
1. Start an instance in App Service.
1. Open the Pleasanter login screen in your browser, enter "Login ID: Administrator" and "Initial Password: pleasanter", then click the "Login" button.
![image](https://pleasanter.org/binaries/5477647dc121413190827affdc7fa1ff)
1. After logging in, you will be asked to change the password for the "Administrator" user. Enter your desired password and click the "Change" button.
![image](https://pleasanter.org/binaries/d57262564d8e49568553a84b273d3797)