Azure infrastructure for Drasi on Azure Container Apps.
Current state behavior and replica constraints are documented in docs/drasi-state-contract.md.
- Current runtime mode is single replica (
minReplicas: 1,maxReplicas: 1). - Durable runtime config and
redbstate are persisted on Azure Files at/drasi-persist. - Multi-replica promotion requires passing the explicit readiness gates for partition ownership, replay determinism, and conflict handling.
Before changing replica counts, review and complete the checklist in docs/drasi-state-contract.md.
The durable state path is created entirely through Bicep in azure/modules/drasi-runtime.bicep and wired from azure/prod/main-prod.bicep.
- A Storage Account for runtime persistence (
Microsoft.Storage/storageAccounts). - A File Share for Drasi runtime data (
Microsoft.Storage/storageAccounts/fileServices/shares). - A managed-environment storage binding in Container Apps (
Microsoft.App/managedEnvironments/storages) that points to the Azure File Share. - A Container App volume using
storageType: 'AzureFile', mounted at/drasi-persist.
- The runtime config secret (
server.yaml) is mounted separately as a secret volume at/config-secret. - Startup logic creates
/drasi-persistand copiesserver.yamlonly when/drasi-persist/server.yamldoes not already exist. - Drasi then starts with
--config /drasi-persist/server.yaml, so API-created mutations persist on the file share. STATE_STORE_PATHis set to/drasi-persist/state.redb, and runtime config defaults tostateStore.kind: redb.
- Restarting a container or rolling revisions no longer wipes runtime config and
redbstate. - The repository keeps single-replica defaults while multi-replica readiness gates are validated.
This repository is configured for Azure Developer CLI (azd) deployment.
azd env new <env-name>
azd env select <env-name>azd env set WORKLOADPREFIX drasi
azd env set ENVIRONMENT prod
azd env set CONTAINERIMAGE ghcr.io/drasi-project/drasi-server@sha256:c3b025b35626a9877631197391fbc527f4aff65c88516214a427462942b451ba
azd env set ACAINFRASTRUCTURESUBNETRESOURCEID /subscriptions/<subscription-id>/resourceGroups/<network-rg>/providers/Microsoft.Network/virtualNetworks/<vnet>/subnets/<aca-subnet>
azd env set RUNTIMECONFIGSECRETURI https://<kv-name>.vault.azure.net/secrets/drasi-runtime-config/<secret-version>
azd env set POSTGRESHOST <postgres-server>.postgres.database.azure.com
azd env set POSTGRESDATABASENAME drasi
azd env set POSTGRESUSERNAME drasi_admin
azd env set POSTGRESPASSWORDSECRETURI https://<kv-name>.vault.azure.net/secrets/drasi-postgres-password/<secret-version>
azd env set REDISHOST <redis-host>.redis.cache.windows.net
azd env set REDISPASSWORDSECRETURI https://<kv-name>.vault.azure.net/secrets/drasi-redis-password/<secret-version>
azd env set KEYVAULTNAME <kv-name># Preview only
./scripts/validate.ps1 -EnvironmentName <env-name>
# Apply infrastructure + deploy phase
./scripts/deploy-azd.ps1 -EnvironmentName <env-name>azure.yaml hooks run automatically:
scripts/azd-preprovision.ps1before provision (az bicep build)scripts/azd-postprovision.ps1after provision (Container App state +/healthchecks)