Get started with Snowflake App Runtime

Build an app, deploy it, and share it with other roles. Follow the guide for the way you want to build:

  • Snowsight Workspaces (Public Preview): build in the browser with nothing to install.
  • Cortex Code: describe the app, and the agent builds, tests, and deploys it.
  • Snowflake CLI: deploy code you already have with snow app commands.

For a guided walkthrough, see the Getting started with Snowflake App Runtime quickstart.

Before you begin

  • Use a paid Snowflake account. Trial accounts don’t support App Runtime.
  • To share apps, ask an account administrator to complete account setup once. Until then, you deploy to your personal database, and you can’t share apps from there.

Workspaces runs in Snowsight, so there’s nothing to install. To build on your machine instead, install:

Build in Snowsight Workspaces

Build, preview, and deploy in the browser. For how preview works and how to configure it, see Develop Snowflake App Runtime apps in Snowsight Workspaces.

  1. In the navigation menu, select Projects » Workspaces. In the file explorer, select + Add new » Next.js App, and name the folder. To build with an agent, ask Cortex Code in Snowsight instead.
  2. Select Preview. Snowflake installs dependencies and starts a dev server, and your edits reload the running app.
  3. Select Deploy.
  4. Open the app at its URL, then share it.

To redeploy changes, select Deploy again.

Build with Cortex Code

Describe the app with the snowflake-apps skill:

Name the skill in your prompt:

> $snowflake-apps Build me a warehouse monitor that shows my warehouses with their current
  state and credit usage today

Cortex Code creates a Next.js project with a working UI, Snowflake data access, and an app.yml manifest. Then continue in chat:

  1. Ask it to run the app: Run the dev server and open it in my browser. In Cortex Code Desktop, the Agent Browser shows a live preview. Describe changes in chat to update the app.

  2. Ask it to deploy: Deploy this app. Cortex Code runs snow app deploy and gives you the app’s URL.

  3. Ask it to open the app: Open the app. In Cortex Code Desktop, you can also use the Apps view.

  4. Ask it to share the app: Share this app with the ANALYST role. See Share the app.

To redeploy changes, describe them and ask Cortex Code to redeploy.

Build with the Snowflake CLI

  1. From your project directory, generate an app.yml manifest:

    snow app setup
    

    Setup uses the account defaults from account setup, or your personal database if they aren’t set. To choose the destination, pass --database, --schema, or --warehouse. To see the result without writing the file, pass --dry-run. If the project has a snowflake.yml, see Migrate from snowflake.yml to app.yml.

  2. Add the install, build, and run commands for your language. See Build a Node.js app for Snowflake App Runtime or Build a Python app for Snowflake App Runtime.

  3. Run the dev server locally, for example npm run dev. To check the project before you deploy, run snow app validate.

  4. Deploy the app. The command prints the app’s URL:

    snow app deploy
    
  5. Open the app:

    snow app open
    

To redeploy changes, run snow app deploy again.

Deploy details

A deploy uploads the project, builds it, and starts the app at a URL that stays the same across redeploys. Each deploy creates a new version. For what each phase does, see Deploy an app to Snowflake App Runtime.

To run the app on serverless compute (Public Preview), set compute_resource: SERVERLESS in app.yml before you deploy.

If a deploy fails, see Retry a failed deploy and Troubleshoot Snowflake App Runtime apps.

Share the app

To let another role open the app, grant it USAGE on the database, schema, and Application Service:

GRANT USAGE ON DATABASE SNOWFLAKE_APPS TO ROLE ANALYST;
GRANT USAGE ON SCHEMA SNOWFLAKE_APPS.PUBLIC TO ROLE ANALYST;
GRANT USAGE ON APPLICATION SERVICE SNOWFLAKE_APPS.PUBLIC.MY_APP TO ROLE ANALYST;

To share from Snowsight instead:

  1. In Snowsight, select Apps » App Runtime admin.
  2. On the app’s card, select Share. You can also open the app and select the Sharing tab.
  3. Under Account roles, select Add role, choose the role, and select Save.

Send the URL to users who hold the role. They open it and sign in to Snowflake. For more patterns, see Share a Snowflake App Runtime app.

Next steps