Set up the data plane
Deploy the Braintrust data plane infrastructure in your Azure subscription.1
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.
2
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
3
Connect to AKS cluster
After the Terraform deployment completes, connect to your AKS cluster:Verify the connection:
4
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:5
Deploy Helm chart
Deploy the Braintrust Helm chart to your cluster:
6
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.
7
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.8
Enable Front Door in Terraform
Update Apply the changes:
main.tf with the values from the previous steps:9
Get your API URL
After the Front Door deployment completes, get your API URL from the Terraform outputs:Test the endpoint:You should receive a 200 OK response. Save this URL - you’ll need it to configure your Braintrust organization.
Configure your organization
Connect your Braintrust organization to your newly deployed data plane.1
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.
- Select Save.
2
Verify the connection
The UI will automatically test the connection to your new data plane. Verify that the ping to each endpoint is successful.
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.