Home Database Native App Framework: Build & Distribute Declarative Apps
Advanced 3 min · July 17, 2026
Native App Framework and Declarative Apps: Building and Distributing

Native App Framework: Build & Distribute Declarative Apps

Learn to build and distribute Snowflake Native Apps using the Declarative Apps framework.

N
Naren Founder & Principal Engineer

20+ years shipping high-throughput database systems. Lessons pulled from things that broke in production.

Follow
Production
production tested
July 17, 2026
last updated
2,439
articles · all by Naren
Before you start⏱ 20-30 min read
  • Basic SQL knowledge (SELECT, CREATE, GRANT)
  • A Snowflake account with ACCOUNTADMIN privileges
  • Familiarity with YAML syntax
  • Optional: Python for Streamlit UI development
 ● Production Incident 🔎 Debug Guide ⚙ Triage Commands
Quick Answer
  • Snowflake Native Apps are applications built on Snowflake that run within the Snowflake environment.
  • The Declarative Apps framework simplifies app development by using SQL and YAML manifests.
  • Apps can be distributed via the Snowflake Marketplace or shared directly.
  • Key components: manifest.yml, setup script, application package, and provider account.
  • Use cases include data clean rooms, analytics dashboards, and ML inference apps.
✦ Definition~90s read
What is Native App Framework and Declarative Apps?

A Snowflake Native App is a packaged application that runs within Snowflake, combining data, logic, and user interfaces for secure distribution and execution.

Think of Snowflake Native Apps like building a custom app for your phone, but instead of running on your phone, it runs inside Snowflake.
Plain-English First

Think of Snowflake Native Apps like building a custom app for your phone, but instead of running on your phone, it runs inside Snowflake. The Declarative Apps framework is like a recipe book: you write down what you want (ingredients and instructions) in a simple format, and Snowflake builds the app for you. You can then share that app with others, like publishing it in an app store.

Imagine you've built a powerful data pipeline that cleans and transforms raw data into actionable insights. You want to share this pipeline with other teams or even external customers, but they don't have your exact setup. Traditionally, you'd have to export data, write documentation, and hope they can replicate your environment. Snowflake Native Apps change that: you can package your entire application—including logic, user interfaces, and data—into a single entity that runs inside Snowflake, leveraging Snowflake's compute and security.

The Snowflake Native App Framework, especially with the Declarative Apps paradigm, allows you to define your app using SQL and YAML manifests. This approach reduces boilerplate code and lets you focus on the business logic. In this tutorial, you'll learn how to build a declarative Snowflake Native App from scratch, deploy it, and distribute it via the Snowflake Marketplace. We'll cover the architecture, step-by-step creation, debugging in production, and common pitfalls. By the end, you'll be able to create your own native apps that can be shared securely and efficiently.

Understanding Snowflake Native App Architecture

Snowflake Native Apps are built on the concept of an Application Package, which is a container that holds all the components of the app: the manifest, setup script, stored procedures, Streamlit UIs, and any other artifacts. The app runs in a consumer's Snowflake account but is managed by the provider. The key components are:

  • Provider Account: The account where the app is developed and from which it is shared or published.
  • Application Package: A versioned collection of the app's files. It can be shared with consumer accounts or published on the Marketplace.
  • Manifest (manifest.yml): A YAML file that defines the app's metadata, required privileges, and references to other files.
  • Setup Script: A SQL script that runs when the app is installed. It creates the app's objects (e.g., schemas, tables, procedures) within the app's sandbox.
  • App Roles: Roles defined in the setup script that control access to app objects.
  • Streamlit App: Optional UI component for interactive dashboards.

The Declarative Apps framework simplifies this by allowing you to define the app's behavior using SQL and YAML without writing complex code. The manifest declares what the app needs, and Snowflake handles the rest.

manifest.ymlYAML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
manifest_version: 1
name: my_app
version: "1.0"
label: "My First Native App"
description: "A simple app that transforms data."
privileges:
  - USAGE
  - SELECT
references:
  - name: my_shared_data
    label: "Shared Data"
    description: "A database shared by the provider."
    privileges:
      - IMPORTED PRIVILEGES
setup_script: setup.sql
streamlit_apps:
  - name: my_dashboard
    stage: app_src
    main: dashboard.py
