Contents
Setup Scripts
This directory contains helper scripts to provision and deploy the Azure Function and configure pg_durable variables.
Included scripts
create_function_app.shdeploy_function.shconfigure_pg.shcleanup_azure.shsmoke_check.sh
Script responsibilities
create_function_app.sh
- Validate required tools (
az, optionallyfunc) - Create resource group (or use existing)
- Create storage account and function app
- Generate names automatically from
pgd_ex_af_<5 random hex> - Allow changing only location (
-l, defaulteastus) - Derive function app and storage account names with Azure-safe sanitization
- Output app name and default URL
- Write app metadata to
.azure-functions.env
deploy_function.sh
- Package/deploy Python function code
- Sync function definitions
- Read app/resource-group from
.azure-functions.env(required) - Use function name from
.azure-functions.envwhen present, elsechunk_text - Return function endpoint and function key retrieval instructions
- Write function endpoint and key to
.azure-functions.env
configure_pg.sh
- Read endpoint + function key from
.azure-functions.envby default - Allow endpoint + key overrides via
-u/-k - Run SQL that sets pg_durable variables for current session/demo
- Optionally print verification queries
cleanup_azure.sh
- Read resource group from
.azure-functions.envby default - Allow resource group override via
-g - Delete the resource group and all contained resources
- Prompt for confirmation unless
-yis supplied
smoke_check.sh
- Run fast, non-cloud validation for this example
- Check shell syntax for all scripts in this directory
- Check Python syntax for the function code
- Validate JSON files used by Azure Functions host/runtime
Usage notes
- Keep scripts non-interactive where possible (flags/env vars)
- Fail fast with clear error messages
- Avoid writing secrets to tracked files
- Print copy/paste-safe outputs for SQL setup
- Use
./scripts/smoke_check.shlocally before opening a PR