CertSafari
    Databricks Certified Machine Learning Professional· Lessons

    Domain 2 · Lesson 7/11

    Declaring ML resources with Databricks Asset Bundles

    Environment Architectures

    14 min read
    8.8% of exam
    4 sources
    Published 21 Oct 2026
    Docs as of 17 Oct 2026

    What you will be able to do

    • Structure a databricks.yml with a resources mapping and per-environment targets
    • Declare MLflow experiments, Unity Catalog registered models and model serving endpoints in a bundle
    • Configure served_entities and traffic_config to serve a specific model version or split traffic
    • Run validate, deploy, run and destroy against a chosen target

    1.databricks.yml, resources and targets

    A Databricks Asset Bundle (DAB) is a set of source files that defines a whole project, including how it gets tested and deployed. Databricks now calls these Declarative Automation Bundles. Every bundle has exactly one configuration file named databricks.yml at the root of the project folder. It can pull in other YAML files through include, which keeps each resource in its own file. The minimum it needs is a bundle name and a target.

    Two top-level mappings do most of the work. resources declares the Databricks objects the bundle owns, such as jobs, experiments, registered models and serving endpoints. targets names each place the bundle deploys to, such as dev, staging and prod. Exactly one target can have default: true. Other top-level keys include variables, workspace, permissions, run_as, artifacts, sync and include. A CI pipeline usually sets run_as to a service principal.

    A targets block: dev is the default, and prod switches workspace and overrides one job fieldyaml
    targets:
      dev:
        default: true
      prod:
        workspace:
          host: https://<production-workspace-url>
        resources:
          jobs:
            hello-job:
              name: hello-job
              tasks:
                - task_key: hello-task
                  existing_cluster_id: 2345-678901-fabcd456

    A target only lists what differs. The prod target above replaces the cluster ID, and any mapping it leaves out, such as the notebook_task, falls back to the top-level resources definition. That merge is how one shared resource gets different settings per environment. For example, a serving endpoint can be Small in dev and Medium in prod: either override the field under targets.<name>.resources, or declare a custom variable under variables and give it a different value under targets.<name>.variables. Setting workspace.host on each target is recommended over relying on default, because it makes the configuration portable. The CLI picks the matching profile from .databrickscfg.

    Checkpoint 1 of 8· Fill the gap

    This targets block points the prod target at the production workspace. Databricks recommends this field over relying on default, because the CLI uses it to find the matching profile in .databrickscfg. Which key fills the blank?

    targets:
      dev:
        default: true
      prod:
        workspace:
           ? : https://<production-workspace-url>
        resources:
          jobs:
            hello-job:
              name: hello-job
              tasks:
                - task_key: hello-task
                  existing_cluster_id: 2345-678901-fabcd456

    Checkpoint 2 of 8· Check yourself

    The top-level resources of a bundle defines hello-job with a notebook_task. The prod target above overrides only the job's existing_cluster_id. What happens when you run databricks bundle deploy -t prod?

    Sources1

    2.Experiments and registered models as resources

    Each resource type maps to a Databricks REST API object, and its YAML keys are that object's create-request fields. An experiments entry follows the MLflow create-experiment payload. A registered_models entry follows the payload for creating a Unity Catalog model. The bundle validator warns about any key the schema doesn't recognise, so a typo shows up before deployment instead of being silently ignored.

    Top-level resources keys for the three ML assets
    AssetKey under resourcesFields that identify it
    MLflow experimentexperimentsname (an absolute workspace path), artifact_location, permissions, tags
    Unity Catalog modelregistered_modelsname, catalog_name, schema_name, grants, aliases
    Real-time serving endpointmodel_serving_endpointsname, config, tags

    An experiment name must be an absolute workspace path, such as /Workspace/Users/someone@example.com/my_experiment, not a bare label. A registered model is split into name, catalog_name and schema_name. Grants go on the resource itself, because bundles don't support a top-level grants mapping.

    A registered model whose catalog follows the deployment targetyaml
    resources:
      registered_models:
        model:
          name: my_model
          catalog_name: ${bundle.target}
          schema_name: mlops_schema
          comment: Registered model in Unity Catalog for ${bundle.target} deployment target
          grants:
            - privileges:
                - EXECUTE
              principal: account users

    catalog_name: ${bundle.target} applies the catalog-per-environment layout. Deploying with -t dev creates the model in the dev catalog, and -t prod creates it in prod, all from one definition. The model resource type is the legacy Workspace Model Registry. Unity Catalog models use registered_models.

    Checkpoint 3 of 8· Check yourself

    Your team wants one bundle definition that creates the Unity Catalog model in the dev catalog when deployed with -t dev and in the prod catalog with -t prod. Which declaration does that?

    Sources23

    3.Model serving endpoints: served entities and traffic routes

    A real-time endpoint for a Unity Catalog model goes under resources.model_serving_endpoints. The bundle schema has no serving_endpoints, model_endpoints or endpoints key. Inside the entry, config.served_entities lists what the endpoint serves. Each entity has fields such as entity_name, entity_version, workload_size, scale_to_zero_enabled, workload_type and environment_vars. entity_name takes the full three-level catalog.schema.model name, and entity_version takes the version number. To serve version 4 of prod.fraud.fraud_scorer, set those two fields to those values. Keys like name/version, model_name/alias or a separate catalog_schema aren't served-entity fields. The older served_models list is deprecated in favour of served_entities.

    A Unity Catalog model serving endpoint declared in a bundleyaml
    resources:
      model_serving_endpoints:
        uc_model_serving_endpoint:
          name: 'uc-model-endpoint'
          config:
            served_entities:
              - entity_name: 'myCatalog.mySchema.my-ads-model'
                entity_version: '10'
                workload_size: 'Small'
                scale_to_zero_enabled: 'true'
            traffic_config:
              routes:
                - served_model_name: 'my-ads-model-10'
                  traffic_percentage: '100'
          tags:
            - key: 'team'
              value: 'data science'

    traffic_config.routes controls where traffic goes. Each route pairs a served_model_name with a traffic_percentage. For a 90/10 canary, list two served entities, one per model version, and give their routes 90 and 10. A route refers to the served model's name, which is my-ads-model-10 in the example, not the three-level entity_name. workload_size and scale_to_zero_enabled only set compute capacity and don't affect routing. The same resource can also set email_notifications for update success or failure, and an AI Gateway inference_table_config that logs requests to Unity Catalog tables.

    Checkpoint 4 of 8· Fill the gap

    To serve version 10 of a Unity Catalog model from a bundle, the endpoint's config has to list what it serves. Which key belongs in the blank, based on the current bundle schema?

    resources:
      model_serving_endpoints:
        uc_model_serving_endpoint:
          name: 'uc-model-endpoint'
          config:
             ? :
              - entity_name: 'myCatalog.mySchema.my-ads-model'
                entity_version: '10'
                workload_size: 'Small'
                scale_to_zero_enabled: 'true'
            traffic_config:
              routes:
                - served_model_name: 'my-ads-model-10'
                  traffic_percentage: '100'
          tags:
            - key: 'team'
              value: 'data science'

    Checkpoint 5 of 8· Exam question

    An MLOps engineer is authoring a Databricks Asset Bundle (DAB) and needs the bundle deploy to create and manage a real-time serving endpoint for a Unity Catalog model, fully described in version-controlled YAML alongside the training job. Under which top-level resources key should this endpoint be declared?

    Checkpoint 6 of 8· Exam question

    A bundle's model_serving_endpoints resource must point its serving traffic at version 4 of the Unity Catalog model prod.fraud.fraud_scorer. Which pair of fields inside served_entities correctly identifies this exact model and version for the endpoint to serve?

    Checkpoint 7 of 8· Exam question

    A team is running a canary rollout of a new fraud-scoring model version and wants 90% of production traffic to keep hitting the currently serving version while 10% is routed to the new candidate for evaluation. Which part of the model_serving_endpoints resource controls this traffic split?

    Sources2

    4.Validate, deploy, run and destroy against a target

    Four CLI commands, all run from the folder that holds databricks.yml, cover the bundle lifecycle:

    • databricks bundle validate checks the configuration and prints a summary if it is valid. Fix any errors it reports and run it again.
    • databricks bundle deploy -t <target> deploys the resources and artifacts to that target's workspace.
    • databricks bundle run -t <target> <job-name> starts a deployed job immediately. Deployed jobs also run on their own schedules.
    • databricks bundle destroy -t <target> deletes the deployed resources and artifacts after a confirmation prompt.
    Working against a non-default target needs -t on deploy and runbash
    databricks bundle validate
    databricks bundle deploy -t prod
    databricks bundle run -t prod hello_job

    The -t flag picks the target, so it decides which workspace and which overrides apply. Leave it out and the CLI uses the target marked default: true. To push a bundle tested in dev to staging, run databricks bundle deploy -t staging. That deploys the same definition with the staging target's settings, and the dev deployment stays as it was. One bundle should cover all of a project's environments instead of one bundle per environment. That way dev, staging and prod deploy from the same definition.

    Checkpoint 8 of 8· Fill the gap

    Validation has passed, and hello_job now has to go to the production workspace and then run there. The dev target is the default. Which bundle command fills the blank?

    databricks bundle validate
    databricks bundle  ?  -t prod
    databricks bundle run -t prod hello_job

    Sources34

    Practise it for real

    Create an MLOps Stacks project and take it through the full bundle lifecycle in a dev target.

    1. 1.Run databricks bundle init mlops-stacks and choose CICD_and_Project at the first prompt.

      Why: This generates the ML code, bundle resources and CI/CD workflows in one go.

      You should see: Starter files for the project appear in your current working directory.

    2. 2.From the folder that holds databricks.yml, run databricks bundle validate.

      Why: It catches configuration errors and unknown resource keys before anything is deployed.

      You should see: A summary of the bundle configuration. If you get errors instead, fix them and run it again.

    3. 3.Run databricks bundle deploy -t dev.

      Why: This deploys the jobs and other resources to the dev target's workspace only.

      You should see: The deployment completes, and the deployed jobs are set to run on their predefined schedules.

    4. 4.Run databricks bundle run -t dev model_training_job.

      Why: This starts training immediately instead of waiting for the schedule.

      You should see: A link to the Databricks job that you can open in the UI.

    5. 5.Run databricks bundle destroy -t dev and confirm the prompts.

      Why: This removes what the dev deployment created once you're done with it.

      You should see: The previously deployed resources and artifacts are deleted from the dev target.

    Stuck? Get a nudge

    If deploy can't authenticate, run databricks auth login --host with your workspace URL and accept the suggested profile.

    Sources

    (4)

    Every claim above is drawn from one of these pages, quoted as it was written on the date shown.

    1. 1.
      “A bundle must contain one (and only one) configuration file named databricks.yml at the root of the bundle project folder.”
      ↩︎ databricks.yml, resources and targets
      “it falls back to use the notebook_task mapping within the top-level resources mapping”
      ↩︎ databricks.yml, resources and targets
      “Databricks recommends that you use the host mapping instead of the default mapping wherever possible, as this makes your bundle configuration files more portable.”
      ↩︎ databricks.yml, resources and targets
      “A bundle must contain one (and only one) configuration file named databricks.yml at the root of the bundle project folder.”
      ↩︎ Exam trap 2
    2. 2.
      “The databricks bundle validate command returns warnings if unknown resource properties are found in bundle configuration files.”
      ↩︎ Experiments and registered models as resources
      “An experiment name must be an absolute path in the Databricks workspace”
      ↩︎ Experiments and registered models as resources
      “Each served entity contains fields like entity_name, entity_version, workload_size, scale_to_zero_enabled, workload_type, environment_vars.”
      ↩︎ Model serving endpoints: served entities and traffic routes
      “Each route contains served_model_name and traffic_percentage.”
      ↩︎ Model serving endpoints: served entities and traffic routes
      “Configuration for inference logging to Unity Catalog tables.”
      ↩︎ Model serving endpoints: served entities and traffic routes
      “(Deprecated: use served_entities instead) A list of served models for the endpoint to serve.”
      ↩︎ Exam trap 1
      “registered_model (Unity Catalog) | Registered models | Registered model object”
      ↩︎ Checkpoint
      “The traffic config defining how invocations to the serving endpoint should be routed.”
      ↩︎ Prediction
    3. 3.
      “For customizing models, the mappings within a model declaration correspond to the create Unity Catalog model operation's request payload”
      ↩︎ Experiments and registered models as resources
      “If a summary of the bundle configuration is returned, then the validation succeeded.”
      ↩︎ Validate, deploy, run and destroy against a target
      “The project's deployed jobs automatically run on their predefined schedules.”
      ↩︎ Validate, deploy, run and destroy against a target
    4. 4.
      “Each bundle should cover all environments for a given project (dev, staging, production) rather than using separate bundles per environment.”
      ↩︎ Validate, deploy, run and destroy against a target
      “Each bundle should cover all environments for a given project (dev, staging, production) rather than using separate bundles per environment.”
      ↩︎ Exam trap 3

    Ready to test yourself?

    Practise the 32 questions on this subdomain.

    Spotted a mistake, or was something unclear? Tell us.