Databricks-GenAI-Assoc Assembling and Deploying Apps Practice Question
A team wants its Databricks App to read a secret that stores an external API key used by an agent tool. The secret is managed in a Databricks secret scope. Which approach correctly exposes the secret to the running app without putting the value in source control?
⚠ Common exam trap
The trap here is using bundle variables or a .env file for sensitive values, when secret scope references in the app configuration are the sanctioned mechanism.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Reference the secret scope and key in the app configuration's environment variables using the secrets-backed value syntax, then read it from the environment in code.
The app configuration can declare environment variables whose values are resolved from a Databricks secret scope using the secrets-backed reference syntax. The platform injects the resolved value at runtime, so the key is available to the process without ever being written into source, committed to a repository, or surfaced through deployment output.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Pass the key as a bundle variable in databricks.yml so it is substituted during deployment.
Why it's wrong here
Bundle variables are for non-sensitive configuration and their resolved values can surface in deployment output, making them unsuitable for secrets. Using a variable here risks exposing the key in logs or plan output. Secrets should be resolved through the secret scope reference in the app configuration, not through bundle variable substitution.
- ✗
Commit the API key into a .env file in the app repository and load it with a dotenv library at startup.
Why it's wrong here
Committing a .env file places the secret in version control, where it persists in history and is visible to anyone with repository access. Even if later removed, the value remains recoverable. This directly violates the requirement to keep the key out of source control and is a common but serious security mistake.
- ✗
Store the key in a Delta table and have the app query the table with its service principal at startup.
Why it's wrong here
While a Delta table can be access-controlled, storing a raw secret in a queryable table widens exposure to anyone with read access and turns a configuration concern into a data governance one. It also requires the app to query at startup and handle table failures. The platform's secret reference mechanism is simpler and purpose-built for this need.
- ✓
Reference the secret scope and key in the app configuration's environment variables using the secrets-backed value syntax, then read it from the environment in code.
Why this is correct
Databricks Apps can declare environment variables whose values are resolved from a secret scope using the secrets-backed reference syntax. At runtime the platform injects the resolved value into the process environment, so the code reads it like any environment variable and the secret never appears in source or logs. This is the supported way to pass secrets to a deployed app.
Visual reference
About these practice questions
One of 330 original Databricks-GenAI-Assoc practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Databricks exam blueprint
This Databricks-GenAI-Assoc practice question is part of Courseiva's free Databricks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the Databricks-GenAI-Assoc exam.