🔥Declarative vs. Imperative
📊 Production Insight
Always version your application package. Use semantic versioning and test each version in a staging consumer account before publishing.
🎯 Key Takeaway
The manifest is the heart of a declarative app; it declares all dependencies and permissions upfront.

Setting Up Your Development Environment

To build a Snowflake Native App, you need a Snowflake account with the ACCOUNTADMIN role (or a role with CREATE APPLICATION PACKAGE privilege). You'll also need a stage to upload your app files. Here's how to set up:

  1. Create a new database and schema for your app development.
  2. Create a stage (internal or external) to store your app files.
  3. Create an application package using SQL.
  4. Upload your manifest, setup script, and any other files to the stage.
  5. Alter the application package to add a version.

Let's walk through an example. We'll create a simple app that reads from a shared database and returns aggregated results.

setup.sqlSQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
-- Create a schema for the app
CREATE SCHEMA IF NOT EXISTS app_schema;

-- Create a table to store processed results
CREATE TABLE IF NOT EXISTS app_schema.results (
    id INTEGER AUTOINCREMENT,
    category STRING,
    total NUMBER,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP()
);

-- Create a stored procedure to populate the table
CREATE OR REPLACE PROCEDURE app_schema.process_data()
RETURNS STRING
LANGUAGE SQL
AS
$$
    INSERT INTO app_schema.results (category, total)
    SELECT category, SUM(amount)
    FROM my_shared_data.public.transactions
    GROUP BY category;
    RETURN 'Data processed successfully';
$$;

-- Create an app role and grant privileges
CREATE APPLICATION ROLE app_admin;
GRANT USAGE ON SCHEMA app_schema TO APPLICATION ROLE app_admin;
GRANT SELECT, INSERT ON TABLE app_schema.results TO APPLICATION ROLE app_admin;
GRANT USAGE ON PROCEDURE app_schema.process_data() TO APPLICATION ROLE app_admin;
💡Use Application Roles
📊 Production Insight
Make your setup script idempotent by using IF NOT EXISTS and handling re-installation scenarios. This prevents errors if the app is reinstalled.
🎯 Key Takeaway
The setup script runs once during installation and creates all necessary objects for the app.

Creating the Application Package and Version

Once your files are ready, you need to create an application package and add a version. The application package is a container that holds all versions of your app. Here's the SQL to do that:

  1. Create the application package.
  2. Add a version by pointing to the stage where your files are located.
  3. Optionally, add a default release directive for the latest version.

After creating the package, you can share it with other accounts or publish it to the Marketplace.

create_package.sqlSQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- Create the application package
CREATE APPLICATION PACKAGE my_app_package
    COMMENT = 'My first native app package';

-- Add a version from the stage
ALTER APPLICATION PACKAGE my_app_package
    ADD VERSION v1_0
    USING '@my_stage/app_src'
    LABEL = 'Initial release';

-- Set the default release directive
ALTER APPLICATION PACKAGE my_app_package
    SET DEFAULT RELEASE DIRECTIVE
    VERSION = v1_0
    PATCH = 0;
⚠ Version Naming
📊 Production Insight
Use the ALTER APPLICATION PACKAGE ... ADD PATCH command for hotfixes without changing the version label. This allows consumers to update seamlessly.
🎯 Key Takeaway
The application package is versioned; you can have multiple versions and patches for iterative development.

Installing the App in a Consumer Account

To test your app, you can install it in a different account (or a different role in the same account). The consumer must have the IMPORT SHARE privilege to install the app. Here's the process:

  1. The provider shares the application package with the consumer account.
  2. The consumer creates an application from the shared package.
  3. The setup script runs, creating the app's objects.
  4. The consumer can then use the app's stored procedures and Streamlit UIs.

Let's see how the consumer installs the app.

install_app.sqlSQL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-- Consumer: Create an application from the shared package
CREATE APPLICATION my_app
    FROM APPLICATION PACKAGE my_app_package
    USING '@my_stage/app_src'
    COMMENT = 'My installed app';

-- Grant app role to a user
GRANT APPLICATION ROLE app_admin
    TO SHARE my_app;

-- Execute the stored procedure
CALL my_app.app_schema.process_data();

-- Query the results
SELECT * FROM my_app.app_schema.results;
🔥Sharing the Package
📊 Production Insight
Always test the installation in a consumer account that mimics your target audience. Use a separate Snowflake account or a different role with limited privileges.
🎯 Key Takeaway
Consumers install the app using the CREATE APPLICATION command, which triggers the setup script.

