Forked from davidsantiago-bib/AppServiceDjango_azure.sh
Created
June 13, 2019 09:26
-
-
Save kayode-adechinan/bd5120e3c9afd91aec933826c0cfed32 to your computer and use it in GitHub Desktop.
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
# Create appservice plan named DjangoServicePlan | |
$ az appservice plan create -g DjangoAppRG -n DjangoServicePlan --is-linux --number-of-workers 1 --sku S1 -l westeurope | |
# Create App Service named DjangoDemoAZ | |
$ az webapp create --resource-group DjangoAppRG --plan DjangoServicePlan --name DjangoDemoAZ --runtime "PYTHON|3.7" --deployment-local-git | |
# (optional) Disable ARR DjangoDemoAZ & force HTTPs | |
$ az webapp update --name DjangoDemoAZ --resource-group DjangoAppRG --client-affinity-enabled false --https-only true | |
# (optional) Enable HTTP 2.0, Disable FTP(s) deployment capability and "Always On" mode | |
$ az webapp config set --name DjangoDemoAZ --resource-group DjangoAppRG --http20-enabled true --ftps-state Disabled --always-on false | |
# Define environment variables | |
$ az webapp config appsettings set -g DjangoAppRG -n DjangoDemoAZ --settings DATABASE_NAME=myproject | |
$ az webapp config appsettings set -g DjangoAppRG -n DjangoDemoAZ --settings DATABASE_USER=myadmin@pgdemoserver | |
$ az webapp config appsettings set -g DjangoAppRG -n DjangoDemoAZ --settings DATABASE_PASSWORD=ThisIs4P4ssw0rd!=1 | |
$ az webapp config appsettings set -g DjangoAppRG -n DjangoDemoAZ --settings DATABASE_HOST=pgdemoserver.postgres.database.azure.com | |
$ az webapp config appsettings set -g DjangoAppRG -n DjangoDemoAZ --settings DATABASE_PORT=5432 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment