CertSafari
    Databricks Certified Generative AI Engineer Associate· Lessons

    Domain 4 · Lesson 32/56

    Register a model to Unity Catalog with MLflow

    Register the model to Unity Catalog using MLflow

    17 min read
    1.47% of exam
    5 sources
    Published 22 Oct 2026
    Docs as of 30 Sep 2026

    What you will be able to do

    • Point the MLflow client at the Unity Catalog registry and name a model with its three-level name
    • Identify the Unity Catalog privileges needed to create a model, add a version, load it, and set an alias
    • Register a chain in one step with registered_model_name, or later with mlflow.register_model() from a run or LoggedModel URI
    • Explain what an MLflow 3 LoggedModel is and what it carries into the Unity Catalog model version
    • Use a model version alias such as Champion to mark the deployed version, since Unity Catalog has no stages

    Key concept

    Three-level model name in Unity Catalog — A model registered in Unity Catalog belongs to a schema in a catalog, the same as a table does. MLflow APIs address it as catalog.schema.model. Each registration adds a numbered version under that name, and Unity Catalog privileges on the catalog, schema and model decide who can create, load or promote those versions.

    1.Pointing MLflow at the Unity Catalog registry

    Registering a RAG chain or agent in Unity Catalog makes it a governed object. It gets the same access control, auditing, lineage and cross-workspace discovery that tables get. Databricks runs a hosted MLflow Model Registry inside Unity Catalog, and the open-source MLflow Python client works with it, so you register with ordinary MLflow calls. You only have to send them to the right registry.

    The registry URI decides where a model is registered. In MLflow 3 the default registry URI is databricks-uc, so registration goes to Unity Catalog unless you change it. The same is true on Databricks Runtime 13.3 LTS and above when the workspace's default catalog is in Unity Catalog. In other workspaces the client still writes to the legacy workspace model registry. There, you set the registry URI explicitly at the top of the notebook:

    Configuring the MLflow client to register models in Unity Catalogpython
    import mlflow
    mlflow.set_registry_uri("databricks-uc")

    Setting the URI to databricks instead, by mlflow.set_registry_uri("databricks") or the MLFLOW_REGISTRY_URI environment variable, deliberately goes back to the legacy workspace registry. The registry is chosen only by the registry URI. Renaming an experiment or choosing an artifact location changes nothing about where a model is registered.

    The model name must be the full three-level name. For example, prod.rag_apps.support_bot means catalog prod, schema rag_apps, model support_bot. A bare support_bot works only when the workspace's default catalog is in Unity Catalog, because then the catalog and schema are filled in from the defaults. If the default catalog is not in Unity Catalog, the short name fails, so the three-level name is the one to use everywhere. The name argument of log_model() (formerly artifact_path) is a different thing: it labels the model's artifacts, and it does not name a registered model.

    Compute matters too. The cluster must have access to Unity Catalog, which for ML workloads means Dedicated access mode (formerly single user). On Databricks Runtime 15.4 LTS ML and above, dedicated group access mode also works.

    Checkpoint 1 of 9· Fill the gap

    Your workspace's default catalog is not in Unity Catalog, so MLflow still registers models in the legacy workspace registry. Which value completes this notebook cell so that models are registered in Unity Catalog?

    import mlflow
    mlflow.set_registry_uri(" ? ")

    Checkpoint 2 of 9· Check yourself

    A workspace has Unity Catalog enabled, but its default catalog is hive_metastore. An engineer uses MLflow 3 and calls log_model(..., registered_model_name="support_bot") to register a RAG chain in schema rag_apps of catalog prod. What should they change?

    Checkpoint 3 of 9· Exam question

    A generative AI engineer has trained a RAG chain and wants to register it directly to Unity Catalog as part of the mlflow.pyfunc.log_model() call, targeting the catalog prod, schema rag_apps, and model name support_bot. Which configuration correctly registers the model to Unity Catalog under this three-level namespace?

    Sources12

    2.Privileges for registering and using models

    Unity Catalog checks privileges at every level of the namespace. A grant on the schema does nothing unless the principal can also reach the catalog and the schema. That is why USE CATALOG and USE SCHEMA come with every model action. On top of those, each action needs its own privilege:

    What each model operation requires (USE CATALOG and USE SCHEMA are needed for all of them)
    OperationPrivilege on top of USE CATALOG + USE SCHEMA
    Create a new registered modelCREATE MODEL on the schema
    Create a new version of an existing modelOwner of the registered model, or CREATE MODEL VERSION on it
    Load or deploy a modelEXECUTE on the registered model
    Set an alias on a registered modelOwner of the registered model

    Grants go through Catalog Explorer or SQL. For example, GRANT CREATE MODEL ON SCHEMA <schema-name> TO <principal> gives the create privilege, and a separate grant of USE CATALOG and USE SCHEMA has to go with it. The same rules apply to a job that trains or deploys on a schedule: the principal running the workflow needs them, not only the person who wrote it. The workspace must also be attached to a metastore that supports privilege inheritance, which is true of every metastore created after August 25, 2022.

    Checkpoint 4 of 9· Check yourself

    A nightly batch-inference job runs as a service principal and loads models:/prod.rag_apps.support_bot@Champion. The service principal has no grants yet. What is the minimum it needs?

    Checkpoint 5 of 9· Exam question

    An engineer runs GRANT CREATE MODEL ON SCHEMA prod.rag_apps TO data_scientists but a data scientist in that group still cannot register the new model prod.rag_apps.support_bot, receiving a permissions error. Which additional privilege is most likely missing?

    Sources13

    3.Two ways to register: at log time or afterwards

    **Passing registered_model_name to log_model() logs and registers in one step.** The registration goes to Unity Catalog, so the value must be the three-level name. If the registered model doesn't exist yet, it is created, and each later call adds a new version. Use this path when every logged model should become a version, for example in a scheduled job that rebuilds a chain.

    Logging a model, inferring its signature from an input example, and registering it in Unity Catalog in one call (MLflow 3)python
    with mlflow.start_run():
        # Train a sklearn model on the iris dataset
        X, y = datasets.load_iris(return_X_y=True, as_frame=True)
        clf = RandomForestClassifier(max_depth=7)
        clf.fit(X, y)
        # Take the first row of the training dataset as the model input example.
        input_example = X.iloc[[0]]
        # Log the model and register it as a new version in UC.
        mlflow.sklearn.log_model(
            sk_model=clf,
            name="model",
            # The signature is automatically inferred from the input example and its predicted output.
            input_example=input_example,
            # Use three-level name to register model in Unity Catalog.
            registered_model_name="prod.ml_team.iris_model",
        )

    **mlflow.register_model() registers a model that is already logged.** It takes the model's URI and the three-level name. Suppose a run produced a good chain yesterday at runs:/<run_id>/model. One call makes that exact artifact a version, with no retraining, no re-logging and no copying of files into catalog storage by hand. Use this path when you log many candidates and register only the one you pick.

    Registering an existing run's model as a Unity Catalog version (MLflow 2.x-style run URI)python
    mlflow.register_model(
      "runs:/<run_id>/model", "prod.ml_team.iris_model"
    )

    There is also a third, manual route. Open the experiment run page, click Register model, choose Unity Catalog and a destination model, then click Register. Registration can take a while, so refresh the destination model in Catalog Explorer to see when the version appears.

    Whichever path you use, Unity Catalog accepts a new version only if the model has a signature. The model signature and input example define the inputs and outputs a model expects. The easy way to get a signature is to pass input_example to log_model() (MLflow 2.5.0 and above), as the code above does. A chain logged without a signature or an input example gets no version, however good it is.

    Checkpoint 6 of 9· Fill the gap

    This MLflow 3 cell should log the classifier and also create a new version of prod.ml_team.iris_model in Unity Catalog in the same call. Which keyword argument goes in the blank?

    with mlflow.start_run():
        # Train a sklearn model on the iris dataset
        X, y = datasets.load_iris(return_X_y=True, as_frame=True)
        clf = RandomForestClassifier(max_depth=7)
        clf.fit(X, y)
        # Take the first row of the training dataset as the model input example.
        input_example = X.iloc[[0]]
        # Log the model and register it as a new version in UC.
        mlflow.sklearn.log_model(
            sk_model=clf,
            name="model",
            # The signature is automatically inferred from the input example and its predicted output.
            input_example=input_example,
            # Use three-level name to register model in Unity Catalog.
             ? ="prod.ml_team.iris_model",
        )

    Checkpoint 7 of 9· Exam question

    A team already has a logged MLflow run containing a trained chain at runs:/8f2c1a.../model, and they now want to register that existing run as version 1 of a Unity Catalog model named analytics.chatbots.faq_agent, without re-running training. Which approach accomplishes this?

    Sources1

    4.The MLflow 3 LoggedModel and registering a chain from it

    In MLflow 3 a model is a first-class object, not a file inside a run. Each log_model() call creates a LoggedModel. It keeps links to the model's metadata, metrics, parameters and generating code, across runs and environments. Because the model stands on its own, logging no longer needs an active run, and the model's artifacts are stored under models/<model_id>/artifacts instead of under the run.

    How logging and addressing a model changed from MLflow 2.x to MLflow 3
    AspectMLflow 2.xMLflow 3
    Argument that labels the model in log_model()artifact_path (now deprecated)name
    Model URI returned by log_model()runs:/<run_id>/<artifact_path>models:/<model_id>
    Active run required to logYesNo
    Where model artifacts are storedUnder the run's artifactsUnder the model's own artifact path
    Default registry URIWorkspace registry unless configureddatabricks-uc

    A GenAI chain written as a custom Python model is logged through the pyfunc flavor. With MLflow 3 you give it a name instead of an artifact_path:

    Logging a pyfunc model in MLflow 3: name replaces artifact_path and no run is neededpython
    mlflow.pyfunc.log_model(
        name="model",
        python_model=python_model,
        ...
    )

    You register it from the LoggedModel's URI. mlflow.last_logged_model() returns the most recent one, and its model_uri has the form models:/<model_id>. Pass that URI to register_model() with the three-level name. The new version keeps all the parameters and metrics recorded on the LoggedModel:

    Registering the most recently logged LoggedModel as a Unity Catalog model versionpython
    logged_model = mlflow.last_logged_model()
    mlflow.register_model(logged_model.model_uri, "prod.ml_team.iris_model")

    The model version page in Catalog Explorer shows everything the LoggedModel collected, from every experiment and workspace that touched it. For a GenAI application that includes traces: traces from development and evaluation sit next to traces from the serving endpoint, all tied to the same Model ID. A reviewer approving a version for deployment can read all of this on one page. There is one exception: mlflow.spark.log_model still works in MLflow 3 but does not create a LoggedModel, so Spark models keep the 2.x run-artifact behaviour.

    Checkpoint 8 of 9· Fill the gap

    An engineer logged a pyfunc RAG chain with MLflow 3 without starting a run. They now want that LoggedModel to become a version of prod.ml_team.iris_model in Unity Catalog. Which attribute completes the call?

    logged_model = mlflow.last_logged_model()
    mlflow.register_model(logged_model. ? , "prod.ml_team.iris_model")

    Sources425

    5.Marking the deployed version with aliases

    Unity Catalog has no model stages. The legacy registry let you move versions between Staging and Production, but Unity Catalog does not support stages. Two separate tools replace them. The catalog and schema say which environment a model belongs to. An alias says which version is deployed.

    Keep those two ideas apart. A version registered in prod.ml_team is under prod's governance rules, for example a rule that only admins may delete from the prod catalog. That does not mean it is serving production traffic. Deployment status belongs to the alias.

    An alias is a mutable, named pointer to one version of a registered model. Give Champion to the version in production, and have workloads load models:/prod.ml_team.iris_model@Champion instead of a version number. To promote a new version, move the alias to it. Batch jobs that load by alias pick up the new version on their next run without any code change. Deployment workflows can also look up the version behind the alias and point a serving endpoint at it.

    Setting, reassigning, reading, and deleting the Champion alias with the MLflow clientpython
    from mlflow import MlflowClient
    client = MlflowClient()
    
    # create "Champion" alias for version 1 of model "prod.ml_team.iris_model"
    client.set_registered_model_alias("prod.ml_team.iris_model", "Champion", 1)
    
    # reassign the "Champion" alias to version 2
    client.set_registered_model_alias("prod.ml_team.iris_model", "Champion", 2)
    
    # get a model version by alias
    client.get_model_version_by_alias("prod.ml_team.iris_model", "Champion")
    
    # delete the alias
    client.delete_registered_model_alias("prod.ml_team.iris_model", "Champion")

    Moving an alias needs more than registering a version. Only the owner of the registered model can set or reassign an alias, and the owner also needs USE CATALOG and USE SCHEMA. A data scientist with CREATE MODEL VERSION can add version 7 but cannot make it Champion. That split is usually the point: whoever trains a version is not necessarily the one who decides what serves. Aliases can also be managed in Catalog Explorer.

    Checkpoint 9 of 9· Fill the gap

    Version 2 of prod.ml_team.iris_model has passed review. Batch jobs load models:/prod.ml_team.iris_model@Champion, and version 2 should now replace version 1 as the production model. Which client method goes in the blank?

    from mlflow import MlflowClient
    client = MlflowClient()
    
    # create "Champion" alias for version 1 of model "prod.ml_team.iris_model"
    client.set_registered_model_alias("prod.ml_team.iris_model", "Champion", 1)
    
    # reassign the "Champion" alias to version 2
    client. ? ("prod.ml_team.iris_model", "Champion", 2)
    
    # get a model version by alias
    client.get_model_version_by_alias("prod.ml_team.iris_model", "Champion")
    
    # delete the alias
    client.delete_registered_model_alias("prod.ml_team.iris_model", "Champion")

    Sources13

    Sources

    (5)

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

    1. 1.
      “The default registry URI in MLflow 3 is databricks-uc, meaning the MLflow Model Registry in Unity Catalog will be used.”
      ↩︎ Pointing MLflow at the Unity Catalog registry
      “For other workspaces, the MLflow Python client creates models in the Databricks workspace model registry.”
      ↩︎ Pointing MLflow at the Unity Catalog registry
      “including centralized access control, auditing, lineage, and model discovery across workspaces”
      ↩︎ Pointing MLflow at the Unity Catalog registry
      “For ML workloads, this means that the compute's access mode must be Dedicated (formerly single user).”
      ↩︎ Pointing MLflow at the Unity Catalog registry
      “you need the CREATE MODEL and USE SCHEMA privileges on the enclosing schema, and USE CATALOG privilege on the enclosing catalog.”
      ↩︎ Privileges for registering and using models
      “This setting might also be useful in other cases if you run into authorization issues when trying to register a model.”
      ↩︎ Privileges for registering and using models
      “using registered_model_name in the log_model() call registers the model to Unity Catalog, so you must provide the full three-level name of the model”
      ↩︎ Two ways to register: at log time or afterwards
      “To register a model, use MLflow Client API register_model() method.”
      ↩︎ Two ways to register: at log time or afterwards
      “New ML model versions in UC must have a model signature.”
      ↩︎ Two ways to register: at log time or afterwards
      “From the experiment run page, click Register model in the upper-right corner of the UI.”
      ↩︎ Two ways to register: at log time or afterwards
      “Stages are not supported for models in Unity Catalog.”
      ↩︎ Marking the deployed version with aliases
      “Model aliases allow you to assign a mutable, named reference to a particular version of a registered model.”
      ↩︎ Marking the deployed version with aliases
      “If the “Champion” version is updated to reference a new model version, the batch inference workload automatically picks it up on its next execution.”
      ↩︎ Marking the deployed version with aliases
      “pass the three-level name of the model to MLflow APIs, in the form <catalog>.<schema>.<model>.”
      ↩︎ Key concept
      “Stages are not supported for models in Unity Catalog.”
      ↩︎ Exam trap 1
      “Using the prod catalog doesn't necessarily mean that the model version serves production traffic.”
      ↩︎ Exam trap 2
      “you need the CREATE MODEL and USE SCHEMA privileges on the enclosing schema, and USE CATALOG privilege on the enclosing catalog.”
      ↩︎ Exam trap 3
      “or have the CREATE MODEL VERSION privilege on it plus USE SCHEMA and USE CATALOG privileges on the schema and catalog containing the model.”
      ↩︎ Prediction
      “Permissions required: EXECUTE privilege on the registered model, plus USE SCHEMA and USE CATALOG privileges on the schema and catalog containing the model.”
      ↩︎ Checkpoint
    2. 2.
      “its default catalog is not configured to be in Unity Catalog, you will need to specify the full three-level name.”
      ↩︎ Pointing MLflow at the Unity Catalog registry
      “Set the environment variable MLFLOW_REGISTRY_URI.”
      ↩︎ Pointing MLflow at the Unity Catalog registry
      “MLflow no longer requires a run to be active when logging a model, because models have become first-class citizens in MLflow 3.”
      ↩︎ The MLflow 3 LoggedModel and registering a chain from it
      “This model URI is of the format models:/<model_id> (rather than runs:/<run_id>/<artifact_path> as in MLflow 2.x)”
      ↩︎ The MLflow 3 LoggedModel and registering a chain from it
      “it does not use the new LoggedModel concept.”
      ↩︎ The MLflow 3 LoggedModel and registering a chain from it
      “its default catalog is not configured to be in Unity Catalog, you will need to specify the full three-level name.”
      ↩︎ Exam trap 4
    3. 3.
      “To load or deploy a model, the principal must have the EXECUTE privilege on the registered model.”
      ↩︎ Privileges for registering and using models
      “To set an alias on a registered model, the principal must be the owner of the registered model.”
      ↩︎ Marking the deployed version with aliases
    4. 4.
      “When you log a model using log_model(), a LoggedModel is created that persists throughout the model's lifecycle, across different environments and runs”
      ↩︎ The MLflow 3 LoggedModel and registering a chain from it
    5. 5.
      “all of its metrics and parameters are available in the model registry UI and from the API.”
      ↩︎ The MLflow 3 LoggedModel and registering a chain from it
      “you can see traces associated with the Model ID from development and evaluation (mlflow.evaluate() runs) alongside traces from online serving in endpoints.”
      ↩︎ The MLflow 3 LoggedModel and registering a chain from it

    Ready to test yourself?

    Practise the 6 questions on this subdomain.

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