Adding a Streamlit UI to Your App

Snowflake Native Apps can include Streamlit apps for interactive user interfaces. To add a Streamlit app, you need to include it in the manifest and upload the Python file to the stage. The Streamlit app runs within Snowflake and can call the app's stored procedures.

Here's an example Streamlit app that displays the results from our stored procedure.

dashboard.pyPYTHON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import streamlit as st
import snowflake.snowpark as snowpark

# Create a session
session = snowpark.Session.builder.configs(st.secrets["snowflake"]).create()

st.title("My App Dashboard")

if st.button("Process Data"):
    result = session.sql("CALL my_app.app_schema.process_data()").collect()
    st.success(result[0][0])

# Display results
df = session.sql("SELECT * FROM my_app.app_schema.results").to_pandas()
st.dataframe(df)
💡Streamlit Secrets
📊 Production Insight
Keep your Streamlit app lightweight. Avoid heavy computations in the UI; instead, call stored procedures that run on Snowflake's compute.
🎯 Key Takeaway
Streamlit UIs enhance your app with interactive dashboards, making it accessible to non-technical users.

Distributing Your App via the Snowflake Marketplace

Once your app is ready, you can list it on the Snowflake Marketplace to reach a wider audience. The Marketplace allows consumers to discover and install your app with a few clicks. To publish:

  1. Ensure your application package is complete and tested.
  2. Create a listing in the Marketplace via the Snowflake UI or SQL.
  3. Provide a compelling description, pricing (if any), and support information.
  4. Approve the listing after review.

Here's how to create a listing using SQL.

create_listing.sqlSQL
1
2
3
4
5
6
7
8
9
10
11
12
13
-- Create a listing for the application package
CREATE APPLICATION PACKAGE LISTING my_app_listing
    FOR my_app_package
    WITH
        TITLE = 'My App'
        SHORT_DESCRIPTION = 'A simple data processing app'
        LONG_DESCRIPTION = 'This app processes transaction data and provides aggregated results.'
        CATEGORIES = ('Analytics', 'Data Processing')
        PRICING = 'Free'
        SUPPORT_CONTACT = 'support@example.com'
        TERMS_OF_SERVICE_URL = 'https://example.com/tos'
        PRIVACY_POLICY_URL = 'https://example.com/privacy';
🔥Marketplace Review
📊 Production Insight
Monitor your app's usage and feedback. Use the SYSTEM$GET_APP_USAGE function to track installations and usage patterns.
🎯 Key Takeaway
The Marketplace is the primary distribution channel for Snowflake Native Apps, enabling easy discovery and installation.
● Production incidentPOST-MORTEMseverity: high

The Case of the Missing App: A Snowflake Native App Deployment Failure

Symptom
After installing a Snowflake Native App from the marketplace, users reported that the app's stored procedures returned 'Insufficient privileges' errors, even though the app appeared to be installed successfully.
Assumption
The developer assumed that because the app was installed in the consumer account, it would automatically have access to all data and operations within that account.
Root cause
The app's manifest.yml did not declare the required privileges (e.g., IMPORTED PRIVILEGES on a shared database). Snowflake Native Apps run in a sandboxed environment; they must explicitly request permissions via the manifest.
Fix
Updated the manifest.yml to include the necessary privileges (e.g., privileges: [USAGE, SELECT] on the shared database) and re-uploaded the app package. The consumer had to reinstall the app to apply the new manifest.
Key lesson
  • Always declare all required privileges in the manifest.yml.
  • Test app installation in a separate consumer account before publishing.
  • Understand that Snowflake Native Apps are sandboxed and need explicit permissions.
  • Use the DESCRIBE APPLICATION PACKAGE command to verify manifest details.
  • Document the required privileges for consumers in the app listing.
