What you will be able to do
- Choose between a Streamlit UI and a container web endpoint and declare the choice in the manifest
- Configure an app with containers: images, compute pool privileges, services and endpoint binding
- Share provider data into an application package, including data from databases outside it
- Declare references to consumer objects and bind them through a register callback
- Set DISTRIBUTION to INTERNAL or EXTERNAL and keep development and production packages apart
1.Choosing the app UI: Streamlit or a container endpoint
A Native App is built from an application package. Its manifest.yml declares the app's artifacts, and its SQL setup script creates the app's objects. The manifest also names the UI consumers see when they open the app. If no Streamlit app is declared, consumers see the readme instead. Two kinds of artifact can serve as the UI, and the manifest accepts only one of them.
default_streamlit names the schema and Streamlit app that consumers get by default, and it is required whenever the app includes a Streamlit app. Like other code, the Streamlit app is a stateless object that the setup script creates in a versioned schema. default_web_endpoint instead points at a container service: it names the service and the endpoint, and that endpoint must also be defined in the service specification file.
default_web_endpoint:
service: ux_schema.ux_service
endpoint: uiStreamlit itself runs on one of two runtimes. A warehouse runtime gives each viewer an on-demand, personal instance that runs on a Snowflake warehouse. The app can issue USE WAREHOUSE, but references to warehouses are not supported. A container runtime can reach the internet once an external access integration is attached to the Streamlit object.
Choose Streamlit when the interface is a data app over content the app already holds. On a warehouse runtime it needs no compute pool, no service and no BIND SERVICE ENDPOINT privilege. Choose default_web_endpoint when the app is already container-based and one of its services serves the interface. The UI is then one more endpoint in a specification you already maintain.
Checkpoint 1 of 6· Fill the gap
A container-based app serves its interface from the ui endpoint of the service ux_schema.ux_service. Which manifest property under artifacts makes that endpoint the UI consumers see when they open the app?
? :
service: ux_schema.ux_service
endpoint: uidefault_web_endpoint names the service and the endpoint that serve the app's UI, and that endpoint must also be defined in the service specification file. default_streamlit is the other UI option, but the manifest accepts only one of the two, so an app can't declare both and let consumers choose.
2.Container-based apps: compute pools, services and endpoints
An app with containers runs its own images on Snowpark Container Services inside the consumer account. Three parts of the manifest set this up:
artifacts.container_services.imageslists every image, one entry each, as/<database>/<schema>/<image_repository>/<image_name>:tag.uses_gpustates whether the app needs a GPU.privilegesrequests CREATE COMPUTE POOL so the app can create its own compute pool, which isn't needed if the consumer creates the pool manually. It also requests BIND SERVICE ENDPOINT, which any endpoint needs in order to be reachable from outside Snowflake.configuration.grant_callbackis required for apps with containers. It names the stored procedure that creates compute pools and services and performs other setup tasks.
privileges:
- CREATE COMPUTE POOL:
description: 'Required to allow the app to create a compute pool in the consumer account.'
- BIND SERVICE ENDPOINT:
description: 'Required to allow endpoints to be externally accessible.'Services are created with CREATE SERVICE, run from the setup script. Providers should usually wrap that call in a stored procedure rather than run it directly. The specification can be a file inside the package:
CREATE SERVICE IF NOT EXISTS app_service
IN COMPUTE POOL app_compute_pool
FROM SPECIFICATION_FILE = '/containers/service1_spec.yaml';The path is relative to the app root, so each app version carries its own specification. When consumers need to supply values, use FROM SPECIFICATION_TEMPLATE_FILE and pass the template variables with USING. Store the consumer's arguments inside the app instance so they can be passed again when the service is upgraded.
Services sit outside the versioned-schema model. Snowpark Container Services is not supported in versioned schemas, so services are created in a regular schema. A service can be stateful or stateless, but services handle their own version management. Endpoint binding comes down to two rules: an endpoint reachable from outside Snowflake needs BIND SERVICE ENDPOINT, and an endpoint named in default_web_endpoint must exist in the service specification.
Checkpoint 2 of 6· Check yourself
A provider's setup script puts all the app's code (stored procedures and UDFs) in a versioned schema called app_code. The provider now adds a CREATE SERVICE statement for the app's container service. Where should that service be created?
Snowpark Container Services is not supported in versioned schemas, so the service must be created in a regular schema, whether it is stateful or stateless. Services handle their own version management instead of using the versioned-schema model, and a rerun-safe CREATE statement doesn't change that.
“Snowpark Container Services is not supported in versioned schemas. A service can be stateful or stateless, but services have their own version management.”Source: docs.snowflake.com
3.Bundling provider data into the package
Many apps ship provider data alongside their code. Data reaches the installed app by being shared into the application package: objects are granted TO SHARE IN APPLICATION PACKAGE, and so is the schema that contains each shared object. Forget the schema grant and the shared object can't be reached.
Data stored in another provider database takes an extra step, because it can't be shared directly. First, grant REFERENCE_USAGE on that database to the package:
GRANT REFERENCE_USAGE ON DATABASE other_db
TO SHARE IN APPLICATION PACKAGE app_pkg;Next, create a view inside the package over the outside table. Then grant USAGE on the view's schema and SELECT on the view to the share in the package:
CREATE VIEW app_pkg.shared_schema.shared_view
AS SELECT c1, c2, c3, c4
FROM other_db.other_schema.other_table;That view is also where you decide what data to include. It selects four named columns, not *, and a column left out of the view never reaches a consumer account. Share only what the app needs, through the narrowest view that serves it.
Sharing data into the app is not the same as showing it to consumers. Inside the installed app, the setup script controls exposure, and everything it creates stays internal unless it is granted to an application role. App procedures can therefore work on a detailed shared view while consumers get only a summarizing view through an application role. The wider isolation model is covered in Provider/consumer security boundaries and data isolation.
Checkpoint 3 of 6· Check yourself
Per-customer detail reaches an installed app through the shared view shared_schema.shared_view. The setup script creates reporting.summary_view over that view and grants only summary_view to the application role app_user. What can a consumer role that holds app_user query?
Sharing data into the package puts it inside the app, not in front of consumers. Objects in the app are hidden from the consumer account unless they are granted to an application role, so this consumer sees only the summarizing view.
“When a consumer installs an app, by default, these objects are invisible and inaccessible to the consumer account directly.”Source: docs.snowflake.com
4.References to consumer objects
References solve the opposite problem. Here the app needs an object in the consumer's account whose name the provider can't know until install time. The manifest's references block declares a named reference with its object type, the privileges it needs and a callback. The consumer then chooses the actual object.
references:
- consumer_table:
label: "Consumer table"
description: "A table in the consumer account that exists outside the APPLICATION object."
privileges:
- INSERT
- SELECT
object_type: TABLE
multi_valued: false
register_callback: config.register_single_referenceThe reference consumer_table asks for INSERT and SELECT on a table. register_callback names the stored procedure that binds the table the consumer chooses to this reference definition. App code then works through consumer_table and never hard-codes a consumer object name. Set multi_valued to bind several consumer objects to the same reference.
| Object type | Privileges allowed |
|---|---|
| TABLE | SELECT, INSERT, UPDATE, DELETE, TRUNCATE, REFERENCES |
| VIEW | SELECT, REFERENCES |
| WAREHOUSE | MODIFY, MONITOR, USAGE, OPERATE |
| API INTEGRATION | USAGE |
| EXTERNAL ACCESS INTEGRATION | USAGE |
| SECRET | USAGE, READ |
| STAGE | READ, WRITE |
The same mechanism carries external dependencies. An API integration, external access integration or secret that the app needs for outbound calls is requested the same way as a table, with USAGE or READ. A table the app must analyse, known only once the app is installed, is the textbook case for a TABLE reference.
Checkpoint 4 of 6· Check yourself
Every consumer stores sales data in their own table, and the provider can't know its name until install. The app must read that table and write results back into it. How should the provider give the app access?
References are for objects in the consumer's account that the provider can't name ahead of time. The manifest declares the object type and the privileges, and the register callback binds the table the consumer picks. REFERENCE_USAGE plus a view only works for provider databases shared into the package. The privileges block grants account-level privileges, not access to one specific table.
“optional requested references in consumer account”Source: docs.snowflake.com
Sources8
5.DISTRIBUTION modes and separate development and production packages
Every application package has a DISTRIBUTION property. It decides who the package can reach by setting the type of listing it can be attached to. INTERNAL allows only private listings within the provider's own organization, and the automated security scan is skipped. EXTERNAL allows listings outside the organization: private listings to other organizations, public listings and Marketplace listings. Every version and patch then goes through the automated security scan. In Snowsight, the same choice appears as distributing to accounts outside your organization or only within it.
CREATE APPLICATION PACKAGE hello_snowflake_package
DISTRIBUTION = EXTERNAL;DISTRIBUTION can be set when the package is created or changed later. If it is set at creation, every version or patch added afterwards is scanned immediately. For an app installed only by other teams in the same organization, INTERNAL avoids a security review on every patch.
DISTRIBUTION belongs to the whole package, not to individual versions, and that is why development and production use separate packages. Running snow app run creates a package, uploads code files and creates or upgrades an app, again and again. A development package set to INTERNAL absorbs that churn without waiting on scans. The production package is EXTERNAL, receives only versions ready for consumers, and has each of them scanned. Separate packages also separate who can do what, because package privileges are granted per package:
| Privilege | Task |
|---|---|
| DEVELOP | Create an APPLICATION object in development mode from the application package |
| INSTALL | Create an APPLICATION object based on the application package |
| MANAGE VERSIONS | Add a version and patch level to an application package |
| MANAGE RELEASES | Specify a release directive, view the version and patch level |
| ATTACH LISTING | Add an application package to a listing |
Developers get DEVELOP on the development package, and release managers hold MANAGE VERSIONS and MANAGE RELEASES on the production one. Rapid iteration then never touches the version paying consumers are running.
Checkpoint 5 of 6· Check yourself
Your team will sell an app to customers in other organizations. Developers also run snow app run many times a day while building it. Which package setup keeps that churn away from consumers and avoids a security scan on every development patch?
DISTRIBUTION is set on the whole package, not on individual versions. An INTERNAL development package skips the automated scan, so developers can iterate freely. The EXTERNAL production package is the one that can reach other organizations, and every version and patch added to it is scanned.
“Select Distribute to accounts in your organization to make the application package available within your organization. The automated security scan is not initiated.”Source: docs.snowflake.com
Checkpoint 6 of 6· Match them up
Match each application package privilege to the task it allows
Tap a term, then the definition that fits it.
Privileges are granted on each package separately. Developers can therefore hold DEVELOP on the development package, while release managers hold MANAGE VERSIONS and MANAGE RELEASES on the production package.
“DEVELOP | Create an APPLICATION object in development mode from the application package.”Source: docs.snowflake.com
Sources
(10)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“This field is required if the app includes a Streamlit app.”
↩︎ Choosing the app UI: Streamlit or a container endpoint“The callback function is a stored procedure that can create compute pools, services, and perform other setup tasks required by the application.”
↩︎ Container-based apps: compute pools, services and endpoints“optional requested references in consumer account”
↩︎ Checkpoint - 2.
“If this property is specified, the endpoint must also be defined in the service specification file.”
↩︎ Choosing the app UI: Streamlit or a container endpoint“It is not required if the consumer creates the compute pool manually.”
↩︎ Container-based apps: compute pools, services and endpoints“Only one of the default_web_endpoint and default_streamlit can be specified.”
↩︎ Exam trap 1 - 3.
“Streamlit apps in a Snowflake Native App support the USE WAREHOUSE command. However, references to warehouses are not supported.”
↩︎ Choosing the app UI: Streamlit or a container endpoint - 4.
“Providers should always consider calling this command from within a stored procedure instead of running it directly.”
↩︎ Container-based apps: compute pools, services and endpoints - 5.
“Snowpark Container Services is not supported in versioned schemas.”
↩︎ Container-based apps: compute pools, services and endpoints“Snowpark Container Services is not supported in versioned schemas. A service can be stateful or stateless, but services have their own version management.”
↩︎ Checkpoint - 6.
“When adding a shared object to an application package, you must also share the schema that contains the object.”
↩︎ Bundling provider data into the package“To share a database object that exists outside the application package, providers must create views in the application package that allow access the object.”
↩︎ Exam trap 2“You cannot share objects outside the application package directly with app installed in the consumer account.”
↩︎ Prediction - 7.
“A provider can make these objects visible to the consumer using application roles.”
↩︎ Bundling provider data into the package“When a consumer installs an app, by default, these objects are invisible and inaccessible to the consumer account directly.”
↩︎ Checkpoint - 8.
“The register_callback property specifies a stored procedure used to bind a consumer table to this reference definition.”
↩︎ References to consumer objects“Use multi_valued to bind multiple consumer objects to the same reference.”
↩︎ References to consumer objects - 9.
“The automated security scan is not performed when the DISTRIBUTION property is set to INTERNAL.”
↩︎ DISTRIBUTION modes and separate development and production packages“any versions or patches added to the application package later are scanned immediately.”
↩︎ DISTRIBUTION modes and separate development and production packages“INTERNAL indicates that a provider can only create a private listing within the same organization where the application package was created.”
↩︎ Exam trap 3 - 10.
“If you are using the Snowflake CLI to develop an app, the application package is created when you run the snow app run command.”
↩︎ DISTRIBUTION modes and separate development and production packages“Select Distribute to accounts in your organization to make the application package available within your organization. The automated security scan is not initiated.”
↩︎ Checkpoint“DEVELOP | Create an APPLICATION object in development mode from the application package.”
↩︎ Checkpoint