Cert EspressoLearn. Practise. Find your flow.

A LITTLE FOCUS.
A BIG NEXT STEP.

Your pace. Your space.
Databricks · Databricks Machine Learning Professional

Environments and Declarative Automation Bundles

Databricks Machine Learning Professional · Lesson 16 of 22 · 1:52:35

YouTube loads only after you press play. This chapter opens at its timestamp in the full course. Watch on YouTube ↗

Learning with these videos? Subscribe for new courses and exam-style questions.

In this lesson

Prepare for the Databricks Certified Machine Learning Professional exam. In this lesson: environments and identities (service principals), bundles and targets in Declarative Automation Bundles (formerly Databricks Asset Bundles), machine learning resources such as jobs, experiments, and registered models, and the bundle validate, deploy, and run commands. Includes three original practice questions.

Study notes

The text of this lesson, to read at your own pace. Information as of November 2026.

Created by hand

Pebblecove's staging endpoint was created by hand in the user interface, and the production one was created months later, with different settings, so the two environments never behaved alike. A bundle describes every resource once, as code, and deploys it the same way to each environment. This lesson covers how to set up scalable environments for machine learning, and how to define endpoints, experiments, and registered models with Declarative Automation Bundles.

Environments and identities

A scalable setup gives each stage its own environment: development, staging, and production, as separate catalogs in Unity Catalog, and often as separate workspaces. Data scientists get full access in development, and read only access to production data, so they can explore it without changing it. Production jobs and endpoints run as service principals, identities made for automation, so nothing depends on a person's account. Every resource is described as code in Git, so the three environments differ only by their settings, not by changes made by hand. And continuous integration, not people, deploys to staging and production.

Bundles and targets

Declarative Automation Bundles, formerly Databricks Asset Bundles, describe a project as code: its source files, plus its Databricks resources, in YAML configuration files. The targets section defines the environments, like dev, staging, and prod, each with its workspace, and with variables that change, like the catalog name. A target in development mode prefixes resource names with dev and your user name, and pauses every schedule and trigger, so personal copies never collide or run by surprise. A target in production mode checks the deployment, for example the Git branch, and Databricks recommends setting run_as to a service principal there. So one definition gives three environments that stay alike.

Machine learning resources

Under resources, a bundle declares what the project needs, and the machine learning ones matter here. experiments defines MLflow experiments, by name and path, so each environment gets its own. registered_models defines models in Unity Catalog, with their catalog, schema, and name, and the grants on them. model_serving_endpoints defines endpoints, with their served entities, their traffic routes, their scale to zero setting, and their AI Gateway or telemetry settings. Jobs, pipelines, quality monitors, and feature specs complete the picture, and variables like the catalog name let the same file serve every target.

Bundle commands

The Databricks command line interface runs the bundle. bundle init can start from a template, like MLOps Stacks, which creates the code, the resources, and the continuous integration files. bundle validate checks the configuration, bundle deploy with the target flag creates or changes the resources in that environment, and bundle run starts a job or a pipeline. In continuous integration, a pull request validates and deploys to staging and runs the tests, and a merge or a release deploys to production, as the service principal.

Recap

Let's recap. Development, staging, and production are separate catalogs, often separate workspaces, with read only production access for data scientists. Production runs as service principals, and deployments come from continuous integration. Declarative Automation Bundles describe resources as code, with a target for each environment, in development or production mode. experiments, registered_models, and model_serving_endpoints declare the machine learning resources. And bundle validate, deploy, and run manage them from the command line.

Quick checks for this lesson

The 3 questions of this lesson, as plain text. The button above runs them with shuffled choices and the reason behind every choice.

  1. A production retraining job runs as the data scientist who created it, and fails the day that person leaves. What should it run as?

    • The workspace administrator’s account
    • A shared user account
    • The next data scientist on the team
    • A service principal
    Show the answer

    A service principal

    A service principal is an identity made for automation, which does not depend on any person, so production keeps running when people change roles. “The workspace administrator’s account” would still tie production to a person. “A shared user account” is a shared account, which is hard to audit and to protect. And “The next data scientist on the team” only moves the problem to someone else.

  2. In a bundle, which resource key defines a serving endpoint, with its served entities and traffic routes?

    • registered_models
    • model_serving_endpoints
    • experiments
    • quality_monitors
    Show the answer

    model_serving_endpoints

    Model_serving_endpoints defines endpoints, with their served entities and routes. “registered_models” would define models in Unity Catalog, not the endpoints that serve them. “experiments” would define MLflow experiments. And “quality_monitors” would define data profiling monitors.

  3. A data scientist deploys the bundle to the dev target, and the nightly training job does not run. Why?

    • Development mode pauses every schedule
    • Jobs cannot run in a development workspace
    • The job needs a service principal in dev
    • bundle validate was not run first
    Show the answer

    Development mode pauses every schedule

    In development mode, every schedule and trigger is paused, so personal copies do not run by surprise, and you start them with bundle run. “Jobs cannot run in a development workspace” is wrong, since jobs run in any workspace. “The job needs a service principal in dev” is wrong, since a development deployment can run as you. And “bundle validate was not run first” only checks the configuration, and does not decide whether schedules run.