Production debug guideSymptom to Action4 entries
Symptom · 01
App installation succeeds but stored procedures fail with 'Insufficient privileges'
Fix
Check the manifest.yml for missing privilege declarations. Use SHOW GRANTS TO APPLICATION <app_name> to see current grants.
Symptom · 02
App package upload fails with 'Invalid manifest' error
Fix
Validate the manifest.yml syntax using a YAML linter. Ensure all required fields (e.g., manifest_version, name, version) are present.
Symptom · 03
App works in provider account but not in consumer account
Fix
Verify that the consumer account has the necessary data shares and that the app's setup script correctly references shared objects.
Symptom · 04
App UI (Streamlit) not loading or showing errors
Fix
Check the Streamlit logs in the Snowflake UI. Ensure the Streamlit app is correctly referenced in the manifest and that the environment is properly configured.
★ Quick Debug Cheat SheetCommon issues and immediate actions for Snowflake Native Apps
App installation fails with 'Insufficient privileges'
Immediate action
Review manifest.yml privileges
Commands
SHOW GRANTS TO APPLICATION <app_name>;
DESCRIBE APPLICATION PACKAGE <package_name>;
Fix now
Add missing privileges to manifest and re-upload package.
App package upload fails+
Immediate action
Validate manifest YAML
Commands
SELECT PARSE_JSON(SYSTEM$GET_APP_PACKAGE_MANIFEST('<package_name>'));
Check for syntax errors in manifest.yml
Fix now
Correct YAML syntax and re-upload.
Stored procedure returns 'Object does not exist'+
Immediate action
Check object references in setup script
Commands
SHOW OBJECTS IN APPLICATION <app_name>;
SELECT * FROM INFORMATION_SCHEMA.APPLICABLE_ROLES;
Fix now
Ensure setup script creates or references objects correctly.
FeatureSnowflake Native AppTraditional Share
ComputeRuns in consumer's accountNo compute, read-only
LogicStored procedures, StreamlitNone
Data AccessRead/Write with privilegesRead-only
DistributionMarketplace or direct shareDirect share only
VersioningYes, with patchesNo
⚙ Quick Reference
6 commands from this guide
FileCommand / CodePurpose
manifest.ymlmanifest_version: 1Understanding Snowflake Native App Architecture
setup.sqlCREATE SCHEMA IF NOT EXISTS app_schema;Setting Up Your Development Environment
create_package.sqlCREATE APPLICATION PACKAGE my_app_packageCreating the Application Package and Version
install_app.sqlCREATE APPLICATION my_appInstalling the App in a Consumer Account
dashboard.pysession = snowpark.Session.builder.configs(st.secrets["snowflake"]).create()Adding a Streamlit UI to Your App
create_listing.sqlCREATE APPLICATION PACKAGE LISTING my_app_listingDistributing Your App via the Snowflake Marketplace

Key takeaways

1
Snowflake Native Apps allow you to package and distribute data applications that run inside Snowflake.
2
The Declarative Apps framework uses YAML manifests and SQL setup scripts to define app behavior.
3
Always declare required privileges in the manifest to avoid runtime errors.
4
Version your application package and test in a consumer account before publishing.
5
Streamlit UIs can be included for interactive dashboards.

Common mistakes to avoid

3 patterns
×

Forgetting to declare required privileges in the manifest.

×

Using hardcoded database names in the setup script.

×

Not testing the app in a consumer account before publishing.

INTERVIEW PREP · PRACTICE MODE

Interview Questions on This Topic

Q01JUNIOR
What is a Snowflake Native App and how does it differ from a traditional...
Q02SENIOR
Explain the role of the manifest.yml in a Snowflake Native App.
Q03SENIOR
How would you handle versioning and patching of a Snowflake Native App i...
Q01 of 03JUNIOR

What is a Snowflake Native App and how does it differ from a traditional application?

ANSWER
A Snowflake Native App runs entirely within Snowflake's environment, leveraging Snowflake's compute and security. It is packaged as an application package and can be distributed via the Marketplace. Unlike traditional apps, it does not require external infrastructure.
FAQ · 5 QUESTIONS

Frequently Asked Questions

01
What is the difference between a Snowflake Native App and a standard Snowflake share?
02
Can I update my app after it's installed by consumers?
03
What are the costs associated with Snowflake Native Apps?
04
How do I debug a Streamlit app within a Native App?
05
Can I use external network access in my Native App?
N
Naren Founder & Principal Engineer

20+ years shipping high-throughput database systems. Lessons pulled from things that broke in production.

Follow
Verified
production tested
July 17, 2026
last updated
2,439
articles · all by Naren
🔥

That's Snowflake. Mark it forged?

3 min read · try the examples if you haven't

Previous
Snowpark Container Services: Deploying Jobs, Services, and Apps
26 / 33 · Snowflake
Next
Hybrid Tables and Unistore: Transactional Workloads on Snowflake