From 03113cfd6f50f70a84462996a08cebbc5360b6e6 Mon Sep 17 00:00:00 2001 From: Issei Hiraoka Date: Thu, 18 Jul 2019 16:46:54 +0900 Subject: [PATCH 1/3] add "Deploy to Azure" button --- README.md | 6 +++ azuredeploy.json | 122 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 azuredeploy.json diff --git a/README.md b/README.md index 61daff9..a4d9ec2 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,12 @@ This is a small web application that demonstrates the basic functionality of the 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. + + ## 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 From 796290b545d6168fa1f44b774c059cb7423b790b Mon Sep 17 00:00:00 2001 From: Issei Hiraoka Date: Thu, 18 Jul 2019 17:06:30 +0900 Subject: [PATCH 2/3] add the procedure to use Deploy to Azure button --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a4d9ec2..490818a 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,13 @@ This is a small web application that demonstrates the basic functionality of the [![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. - +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 From d0a1b6a4c4bb676f2788a4839853edcba6736545 Mon Sep 17 00:00:00 2001 From: Issei Hiraoka Date: Thu, 18 Jul 2019 17:20:07 +0900 Subject: [PATCH 3/3] small fix for README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 490818a..246cbc8 100644 --- a/README.md +++ b/README.md @@ -5,11 +5,11 @@ 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.