diff --git a/README.md b/README.md index 61daff9..246cbc8 100644 --- a/README.md +++ b/README.md @@ -5,17 +5,28 @@ This is a small web application that demonstrates the basic functionality of the ## Prerequisites * [A channel on the LINE Developers Console](https://developers.line.me/en/docs/liff/getting-started/) for your application. * [A channel access token](https://developers.line.me/en/docs/liff/getting-started/#preparing-channel-access-token) -* A [Heroku account](https://www.heroku.com) +* A [Heroku account](https://www.heroku.com) or [Azure account](https://azure.microsoft.com) ## Deploying the application -[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/line/line-liff-starter) + [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/line/line-liff-starter) 1. Click the above "Deploy to Heroku button". 2. Fill in the required information on the "Create a New App" page in Heroku. 3. Select Deploy app and confirm that your app is successfully deployed. 4. Record the app URL (https://{Heroku app name}.herokuapp.com). You will set this URL when you add the app to LIFF. +[![Deploy to Azure](https://azuredeploy.net/deploybutton.svg)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fhoisjp%2Fline-liff-starter%2Fmaster%2Fazuredeploy.json) + +1. Click the above "Deploy to Azure" button. +2. Fill in the required information on the "Custom deployment" page in Azure portal. +3. BASIC + * Resource group: Select or Create new + * Location: Select one which is close to your location. e.g. (Asia Pacific) Japan East +4. SETTINGS + * Web Site Name: Set your site name which will determine the URL (https://{websitename}.azurewebsites.net). You will set this URL when you add the app to LIFF. +5. Click the "Purchase" button and confirm that your app is successfully deployed. (It won't cost any as long as you keep Sku App Svc Plan = F1 by default) + ## Adding the starter app to LIFF Add the app to LIFF. For more information, see [Adding a LIFF app](https://developers.line.me/en/docs/liff/registering-liff-apps/). diff --git a/azuredeploy.json b/azuredeploy.json new file mode 100644 index 0000000..c156e50 --- /dev/null +++ b/azuredeploy.json @@ -0,0 +1,122 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "parameters": { + "webSiteName": { + "type": "string", + "metadata": { + "description": "Web site name to define ***.azurewebsites.net . (need to be unique)" + } + }, + "skuAppSvcPlan": { + "type": "string", + "allowedValues": [ + "F1", + "D1", + "B1", + "S1" + ], + "defaultValue": "F1", + "metadata": { + "description": "The SKU of App Service Plan, Free F1 by default." + } + }, + "repoUrl": { + "type": "string", + "defaultValue": "https://github.com/hoisjp/line-liff-starter" + }, + "branch": { + "type": "string", + "defaultValue": "master" + } + }, + "variables": { + "appSvcPlanName": "[concat('appSvcPlan-', parameters('webSiteName'))]" + }, + "resources": [ + { + "type": "Microsoft.Web/serverfarms", + "apiVersion": "2018-02-01", + "kind": "app", + "name": "[variables('appSvcPlanName')]", + "location": "[resourceGroup().location]", + "sku": { + "name": "[parameters('skuAppSvcPlan')]" + }, + "properties": { + "name": "[variables('appSvcPlanName')]" + } + }, + { + "type": "Microsoft.Web/sites", + "apiVersion": "2018-11-01", + "name": "[parameters('webSiteName')]", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', variables('appSvcPlanName'))]" + ], + "kind": "app", + "properties": { + "enabled": true, + "hostNameSslStates": [ + { + "name": "[concat(parameters('webSiteName'), '.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Standard" + }, + { + "name": "[concat(parameters('webSiteName'), '.scm.azurewebsites.net')]", + "sslState": "Disabled", + "hostType": "Repository" + } + ], + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('appSvcPlanName'))]", + "reserved": false, + "scmSiteAlsoStopped": false, + "clientAffinityEnabled": true, + "clientCertEnabled": false, + "hostNamesDisabled": false, + "containerSize": 0, + "dailyMemoryTimeQuota": 0, + "httpsOnly": false + }, + "resources": [ + { + "type": "sourcecontrols", + "apiVersion": "2018-11-01", + "name": "web", + "dependsOn": [ + "[resourceId('Microsoft.Web/sites', parameters('webSiteName'))]", + "[concat('Microsoft.Web/Sites/', parameters('webSiteName'), '/config/web')]" + ], + "properties": { + "repoUrl" : "[parameters('repoUrl')]", + "branch": "[parameters('branch')]" + } + } + ] + }, + { + "type": "Microsoft.Web/sites/config", + "apiVersion": "2018-11-01", + "name": "[concat(parameters('webSiteName'), '/web')]", + "location": "[resourceGroup().location]", + "dependsOn": [ + "[resourceId('Microsoft.Web/sites', parameters('webSiteName'))]" + ], + "properties": { + "numberOfWorkers": 1, + "defaultDocuments": [ + "index.html", + "index.php" + ], + "phpVersion": "7.3", + "localMySqlEnabled": false, + "http20Enabled": false, + "minTlsVersion": "1.2", + "ftpsState": "Disabled", + "reservedInstanceCount": 0 + } + } + ] +} \ No newline at end of file