CertSafari
    Snowflake SnowPro Specialty: Native Apps· Lessons

    Domain 2 · Lesson 3/12

    Native App package anatomy: manifest, setup script and versioned schemas

    Given a use case, build Native App Framework components.

    18 min read
    9.5% of exam
    6 sources
    Published 21 Oct 2026
    Docs as of 18 Oct 2026

    What you will be able to do

    • Describe what an application package contains and where its artifacts live on the stage
    • Read and write the sections of manifest.yml and choose between manifest_version 1 and 2
    • Write a rerun-safe SQL setup script whose objects stay internal unless granted to an application role
    • Place stateless code in versioned schemas and stateful data in regular schemas, and evolve stateful tables across versions
    • Choose between stored procedures, UDFs, UDTFs and external calls when implementing app logic

    Key concept

    Application package — The provider-side container a Snowflake Native App is installed from. It holds the app's data and logic, and each version brings its own manifest.yml and SQL setup script, which build the app's objects at install and upgrade.

    1.What an application package contains

    A Snowflake Native App is never installed from loose files. A provider builds an application package, a container that holds the app's data content and application logic, along with the versions and patches defined for the app. Consumers install from that package, and a provider testing the app creates an app from the same package.

    Two files define every version. The manifest, manifest.yml, says where the setup script is, which version it describes and how the app is configured. The setup script holds the SQL that creates the app's objects. Each version of an app needs its own copy of both, so version 2 can reshape what version 1 created.

    These files and every other artifact live on a named stage that the package can read. You can create a package before any files exist, but you can't develop or test an app until they are uploaded. The manifest must sit at the root of the stage directory. Everything else is addressed by a path relative to that root, such as scripts/setup_script.sql for the setup script or /libraries/echo.py for a code library: the readme, secondary scripts, handler code and container specification files.

    Checkpoint 1 of 9· Check yourself

    A provider runs CREATE APPLICATION PACKAGE and then uploads the app's files to a named stage the package can read: config/manifest.yml, scripts/setup_script.sql and readme.md. Before they can test the app, what has to change?

    Sources12

    2.Manifest sections and manifest_version

    The manifest is a YAML file, and its name must be exactly manifest.yml. Only two top-level fields are required. manifest_version selects the format Snowflake uses to read the rest of the file. artifacts points to the code and assets the app needs. Every other block is opt-in, and you add it only when the app needs that capability.

    Top-level fields of manifest.yml
    FieldRequired?What it declares
    manifest_versionRequiredThe manifest file format; controls which manifest features are available
    versionOptionalVersion metadata: name, patch, label, comment
    artifactsRequiredsetup_script (default setup.sql beside the manifest), readme, default_streamlit, extension_code, container_services
    configurationOptionallog_level, trace_level, metric_level, log_event_level, and grant_callback for an app with containers
    lifecycle_callbacksOptionalStored procedures Snowflake runs at lifecycle points, e.g. before_configuration_change
    privilegesOptionalPrivileges requested in the consumer account, each with a description
    snowflake_databaseOptionalRoles requested in the SNOWFLAKE database, such as CORTEX_USER
    referencesOptionalRequested references to objects in the consumer account

    Compatibility depends on manifest_version. Version 1 supports both current and legacy Native App functionality. Version 2 adds features, most importantly automated granting of privileges: privileges listed in the privileges block are granted to the app automatically when it is installed.

    A version 2 manifest whose CREATE TABLE and CREATE WAREHOUSE privileges are granted automatically at installyaml
    manifest_version: 2
    version:
      name: v1
    artifacts:
      readme: readme.md
      setup_script: setup.sql
    privileges:
      - CREATE TABLE:
        description: "Allows the app to create tables in the consumer account"
      - CREATE WAREHOUSE:
        description: "Allows the app to create warehouses in the consumer account"

    Choosing version 2 is a security decision, not just a format choice. During installation, Snowsight shows the consumer which privileges the app requests. By installing, the consumer agrees that those privileges may also be granted during later upgrades without being asked again. Consumers who want limits can apply feature policies that restrict which objects the app can create. Version 2 still uses a setup script and a privileges block, and Snowflake's own example manifest for an app with containers declares manifest_version: 2.

    The optional version block labels a release with name, patch, label and comment. Versions and patches defined with CREATE APPLICATION PACKAGE or ALTER APPLICATION PACKAGE take precedence over it.

    Checkpoint 2 of 9· Fill the gap

    This manifest should make Snowflake grant CREATE TABLE and CREATE WAREHOUSE to the app automatically when it is installed. Which top-level block fills the blank?

    manifest_version: 2
    version:
      name: v1
    artifacts:
      readme: readme.md
      setup_script: setup.sql
     ? :
      - CREATE TABLE:
        description: "Allows the app to create tables in the consumer account"
      - CREATE WAREHOUSE:
        description: "Allows the app to create warehouses in the consumer account"

    Checkpoint 3 of 9· Exam question

    A provider is deciding which manifest_version to declare for a new Native App. What is the key practical difference between manifest_version 1 and manifest_version 2 that the provider must account for?

    Sources23

    3.The setup script: SQL that builds the app at install and upgrade

    The setup script is the SQL file the manifest points to, and running it is what creates the app. It runs when a consumer installs or upgrades the app, and when a provider creates or upgrades an app while testing the package. It creates what the app needs: schemas, tables, views, stored procedures and application roles. The script is SQL only. Python or Java logic enters the app as procedures and functions that the SQL creates, never as the script itself. Metadata such as artifacts, privileges and references belongs in the manifest.

    Everything the script creates is internal to the app. A provider makes objects visible by granting them to application roles. The setup script creates those roles too, and each one is automatically granted to the role that owns the app. Role design is covered under application roles and privileges. While testing, a provider can still inspect internal objects by using development mode.

    The script runs without the usual session conveniences. USE DATABASE, USE SCHEMA, USE ROLE and USE SECONDARY ROLES are all forbidden. CREATE SCHEMA doesn't switch the context either, so every object name must be schema-qualified: CREATE TABLE IF NOT EXISTS app_config.params(...), not a bare params. Objects should also stay inside the app. Suppose the script creates a view in an outside database that reads an app table. That view breaks once the consumer takes ownership of the database and drops the app.

    Large scripts can be split into several files. The primary script named in the manifest calls secondary scripts with EXECUTE IMMEDIATE FROM. They run in the order they are encountered, and they can make further calls of their own. Paths are case-sensitive: / starts at the app root, ./ at the current script's directory, and ../ at its parent. At app runtime only the / form is allowed, and event logging doesn't work in scripts called this way.

    Write the script so it can be rerun safely. It may run several times during one install or upgrade, for example when a failed run is retried. Create objects with CREATE OR REPLACE or CREATE IF NOT EXISTS, and choose between them deliberately, because replacing an object silently drops the grants on it:

    Replacing a procedure removes earlier grants until the GRANT line runs againsql
    CREATE OR REPLACE PROCEDURE app_state.proc()...;
    GRANT USAGE ON PROCEDURE app_state.proc()
      TO APPLICATION ROLE app_user;

    If the script fails between those two statements, consumers lose access to the procedure. Some failures can't be fixed by a retry, such as a syntax error. In that case access stays lost until a new version or patch restores the grant.

    Checkpoint 4 of 9· Check yourself

    During an upgrade, the new setup script runs CREATE OR REPLACE PROCEDURE app_state.proc(). The next statement, the GRANT USAGE to APPLICATION ROLE app_user, has a syntax error, so the script fails at that point. What happens to consumers who use the procedure through app_user?

    Checkpoint 5 of 9· Exam question

    What is the primary role of the setup script within a Snowflake Native App application package?

    Sources4

    4.Versioned schemas for code, regular schemas for state

    Each upgrade forces a decision about every object the setup script creates: rebuild it for the new version, or carry it over untouched? That decision sorts objects into two kinds. Stateless objects are the app's code, such as stored procedures, user-defined functions and Streamlit apps. They are recreated for each new version or patch and belong in a versioned schema. Stateful objects, such as a configuration table or data the app collects while running, carry over from one version to the next and belong in a regular schema.

    Take a compliance table that gets a new row on every consumer action. It is stateful: its rows must survive every upgrade unchanged. It therefore goes in a regular schema and is created with CREATE TABLE IF NOT EXISTS, so a rerun never wipes it. Putting it in a versioned schema, or recreating it with CREATE OR REPLACE to keep it in step with the new version, is exactly what destroys the history. Versioned schemas do not archive rows. They exist to run several versions of code side by side.

    Running versions side by side is what a versioned schema is for. Internally it holds one subschema per app version, and a query started by an object inside it is pinned to that version. Suppose v1 is still running a long query when an upgrade to v2 arrives. The app's upgrade state becomes COMPLETE, and v1 moves to FINALIZING until its jobs finish. Consumers never see the subschemas: SHOW OBJECTS on a versioned schema lists only the objects of the version they have installed.

    Where each kind of app object belongs
    QuestionVersioned schemaRegular schema
    What goes in itStateless code: stored procedures, user-defined functions, Streamlit appsStateful objects: configuration tables, data collected while the app runs
    What happens on upgradeRecreated for each new version or patchCarried over from one version or patch to the next
    How the setup script creates itCREATE OR ALTER VERSIONED SCHEMACREATE SCHEMA IF NOT EXISTS
    Tasks, tags, masking policies, Snowpark Container Services, application rolesNot supportedWhere they must be created

    Versioned schemas exist only inside an application object, and only the setup script can create them. Always use CREATE OR ALTER VERSIONED SCHEMA so the schema stays compatible across versions and patches. Each version owns its own copy of the contents, so objects inside must be recreated every time with CREATE OR REPLACE or CREATE IF NOT EXISTS. Grants and future grants aren't supported in versioned schemas. A versioned schema also can't be the source or target of a clone, and it can't be dropped, because dropping it would remove every version's objects and break queries still running on older versions. Objects in either kind of schema can refer to objects in the other.

    Changing a stateful table between versions uses the same rerun-safe approach. The script first tries to create the table in its newest shape, which only takes effect on a fresh install. It then alters the table to add anything an older version lacked:

    A configuration table that persists across versions and gains a column on upgradesql
    CREATE SCHEMA IF NOT EXISTS stateful_object;
    
    CREATE TABLE IF NOT EXISTS stateful_object.config (
      config_param STRING,
      config_value STRING,
      default_value STRING,
      modified_on  TIMESTAMP);
    
    ALTER TABLE stateful_object.config
      ADD COLUMN IF NOT EXISTS modified_on TIMESTAMP;

    Checkpoint 6 of 9· Match them up

    A setup script for v2 of an app creates the objects below. Match each object to where it belongs and how it behaves on upgrade.

    Tap a term, then the definition that fits it.

    Checkpoint 7 of 9· Exam question

    A provider's Native App writes a row to a table every time a consumer performs an action, for compliance auditing. These rows must remain intact and unaffected when the app is upgraded to a new version. In which schema type should this table be created, and why?

    Sources5

    5.Procedures, UDFs, UDTFs and external functions as app logic

    App logic is code that the setup script creates in SQL. Stored procedures, UDFs and UDTFs are all stateless, so they go in a versioned schema and are rebuilt with each version. This setup script statement creates a Python procedure whose handler file ships inside the package:

    A Python stored procedure created in a versioned schema, importing a handler from the packagesql
    CREATE OR REPLACE PROCEDURE stateless_object.py_echo_proc(STR string)
      RETURNS STRING
      LANGUAGE PYTHON
      RUNTIME_VERSION=3.12
      PACKAGES=('snowflake-snowpark-python')
      HANDLER='echo.echo_proc'
      IMPORTS=('/libraries/echo.py');

    The IMPORTS path starts at the package root, and that is the only kind of import allowed. The setup script may not create Snowpark UDFs or procedures that IMPORT files from a named stage. It may not import code files from a stage in CREATE FUNCTION, and it may not call procedures, functions or anonymous blocks that refer to code outside the application package. All of the logic ships with the version. The extension_code setting under artifacts enables or disables Java, Python and Scala. The setup script also may not create or invoke EXECUTE AS CALLER procedures, so none of the procedures it defines run as caller's-rights procedures.

    Choose the object type by who calls it and what it does:

    • Stored procedures handle actions, and anything Snowflake calls back into must be one. Reference register_callback handlers, the container grant_callback, lifecycle_callbacks entries and wrappers around CREATE SERVICE are all stored procedures.
    • UDFs and UDTFs hold computation that consumers are given through an application role. They follow the same versioned-schema placement and import rules as procedures.
    • External functions and other outbound calls are for logic that must reach outside Snowflake. That path depends on integration objects in the consumer account. API INTEGRATION and EXTERNAL ACCESS INTEGRATION are among the object types an app can request USAGE on through a reference, so the code ships in the package while the consumer binds the integration at install.

    Checkpoint 8 of 9· Fill the gap

    In a setup script, a Python procedure gets its handler code through IMPORTS. Which value fills the blank so that the setup script is allowed to run this statement?

    CREATE OR REPLACE PROCEDURE stateless_object.py_echo_proc(STR string)
      RETURNS STRING
      LANGUAGE PYTHON
      RUNTIME_VERSION=3.12
      PACKAGES=('snowflake-snowpark-python')
      HANDLER='echo.echo_proc'
      IMPORTS=( ? );

    Checkpoint 9 of 9· Check yourself

    A provider wants logic that Snowflake runs on its own before a consumer changes the app's configuration (before_configuration_change). What should the setup script create for that logic?

    Sources456

    Sources

    (6)

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

    1. 1.
      “Each version of an app requires its own version of the manifest and setup script:”
      ↩︎ What an application package contains
      “An application package is a container that encapsulates the data content and application logic used by a Snowflake Native App.”
      ↩︎ Key concept
    2. 2.
      “The manifest file must exist at the root of the directory structure on the named stage where other application files are stored.”
      ↩︎ What an application package contains
      “This version of the manifest file provides support for additional features, including automated granting of privileges.”
      ↩︎ Manifest sections and manifest_version
      “they agree that the app may be granted these privileges during upgrades without requiring additional consent.”
      ↩︎ Exam trap 1
    3. 3.
      “Versions and patches defined using the CREATE APPLICATION PACKAGE or ALTER APPLICATION PACKAGE commands take precedence over those defined in the manifest file.”
      ↩︎ Manifest sections and manifest_version
      “The lifecycle_callbacks field (block, optional) defines stored procedures that Snowflake runs at specific points in the Snowflake Native App lifecycle.”
      ↩︎ Checkpoint
    4. 4.
      “The setup script only supports using SQL commands. Other languages are not supported.”
      ↩︎ The setup script: SQL that builds the app at install and upgrade
      “Database objects created by the setup script are internal to the app.”
      ↩︎ The setup script: SQL that builds the app at install and upgrade
      “The setup script can be run multiple times during installation and upgrade.”
      ↩︎ The setup script: SQL that builds the app at install and upgrade
      “Creating Snowpark user-defined functions (UDFs) or procedures that use IMPORT to include files on a named stage.”
      ↩︎ Procedures, UDFs, UDTFs and external functions as app logic
      “the CREATE OR REPLACE statement replaces an existing procedure, which implicitly removes privileges that had been previously granted to that procedure.”
      ↩︎ Exam trap 2
      “When a consumer installs an app, by default, these objects are invisible and inaccessible to the consumer account directly.”
      ↩︎ Prediction
      “the consumer cannot access the procedure until the app is upgraded to a new version or patch and the grant is restored.”
      ↩︎ Checkpoint
    5. 5.
      “Stateful objects are shared from one version or patch of the app to another.”
      ↩︎ Versioned schemas for code, regular schemas for state
      “You should always include the CREATE OR ALTER version of this command to ensure that versioned schemas are compatible across versions and patches.”
      ↩︎ Versioned schemas for code, regular schemas for state
      “Stateless objects are typically the code of the app, including stored procedures, user-defined functions, Streamlit apps, and similar content.”
      ↩︎ Procedures, UDFs, UDTFs and external functions as app logic
      “you must create them in a normal schema.”
      ↩︎ Exam trap 3
      “Tasks are not supported in versioned schemas.”
      ↩︎ Checkpoint

    Continue to part 2 of 2

    Native App UI, containers, shared data and distribution

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