CertSafari
    Snowflake SnowPro Advanced: MLOps Engineer (MLA-B01)· Lessons

    Domain 4 · Lesson 13/17

    Snowflake CLI Pipelines and Native Promotion of ML Assets

    Configure CI/CD and version control.

    9 min read
    7.33% of exam
    5 sources
    Published 5 Oct 2026
    Docs as of 4 Oct 2026

    What you will be able to do

    • Authenticate a CI runner to Snowflake with a service user and workload identity federation
    • Apply Snowflake CLI connection precedence and snowflake.yml env variables across environments
    • Map the validate, deploy and verify pipeline stages to Snowflake CLI commands
    • Promote ML assets with DCM projects and model registry default versions and aliases

    1.Authenticating a CI runner with a service user

    Snowflake CLI is the automation layer for CI/CD. It can deploy DCM projects, Snowpark applications, Native Apps and standalone SQL scripts. Snowflake maintains first-party integrations that install the CLI on the runner and configure authentication. On any other CI system (Jenkins, Bitbucket Pipelines, CircleCI), you install it with a shell command.

    First-party Snowflake CLI CI/CD integrations
    IntegrationStatusRecommended authentication
    GitHub ActionGenerally availableWorkload identity federation (OIDC)
    GitLab CI/CD ComponentPublic previewWorkload identity federation (OIDC)
    Azure DevOps ExtensionPublic previewWorkload identity federation (OIDC through Azure service connection)

    Every integration follows the same pattern on the Snowflake side. You create a service user for the pipeline, configure how it authenticates, and grant it only the roles it needs. With OIDC, the runner gets a short-lived identity token that Snowflake validates directly, so the CI system stores no long-lived secret. The ISSUER and SUBJECT values depend on the CI platform.

    Checkpoint 1 of 7· Fill the gap

    Which value configures this service user for workload identity federation?

    CREATE USER <username>
      TYPE = SERVICE
      WORKLOAD_IDENTITY = (
        TYPE =  ? 
        ISSUER = '<ci-platform-issuer>'
        SUBJECT = '<ci-platform-subject>'
      );

    If OIDC isn't available, use key pair authentication. Store the private key as a CI secret and pass it in through SNOWFLAKE_PRIVATE_KEY_RAW or SNOWFLAKE_CONNECTIONS_<NAME>_PRIVATE_KEY_RAW. Password authentication still works for legacy workflows but is not recommended for production CI/CD.

    Checkpoint 2 of 7· Check yourself

    A team's CI runners are on-premises and cannot use OIDC. Which authentication does the Snowflake CLI CI/CD guidance recommend instead?

    Sources1

    2.Connection precedence and project-definition variables

    A typical pipeline commits a config.toml that contains only the connection skeleton and injects secrets through environment variables. When the same setting is supplied in more than one place, these rules decide which value wins:

    Snowflake CLI connection setting precedence, highest first
    RankSource
    1Command-line parameters
    2Connection-specific environment variables, e.g. SNOWFLAKE_CONNECTIONS_MYCONNECTION_PASSWORD
    3Values in config.toml
    4Generic environment variables such as SNOWFLAKE_USER

    Checkpoint 3 of 7· Check yourself

    config.toml defines a password for connection MYCONNECTION, and the runner also sets SNOWFLAKE_CONNECTIONS_MYCONNECTION_PASSWORD. No command-line flag is passed. Which value does the CLI use?

    Values that change between environments, such as the target database or role, go in the env section of the project definition file, snowflake.yml. Commands then refer to them with <% ctx.env.name %>. A shell environment variable with the same case-sensitive name overrides the file's default, so one project definition can serve dev, staging and prod. For example, export database="other" overrides the database value.

    An env section in snowflake.ymlyaml
    definition_version: 2
    env:
      database: "dev"
      role: "eng_rl"
    snow sql reading those variables from the project definitionbash
    snow sql -q "grant usage on database <% ctx.env.database %> to <% ctx.env.role %>"

    Sources12

    3.Validate, deploy, verify

    With authentication and configuration in place, a Snowflake pipeline usually runs three stages. On a pull request it validates, computing the changes without applying them and posting them for reviewers. On merge to main it deploys. Afterwards it verifies, running expectation checks. The pattern is the same on every CI platform. The CLI goes onto the runner with a single install line:

    Installing Snowflake CLI on any CI runnerbash
    uv tool install snowflake-cli
    
    snow --version

    Checkpoint 4 of 7· Match them up

    Match each Snowflake CLI command to its role in a pipeline

    Tap a term, then the definition that fits it.

    Sources1

    4.Promoting ML assets: DCM projects and model versions

    Snowflake has two native ways to move ML assets toward production.

    For objects such as the tables, schemas and roles behind a feature pipeline, DCM projects are declarative. Definition files state the target state, usually in Git, and Snowflake works out the changes needed to reach it. A DCM project is a schema-level object, and you need one for each target environment. It stores the immutable artifacts of every deployment it runs. PLAN previews the changes and DEPLOY applies them. This also takes care of object dependencies: the order and location of DEFINE statements don't matter, because Snowflake sorts them before applying changes.

    Checkpoint 5 of 7· Check yourself

    A team keeps one set of DCM definition files and promotes them through dev, staging and prod. How many DCM project objects does this require?

    For models, promotion happens in the Model Registry. Models are versioned, and one version is the default. The simplest scheme treats the default version as production, so promoting a version means setting it as the default. A version can also carry an alias, and the system alias DEFAULT always refers to the default version. Both are set with ALTER MODEL:

    ALTER MODEL forms for default versions and aliasessql
    ALTER MODEL [ IF EXISTS ] <name> SET
      [ COMMENT = '<string_literal>' ]
      [ DEFAULT_VERSION = '<version_name>']
    
    ALTER MODEL [ IF EXISTS ] <model_name> SET TAG <tag_name> = '<tag_value>'
    
    ALTER MODEL [ IF EXISTS ] <model_name> UNSET TAG <tag_name> [ , <tag_name> ... ]
    
    ALTER MODEL [ IF EXISTS ] <model_name> VERSION <version_name> SET ALIAS = <alias_name>
    
    ALTER MODEL [ IF EXISTS ] <model_name> VERSION <version_or_alias_name> UNSET ALIAS

    Checkpoint 6 of 7· Check yourself

    Production code calls a model without naming a version. Under the default-version scheme, how is a new version promoted?

    Checkpoint 7 of 7· Exam question

    Which path correctly runs a training-setup script from a release tag named `v2.1.0` in the Git repository object `ml_repo`?

    Sources34

    Exam traps

    Each one states something that sounds right. Open it to see what is actually true.

    1. 1.DEFINE statements in a DCM project must be ordered so that dependencies are created first.Why is that wrong?

      Snowflake collects and sorts all DEFINE statements before applying them, so file order and placement don't affect the result.

      Covered in Promoting ML assets: DCM projects and model versions

    2. 2.Storing a service user's password or private key as a CI secret is the recommended way to authenticate GitHub Actions.Why is that wrong?

      The recommendation is workload identity federation with OIDC, which uses short-lived tokens. Long-lived credentials are the fallback.

      Covered in Authenticating a CI runner with a service user

    3. 3.A committed config.toml should hold the full connection, including credentials, so every runner works the same way.Why is that wrong?

      Commit only the connection skeleton and supply secrets through environment variables.

      Covered in Connection precedence and project-definition variables

    Sources

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

    1. 1.
      “With OIDC, the CI runner obtains a short-lived identity token that Snowflake validates directly.”
      ↩︎ Authenticating a CI runner with a service user
      “Create a service user that the pipeline authenticates as.”
      ↩︎ Authenticating a CI runner with a service user
      “Command-line parameters override everything.”
      ↩︎ Connection precedence and project-definition variables
      “A Snowflake CI/CD pipeline typically progresses through three stages: validate proposed changes on a pull request, deploy them on merge, and verify the result.”
      ↩︎ Validate, deploy, verify
      “Use workload identity federation (OIDC) wherever your CI system supports it. Avoid storing long-lived credentials in CI secrets.”
      ↩︎ Exam trap 2
      “Do not commit config.toml files that contain credentials.”
      ↩︎ Exam trap 3
      “When OIDC is not available (for example, when you need to support older Snowflake CLI versions or on-premises CI runners), use key pair authentication.”
      ↩︎ Checkpoint
      “Environment variables that target a specific connection parameter (for example, SNOWFLAKE_CONNECTIONS_MYCONNECTION_PASSWORD) override config.toml.”
      ↩︎ Checkpoint
      “snow git execute to run SQL files from a Snowflake Git integration.”
      ↩︎ Checkpoint
    2. 3.
      “The DCM project object is used to execute DCM commands and stores the immutable artifacts and definition files of all executed deployments.”
      ↩︎ Promoting ML assets: DCM projects and model versions
      “Snowflake collects and sorts all statements before applying changes, so you don’t need to manually handle sequencing or dependencies.”
      ↩︎ Exam trap 1
      “You need a DCM project object for each target environment.”
      ↩︎ Checkpoint

    Also cited

    Ready to test yourself?

    Practise the 26 questions on this subdomain.

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