部署到 Azure Web App 的方式
使用 Azure CLI 部署 web app
目前有找到一個範例,但是部署上去的過程有問題,官網的 deployment script
create group
1
az group create --name ldlDeploy --location japanwest
create plan
1
az appservice plan create --name ldlDeployPlan --location japanwest --is-linux --sku FREE --resource-group ldlDeploy
create web app
1
az webapp create --name ldlDeploy --plan ldlDeployPlan --runtime "NODE|12-lts" --resource-group ldlDeploy
set using local git to push
1
az webapp deployment source config-local-git --name ldlDeploy --resource-group ldlDeploy
add remote
1
git remote add azure "https://paul_tseng@ldlDeploy.scm.azurewebsites.net/ldlDeploy.git"
push
1
git push azure master
錯誤
在部署的過程中一遇到
npm run bulid時,如果裡面有使用tsc && webpack的話,會失敗,不太確定是不是因為 Azure 上面的虛擬機沒有 tsc 或 webpack

使用 VSCode 部署
在 vs code 安裝 Azure App Service
點選上傳按鈕

選取 Create new Web App

輸入網站名稱

選取 Node js 版本,測試時是使用 Node 12 LTS

輸入完成後就會開始部署