snowflake.yml project definition for Snowflake App Runtime¶
The snowflake.yml project definition tells the Snowflake CLI where and how
to deploy your app. This page documents the schema for a Snowflake App Runtime
project, where the entity is type: snowflake-app.
A snowflake.yml is a Snowflake CLI project definition. For entity keys,
identifiers, mixins, templating, and other patterns the CLI applies to all
project files, see
Specify entities.
The rest of this page covers only the Snowflake App Runtime specifics.
snowflake.yml is separate from the optional
app.yml build manifest.
snowflake.yml controls deployment (destination, code storage, warehouse, and
compute). app.yml controls the remote build (install, build, run, artifacts,
and display profile).
Example¶
Use code_workspace instead of code_stage to store code in a workspace rather
than a stage. The two fields are mutually exclusive.
snowflake.yml schema for snowflake-app entities¶
Fields¶
The following fields are supported for snowflake-app entities:
| Field | Type | Required | Default | Notes |
|---|---|---|---|---|
type | snowflake-app | Yes | N/A | Selects the Snowflake App Runtime flow. |
identifier | object or string | No | None | Either a string identifier or an object with name (required), schema, and database. |
artifacts | list | Yes | N/A | Each entry is either a path string or an object with src (required), dest, processors, and ignore (glob patterns to exclude). A bare string is treated as src. |
query_warehouse | string | No | None | Warehouse used for queries. Applied to the deployed Application Service. |
build_eai | string, object, or null | No | None | External access integration for the build. Either a bare name or an object with a name property. External access integrations are account-level objects, so they don’t take a database or schema qualifier. Can be set to null. |
artifact_repository | object | No | <app-name>_REPO | Object with name (required), schema, and database. Defaults to <app-name>_REPO at deploy time when omitted. |
code_stage | string or object | No | None | Stage backend for code. Mutually exclusive with code_workspace. |
code_workspace | string or object | No | None | Workspace backend for code. Mutually exclusive with code_stage. |
Code storage object shapes¶
When you write code_stage or code_workspace as an object, use these fields:
code_stage:name(required),schema,database, andencryption_type(defaultSNOWFLAKE_SSE).code_workspace:name(required),schema, anddatabase.
Validation rules¶
- Code storage is mutually exclusive. Setting both
code_stageandcode_workspacefails withSpecify either code_stage or code_workspace, not both. - The external access integration is nullable.
build_eaiacceptsnull, which is treated the same as omitting it. - Code storage accepts three forms. Write
code_stageandcode_workspaceas an object, a bare name, or a fully qualifiedDB.SCHEMA.NAMEstring. When you use a bare name (or omit the database or schema), the CLI resolves those parts against the app’s database and schema at deploy time.
How field values are resolved¶
The CLI resolves each field’s value using a four-tier precedence. The first source that provides a value wins:
snowflake.yml: Your entity fields (query_warehouse,build_eai,artifact_repository, and the app’s database and schema).- Account parameters: Your
DEFAULT_SNOWFLAKE_APPS_*parameters (see the table below). - Built-in defaults: The CLI’s fallback values. For example,
artifact_repositorybecomes<app-name>_REPO, and if you have a personal database,databasebecomes that database andschemabecomesPUBLIC. - Current session: Your connection’s warehouse, database, and schema.
If an account-configured destination database or schema is set but your current role lacks the privileges to deploy there, the CLI warns you and falls back to your personal database.
Account parameters you can set:
| Account parameter | Controls |
|---|---|
DEFAULT_SNOWFLAKE_APPS_QUERY_WAREHOUSE | Query warehouse |
DEFAULT_SNOWFLAKE_APPS_BUILD_EXTERNAL_ACCESS_INTEGRATION | Build external access integration |
DEFAULT_SNOWFLAKE_APPS_DESTINATION_DATABASE | Destination database |
DEFAULT_SNOWFLAKE_APPS_DESTINATION_SCHEMA | Destination schema |