Set up the data plane
Deploy the Braintrust data plane infrastructure in your Azure subscription.Configure the Terraform module
The Braintrust Terraform module contains all the necessary resources for a self-hosted Braintrust data plane. A dedicated Azure subscription for your Braintrust deployment is recommended but not required.
-
Copy the entire contents of the
examples/defaultdirectory from the terraform-azure-braintrust-data-plane repository into your own repository. -
In
provider.tf, configure your Azure subscription and tenant details. -
In
terraform.tf, set up your remote backend (typically Azure Blob Storage). -
In
main.tf, customize the Braintrust deployment settings. The default configuration is for a large production-sized deployment. Adjust them based on your needs, but keep in mind the hardware requirements. -
Initially set
enable_front_door = falseinmain.tf. You’ll enable this later after configuring the load balancer.
Deploy the base infrastructure
Initialize and apply the Terraform configuration:This will create all necessary Azure resources including:
- AKS cluster for running Braintrust services
- Azure Database for PostgreSQL
- Azure Cache for Redis
- Azure Storage Account
- Virtual Network
- Azure Key Vault for encryption and secrets
Connect to AKS cluster
After the Terraform deployment completes, connect to your AKS cluster:Verify the connection:
Configure Helm values
Create a
helm-values.yaml file for your deployment. Refer to the Helm chart documentation for configuration options.Configure the API service as a LoadBalancer with Azure internal annotation:Deploy Helm chart
Deploy the Braintrust Helm chart to your cluster:
Configure Front Door
Retrieve the load balancer IP address and frontend configuration:Save the load balancer IP address and frontend IP configuration ID for the next step.
Approve Private Link Service
In the Azure Portal, find the private link service named
<deployment>-aks-api-pls and manually approve it.This step is required before Front Door can connect to your AKS cluster.Enable Front Door in Terraform
Update Apply the changes:
main.tf with the values from the previous steps:Configure your organization
Connect your Braintrust organization to your newly deployed data plane.Point your organization to your data plane
- In the Braintrust UI, go to Settings > Data plane.
- In API URL area, select Edit.
- Enter the API URL from the last step.
- Leave the other fields blank.
- If your deployment is accessed through a VPN or is otherwise on a private network (not accessible from the public internet), enable Data plane is on a private network. This enables Chrome’s Local Network Access permission handling, which is required for browser access to private network resources. When enabled, Chrome will prompt users to grant permission for the Braintrust UI to access your self-hosted data plane. See Grant browser permissions for details.
- Select Save.
Update the deployment
Updating your Azure deployment involves two steps: updating infrastructure with Terraform and updating services with Helm.Update infrastructure (Terraform)
Runterraform apply to update infrastructure components (database, Redis, networking, storage, etc.):
?ref=<version> to the module source:
Update services (Helm)
After updating infrastructure, upgrade the Helm chart to update service containers and configurations:In some cases, Terraform changes must be applied before Helm upgrades. Check the release notes for any specific upgrade ordering requirements.