Skip to main content

1.3 Deploy services

Outcome

The four runtime services — rcm-core, rcm-app, edi-gateway, edi-app — are running in Azure, configured to talk to master DB, Key Vault, and Service Bus.

Prerequisites

Service map

Steps

  1. Configure GitHub Actions secrets

    In the repo's GitHub Actions secrets, add:

    SecretValue
    AZURE_CREDENTIALSOutput of az ad sp create-for-rbac --name sp-rcm-deploy --role Contributor --scopes /subscriptions/$(az account show --query id -o tsv) --sdk-auth
    AZURE_RGrg-rcm-prod-eastus2
    KEY_VAULT_NAMEkv-rcm-prod-eastus2
    MASTER_DB_HOSTpg-rcm-master-prod.postgres.database.azure.com
    SERVICE_BUS_NAMESPACEsb-rcm-prod-eastus2
    STORAGE_ACCOUNTstrcmprodeastus2
  2. Trigger the deploy workflow

    gh workflow run deploy-prod.yml -f environment=prod
    gh run watch

    The pipeline:

    1. Builds all four apps with pnpm turbo build.
    2. Pushes container images for rcm-core and edi-gateway to acrrcmprod.
    3. Deploys those container images to Azure Container Apps with managed identity.
    4. Deploys rcm-app and edi-app static bundles to their Static Web Apps.
    5. Health-checks each service before marking the run green.
  3. Bind managed identities to Key Vault

    The container apps need read access to the Key Vault secrets they'll consume at runtime:

    for app in rcm-core edi-gateway; do
    PRINCIPAL_ID=$(az containerapp identity show \
    --resource-group rg-rcm-prod-eastus2 \
    --name "ca-$app-prod" \
    --query principalId -o tsv)
    az role assignment create \
    --assignee "$PRINCIPAL_ID" \
    --role "Key Vault Secrets User" \
    --scope $(az keyvault show -n kv-rcm-prod-eastus2 --query id -o tsv)
    done
  4. Verify each service is up

    curl -fsSL https://rcm-core.medsuite.com/health
    curl -fsSL https://edi-gateway.medsuite.com/health

    Both should return {"status":"ok"}.

Validation

CheckExpected
gh run list --workflow deploy-prod.yml --limit 1latest run is completed/success
curl rcm-core.medsuite.com/health200 + {"status":"ok"}
curl edi-gateway.medsuite.com/health200 + {"status":"ok"}
curl rcm-core.medsuite.com/metrics200 (Prometheus exposition)

Troubleshooting

SymptomLikely causeFix
/health returns 503Service can't reach master DBCheck the container app's outbound networking + firewall rule on the master DB.
Cannot find secret in container app logsManaged identity missing role assignmentRe-run step 3 for the affected app.
Build fails with turbo daemon errors in CIStale Turbo cacheClear .turbo cache in the workflow with pnpm turbo prune --scope=… or pin the Turbo version.

Next

1.4 — Master DB initialization