This directory contains Bash scripts for deploying and validating the sample using the azlocal CLI. For details about the sample application, see Azure Web App with Azure Database for PostgreSQL flexible server.
pip install azlocaldeploy.sh provisions the same resources as the Bicep and Terraform variants but with raw az commands:
- Azure Resource Group.
- Azure Log Analytics Workspace.
- Network Security Groups for both subnets.
- Azure NAT Gateway.
- Azure Virtual Network with:
- app-subnet: delegated to
Microsoft.Web/serverFarms(with NAT gateway). - pe-subnet: hosts the Private Endpoint (no delegation;
disable-private-endpoint-network-policies=true).
- app-subnet: delegated to
- Azure Database for PostgreSQL flexible server: public-access mode,
Burstable / Standard_B1ms, version 16, 32 GiB, HA disabled. With a permissiveAllowAllIPsfirewall rule. - The
PlannerDBdatabase. - Azure Private DNS Zone
privatelink.postgres.database.azure.com, linked to the VNet. - Azure Private Endpoint targeting the PG server with group
postgresqlServer, plus the DNS-zone group that auto-registers the A record. - A separate application role (
testuser) created viapsql, with the minimum schema privileges onPlannerDB. - The
activitiestable and three seeded rows (Go to Paris, Go to London, Go to Mexico). - Azure App Service Plan.
- Azure Web App with regional VNet integration into app-subnet, configured with
PG_HOST,PG_PORT,PG_USER=testuser,PG_PASSWORD,PG_DATABASE,LOGIN_NAME,WEBSITES_PORT.
The Web App uses testuser — the server-admin login is never written into the Web App's app settings. Use validate.sh after deploy.sh to inspect each Azure resource.
# default secrets
bash deploy.sh
# override secrets via env vars
PG_ADMIN_PASSWORD='<admin-password>' \
PG_APP_PASSWORD='<app-password>' \
bash deploy.sh
# inspect what was deployed
bash validate.shdeploy.sh accepts the following environment overrides:
| Env var | Default | Description |
|---|---|---|
PG_ADMIN_USER |
pgadmin |
Server administrator login |
PG_ADMIN_PASSWORD |
P@ssw0rd1234! |
Server administrator password (sensitive) |
PG_DATABASE_NAME |
PlannerDB |
Application database |
PG_APP_USER |
testuser |
Application role used by the Web App |
PG_APP_PASSWORD |
TestP@ssw0rd123 |
Password for the application role |
DEPLOY_APP |
1 |
Set to 0 to skip the zip deployment step |
The script uses call-web-app.sh (unchanged from the source sample) to demonstrate four ways of hitting the Web App from outside the emulator.