LoginSignup
2
5

More than 5 years have passed since last update.

AzureCLIからWebAppsを作成する

Posted at

前準備

  • 適当にプロジェクトファイルを作成しておく
### azure-cliのインストール
brew update && brew install azure-cli

### ログイン ブラウザにて認証する
az login

### リソースグループを作る
az group create --name hogegroup --location japanwest

### Azure Plan 作成、今回はFREE
az appserviceplan create --resource-group Resource-Group1 --name myAppServicePlan --location japaneast --sku FREE

### Microsoft.webのプロバイダが登録されてないと怒られた時にやる
az provider register --namespace Microsoft.Web

WebAppsの作成

### 今回はnode8.1で作成
az webapp create --resource-group Resource-Group1 --name hogeapp --plan myAppServicePlan --runtime "NODE|8.1"

### 他のRuntimeにしたい時にやる
az webapp list-runtimes
  • https://{app名}.azurewebsites.netを確認

ローカルソースをデプロイ

### ソースをzip化 index.htmlとかがあるディレクトリでやること!
zip -r hogePJ.zip hogePJ

### デプロイ
az webapp deployment source config-zip --resource-group Resource-Group1 -n hogeapp --src {zipまでのpass}/hogePJ.zip

https://{app名}.azurewebsites.netを確認
index.htmlの内容が表示されていればデプロイ完了

毎回zipにするのもめんどくさいし、webapps管理画面上でローカルgitと連携させた方が簡単そう

2
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
5