Skip to main content

BigHammer setup scripts

Deployment automation scripts for Azure live in your deployment repository alongside Helm values (for example scripts/ in your organization's chart repo). Use them to prepare PostgreSQL and Key Vault before the platform chart is installed.

ScriptPurpose
create-dbs-azure.shCreate databases, roles, schemas, and grants on PostgreSQL Flexible Server
Platform install scriptOne-time Key Vault secrets, pre-Helm validation, helm upgrade --install
install-prerequisites-azure.shInstall ESO, Reloader, RabbitMQ

Never commit real credentials — use install-config-azure.env locally (gitignored).


StepActionWhen
0Provision PostgreSQL instance, databases, users, and platform Key Vault passwords (Terraform, portal, or automation)Once per environment
1create-dbs-azure.shSchemas and grants inside the application database
2Platform install script / manual Key Vault uploadVerifies platform prerequisites; creates one-time app secrets
3Cluster preparationESO, edge, RabbitMQ, TLS
4Helm installPlatform Deployment
Keycloak database — infrastructure only

The Keycloak server pod (bhkeycloak) is not on the application database. Infrastructure provisions:

ResourceReference nameChart mapping
Databasekeycloak_db_<env>global.bhkeycloak.env.KC_DB_URL
Userkeycloak_db_userglobal.bhkeycloak.env.KC_DB_USERNAME
PasswordKey Vault bh-kcdbpwdKC_DB_PASSWORD via global.remoteSecrets.keycloak.dbPassword

create-dbs-azure.sh may create the Keycloak database and user, but Keycloak runtime tables are created by Keycloak itself in public.

If database or user names differ from reference defaults, see Renaming databases or users.

See Key Vault Secrets and Infrastructure — PostgreSQL.


Quick start

cd scripts
cp install-config-azure.example.env install-config-azure.env
# Edit install-config-azure.env with your values

./validate-<env>-dependencies.sh # optional explicit pre-flight
./install-prerequisites-azure.sh # once per cluster
./install-platform-azure.sh # DBs, Key Vault, Helm deploy (script name may vary)

A one-shot wrapper (for example install-uat.sh) may chain prerequisites + platform install.


Automated install flow

The platform install script orchestrates (resumable — completed steps are skipped on re-run):

StepAction
1Validate ACR images exist (optional, from values file tags)
2Validate Key Vault reachability
3Create PostgreSQL databases, roles, and schemas (create-dbs-azure.sh)
4Push or verify Key Vault secrets
5Pre-Helm validation — all required secrets present
6Verify External Secrets Operator is running
7helm upgrade --install for the platform umbrella chart

Set FORCE_RUN=true to re-run all steps from scratch.


Script catalog

ScriptPurpose
validate-*-dependencies.shPre-flight: Azure login, PostgreSQL, Key Vault, ACR, storage, kubectl, ESO, RabbitMQ
install-uat.sh (or equivalent)One-shot: validation + prerequisites + platform install
install-prerequisites-azure.shInstall ESO, Reloader, RabbitMQ (and optionally Redis)
Platform install scriptACR check, KV validation, DB bootstrap, secret sync, Helm deploy
create-dbs-azure.shCreate databases, application roles, schemas; push DB secrets to Key Vault
create-storage-secrets.shPush blob storage account name/key to Key Vault
push-tls-to-keyvault.shBootstrap wildcard TLS cert/key into Key Vault
push-license-to-keyvault.shPush catalog license and verifier public key
setup-workload-identity-federation-azure.shCreate AKS OIDC federated credentials for ESO and app service accounts
enable-aks-blob-csi.shEnable Blob CSI driver on the cluster (once per cluster)
copy-tls-from-bighammer.shCopy TLS secret from platform namespace to Airflow namespace
setup-databricks-akv-secret-scope.shConfigure Databricks Key Vault–backed secret scope (optional)

Configuration: install-config-azure.env

Copy from install-config-azure.example.env or install-config-azure.placeholder.env.

Required variables

VariableDescription
DB_USERPostgreSQL admin login
DB_HOST<server>.postgres.database.azure.com
DB_PORT5432 (default)
DB_PASSWORDPostgreSQL admin password
KEY_VAULT_NAMEAzure Key Vault name
KEY_VAULT_RESOURCE_GROUPResource group for the vault
HELM_NAMESPACEPlatform namespace (e.g. bh-control-plane)
HELM_RELEASEHelm release name (e.g. bighammer)

Skip flags

FlagEffect
SKIP_DATABASESSkip database creation
SKIP_KEYVAULTSkip Key Vault secret upload
SKIP_ESO_CHECKSkip ESO health check
SKIP_HELMSkip Helm install (print command only)
SKIP_PREREQUISITESSkip ESO / reloader / RabbitMQ install
SKIP_ACR_CHECKSkip ACR image validation
RUN_HELM_INSTALLSet false to stop before Helm
VALIDATE_DATABASES_ONLYCheck DB state and exit

Database creation

create-dbs-azure.sh provisions PostgreSQL objects on Azure Flexible Server.

Usage:

export DB_USER="<admin-user>"
export DB_HOST="<server>.postgres.database.azure.com"
export DB_PASSWORD="<password>"
export KEY_VAULT_NAME="<your-keyvault>"
./create-dbs-azure.sh

Prerequisites: psql, PGSSLMODE=require for Azure

Dual-role database users

RoleKey Vault secretHelm env varPurpose
bh_dev_userazure-postgres-master-passwordPOSTGRES_USER / POSTGRES_PASSWORDMigrations, Alembic, DDL
bh_app_userbh-app-user-passwordBH_APP_USER / BH_APP_USER_PASSWORDRuntime API and worker DML

Databases

DatabasePurpose
<TARGET_DB> (main app DB)Hosts application schemas
keycloak_db_<env>Keycloak persistence (name configurable)

Schemas (in main app database)

  • catalog_db
  • agent_db
  • audit_db
  • celery_db
  • keycloakapi_db
  • llm_observability_db

The script is idempotent — re-runs skip existing databases and grants when AUTO_SKIP_EXISTING_DATABASES and SKIP_GRANT_IF_COMPLETE are enabled (defaults).


SQL assets

FilePurpose
sql/grant_application_schemas.sqlCanonical schema grants
sql/create_setup_db.sqlManual bootstrap template (prefer create-dbs-azure.sh)

References

TopicLink
GCP equivalentGCP Scripts Reference
Secrets mappingKey Vault Secrets