Last active
February 1, 2019 23:48
-
-
Save joshgav/c003b5b7fca29a485767c477db65e840 to your computer and use it in GitHub Desktop.
Create an Azure Web App
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app_name=your-unique-name | |
app_repo_url=https://github.com/your-name-here/your-repo-here | |
location=westus | |
# choose from: `az webapp list-runtimes --linux` | |
runtime='NODE|10.10' | |
env_vars=( | |
APPINSIGHTS_INSTRUMENTATIONKEY=af4b1113-bc85-41d0-be2b-343c3f178b7b | |
YOUR_ENV_VAR=test | |
) | |
# create group and plan | |
app_plan_name=${app_name}-plan | |
app_group_name=${app_name}-group | |
az group create \ | |
--name $app_group_name \ | |
--location $location | |
az appservice plan create --is-linux \ | |
--name $app_plan_name \ | |
--resource-group $app_group_name \ | |
--location $location | |
# create the app | |
az webapp create \ | |
--name $app_name \ | |
--plan $app_plan_name \ | |
--resource-group $app_group_name \ | |
--deployment-source-url $app_repo_url \ | |
--runtime $runtime | |
# set environment variables | |
az webapp config appsettings set \ | |
--name $app_name --resource-group $app_group_name \ | |
--settings $env_vars |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment