az login
az account show
rename file terraform.tfvars.example to terraform.tfvars
add your variables and follow the next step
open main.tf and update filebase64("./secure/novablog_me.pfx")
to your SSL certificate + private key
openssl pkcs12 -export -out novablog_me.pfx -inkey private.key -in novablog_me.crt
Important
If you have more experience open main.tf file and manually set you image registry.
Important
The first time you run the terraform apply
it will fail. Just follow the instructions.
Important
Make sure you are logged into Azure by running az login
terraform init
terraform plan
terraform apply
Important
You need to run the following commands inside backend folder, which is where Dockerfile is located.
# azure login
az acr login --name mydjangoappacr
# build
docker build -t mydjangoappacr.azurecr.io/djangoapp:latest .
# upload
docker push mydjangoappacr.azurecr.io/djangoapp:latest
# check if image was uploaded
az acr repository show-tags --name mydjangoappacr --repository djangoapp
Re-run terraform
terraform apply
az container logs --resource-group myDjangoApp-rg --name mydjangoapplication
az network public-ip show --resource-group myDjangoApp-rg --name myPublicIP --query ipAddress --output tsv
az network application-gateway address-pool update --resource-group myDjangoApp-rg --gateway-name myAppGateway --name backend-pool --add backendAddresses ipAddress=10.0.2.4
terraform destroy