Staging storage is required only for Event and Flag Applied connectors. If your assignment data already exists in Databricks, for example because another feature-flagging platform writes it there, you can skip the Flag Applied connector setup and create an assignment table that queries the existing data.If you are not configuring an Event or Flag Applied connector, you can also skip the staging storage setup.
The Databricks service principal and the staging-provider identity are separate identities. You can reuse the same Databricks service principal and SQL warehouse across staging-provider configurations, but configure only one staging provider for each connector.
Before you begin
- You need a Confidence account.
- You need access to a Databricks workspace with Unity Catalog enabled.
- You need permission to create or reuse a SQL warehouse, service principal, catalog/schema, and grants in Databricks.
- To configure an Event or Flag Applied connector, you need permission to set up S3 or ADLS Gen2 staging in AWS or Azure. Step 5 lists what you need.
Step 1: Create or reuse a SQL warehouse
Confidence sends SQL statements to a Databricks SQL warehouse. You can create a new warehouse or reuse an existing warehouse in the workspace.- In Databricks, open SQL warehouses.
- Create a warehouse, or select an existing warehouse that Confidence can use.
- Copy the warehouse ID.
- Open the warehouse Connection details and copy the server hostname.
Use the SQL warehouse ID for Warehouse ID. The warehouse ID is not the JDBC HTTP path.
Keep the warehouse running, or configure its start-up and auto-stop settings so that Confidence can start it when it needs to run a query.
For more information, see the Databricks documentation for SQL warehouse access control.
Step 2: Create a Databricks service principal
Create a Databricks service principal for Confidence. This service principal is used for OAuth machine-to-machine authentication and for running SQL. It is separate from the identity used by the selected staging provider.- In the Databricks account console, open Identity and access > Service principals.
- Create a service principal.
- Assign the service principal to the Databricks workspace that contains the SQL warehouse.
- Give it the Databricks SQL access entitlement.
- Create an OAuth secret for the service principal. Save the service principal application ID, also called the OAuth client ID, and the generated OAuth secret securely.
Step 3: Grant the service principal access to the warehouse
The service principal must be allowed to run queries on the SQL warehouse.- Open the SQL warehouse in Databricks.
- Open Permissions.
- Add the Confidence service principal.
- Grant Can use.
Step 4: Create a catalog and schema
Choose the Unity Catalog catalog and schema where Confidence will create its tables. In the Confidence connection forms, enter the fully qualified schema ascatalog.schema. For example:
CREATE TABLE IF NOT EXISTS. You do not need to grant the service principal permission to create schemas unless you want Confidence to create schemas on your behalf.
If a connector table already exists and is owned by another principal, grant the service principal permission to modify that table:
GRANT syntax.
Step 5: Configure staging storage
This is the point where the setup differs by staging provider. The SQL warehouse, Databricks service principal, catalog, schema, and Unity Catalog permissions above are shared. Choose one supported staging provider for each Event or Flag Applied connector.- Amazon S3
- Azure ADLS Gen2
Confidence writes Parquet files to S3 and then runs The role needs to list the bucket, write and read staged objects, delete validation and completed objects, and abort incomplete multipart uploads.You do not need to give the Databricks service principal an AWS IAM role for this staging path. Confidence supplies short-lived S3 credentials when it runs
COPY INTO in Databricks. Confidence uses the IAM role to access the bucket and supplies short-lived credentials to Databricks for the load.Create or reuse an S3 bucket
Create an S3 bucket, or choose an existing bucket. Select the AWS region where the bucket is located. The bucket must be in the region selected in the connection form.Configure the IAM role
The role must trust the Confidence service account. The S3 form supports either web identity authentication or an IAM access key and secret.Recommended: web identity authentication
- In the AWS IAM console, create a role with a custom trust policy.
- Leave Authenticate with credentials unchecked in the Confidence form. The form shows the Confidence service account ID to use in the trust policy.
- Replace
<confidence_service_account_id>in the following policy with that ID:
Alternative: IAM user credentials
If web identity authentication is not suitable for your AWS account, create an IAM user with an access key and secret. Configure the role trust policy to trust that user’s ARN and grant the usersts:AssumeRole on the role. Enter the access key and secret by selecting Authenticate with credentials in the Confidence form.Grant the role access to the bucket
Attach an inline or managed policy to the role. Replace<s3_bucket_name> with the bucket name:COPY INTO.Enter the S3 settings in Confidence
In the Databricks connector form, select AWS - S3 and enter:- Region: the AWS region of the bucket.
- Role ARN: the IAM role that Confidence assumes.
- Bucket: the S3 bucket name, without an
s3://prefix. - Authenticate with credentials: leave unchecked for web identity authentication; select it only when using an IAM access key and secret.
Step 6: Configure the Metrics Data Warehouse
The Metrics Data Warehouse uses the shared Databricks service principal and SQL warehouse. It does not use staging storage.- In the Confidence app, select Admin > Connections > Metrics Data Warehouse.
- Select Databricks.
- Enter the Databricks Server hostname in Host (excluding protocol). Then enter the Warehouse ID, Client ID, and Client Secret from the earlier steps.
- Enter the Exposure schema and Results schema. Use fully qualified Unity Catalog names such as
main.confidence_exposureandmain.confidence_results. - Click Save.
USE CATALOG, USE SCHEMA, and SELECT on the tables that Confidence reads for metrics. It also needs the appropriate write permissions on the results schema. You can use the same schema for both fields, or keep exposure and results data in separate schemas.
Step 7: Configure an Event or Flag Applied connector
For an Event or Flag Applied connector, Confidence writes Parquet files to the staging provider and then loads them into Databricks tables. The connector form requires exactly one staging provider.Event connector
- In the Confidence app, select Admin > Connections > Events.
- Create an event connection and select Databricks as the destination.
- Enter the fully qualified Schema, shared Databricks connection settings, staging provider settings, and batch settings.
- Select Validate. Confidence checks storage access, Databricks access, table creation, and a test load before allowing you to continue.
- Resolve any validation errors and save the connection.
Flag Applied connector
- In the Confidence app, select Admin > Connections > Flag Applied.
- Create a connection and select Databricks as the destination.
- Enter the assignment Table, fully qualified Schema, shared Databricks connection settings, staging provider settings, and batch settings.
- Select Validate. Confidence checks storage access, Databricks access, table creation, and a test load before allowing you to continue.
- Resolve any validation errors and save the connection.
MODIFY on that table.
Step 8: Configure an assignment table
To use Flag Applied data in exposure calculations, create an assignment table that points to the Databricks table.1
Open the Flag Applied connection
In the Confidence app, select Admin > Connections > Flag Applied and open the Databricks connection you created.
2
Create an assignment table
In the Assignment tables section, click Create.
3
Create or select an entity
Create a new entity or select an existing entity. Entities are the things you experiment on, such as users. Enter an entity name such as
User and select the type of the identifier that identifies the entity.4
Enter the assignment table name
Enter the Databricks table name, such as
flag_applied.5
Create the assignment table configuration
Click Create.
Troubleshooting validation
Validation runs a small end-to-end check. It verifies that Confidence can access the staging location, write a temporary object, connect to the Databricks workspace, use the selected warehouse, inspect the schema, create a table, and load test data. It removes the temporary validation data afterward. If validation fails, start by checking the selected staging provider’s identity and storage permissions. Then verify the Databricks service principal’s warehouse and Unity Catalog permissions.Related resources
Metrics introduction
Overview of metrics in Confidence
Fact tables
Configure fact tables for metrics
Assignment tables
Set up assignment tracking
Configure metric quickstart
Create your first metric

