Create and manage an application package¶
This topic describes how providers can create an application package to develop a Snowflake Native App.
About the application package¶
An application package is a container that encapsulates the data content and application logic used by a Snowflake Native App. An application package also contains information about versions and patches defined for an app.
Each version of an app requires its own version of the manifest and setup script:
- manifest file:
The manifest file contains information that the application package requires to create and manage a Snowflake Native App. This includes the location of the setup script, version definitions, and configuration information for the app.
For more information, see 앱의 매니페스트 파일 만들기.
- setup script:
The setup script contains SQL statements that are run when the app is installed, either in the consumer account or locally during development and testing.
For more information, see Create the setup script.
참고
You can create an application package without creating the manifest file or setup script. However, to develop or test an app, you must upload these files to a stage so they are accessible to the application package.
About release channels¶
Release channels manage the release lifecycle of Snowflake Native Apps. They allow providers to create and manage versions of an app and to publish the app at different stages of development to all consumers or specific groups of consumers.
조심
When you create an application package, release channels are enabled by default. After release channels have been enabled for an application package, they can’t be disabled.
For more information on using release channels to manage the release lifecycle of an app, see 릴리스 채널을 사용하여 앱 게시하기.
To use the previous process for managing versions and patches you must explicitly disable release channels when creating the application package. However, for new app development Snowflake recommends using release channels to manage the release lifecycle of your apps.
For information on using the older features for managing versions and patches, see Develop a new version of an app (Legacy).
애플리케이션 패키지 생성에 필요한 권한¶
애플리케이션 패키지를 생성하려면 자신의 역할에 전역 CREATE APPLICATION PACKAGE 권한이 부여되어 있어야 합니다.
애플리케이션 패키지 만들기¶
You can create an application package using one of the following methods:
Snowsight
The CREATE APPLICATION PACKAGE command.
The Snowflake CLI
Create an application package using Snowsight¶
Snowsight 에 로그인합니다.
탐색 메뉴에서 Projects » App packages 를 선택합니다.
Create 를 선택하고 오른쪽 창에서 App Package 를 클릭합니다.
애플리케이션 패키지의 이름을 입력합니다.
애플리케이션 패키지에 대해 의도된 컨슈머를 선택합니다.
Distribute to accounts outside of your organization 을 선택하여 조직 외부에서 애플리케이션 패키지를 사용할 수 있게 합니다. 이 옵션을 선택하면 애플리케이션 패키지에 정의된 각 버전과 패치에 대해 자동 보안 검사 가 시작됩니다.
Distribute to accounts in your organization 을 선택하여 조직 내부에서 애플리케이션 패키지를 사용할 수 있게 합니다. 자동 보안 검사가 시작되지 않습니다.
(선택 사항) 애플리케이션 패키지에 대한 설명을 입력합니다. 이러한 설명은 컨슈머에게 표시되지 않습니다.
Add 를 선택합니다.
SQL 명령을 사용하여 애플리케이션 패키지 만들기¶
SQL을 사용하여 애플리케이션 패키지를 만들려면 다음 예와 같이 CREATE APPLICATION PACKAGE 명령을 사용하십시오.
CREATE APPLICATION PACKAGE my_application_package;
This command creates an application package named my_application_package in your Snowflake account.
By default, release channels are enabled for the application package.
애플리케이션 패키지를 만든 후 SHOW APPLICATION PACKAGES 명령을 사용하여 제공되는 애플리케이션 패키지의 목록을 확인하십시오.
Create an application package using the Snowflake CLI¶
If you are using the Snowflake CLI to develop an app, the application package is created when you run the snow app run command. This command creates an application package in your Snowflake account, uploads code files to a stage, then creates or upgrades an app from the application package.
Grant the required privileges on an application package¶
Some tasks related to creating or using an application package require specific privileges on the application package. The following table describes the privileges required to perform these tasks:
권한 |
작업 |
|---|---|
ATTACH LISTING |
목록에 애플리케이션 패키지를 추가합니다. |
DEVELOP |
개발 모드의 애플리케이션 패키지에서 APPLICATION 오브젝트를 만듭니다. |
INSTALL |
애플리케이션 패키지를 기반으로 APPLICATION 오브젝트를 만듭니다. |
MANAGE RELEASES |
릴리스 지시문을 지정하고 버전 및 패치 수준을 확인합니다. |
MANAGE VERSIONS |
애플리케이션 패키지에 버전 및 패치 수준을 추가합니다. |
OWNERSHIP |
위의 모든 작업을 수행합니다. |
Grant privileges on an application package using Snowsight¶
Snowsight 에 로그인합니다.
탐색 메뉴에서 Projects » App packages 를 선택합니다.
애플리케이션 패키지를 선택한 다음 Settings 탭을 선택합니다.
Privileges 섹션에서 부여하려는 권한 옆에 있는 편집 아이콘을 선택합니다.
Add Role 을 선택한 다음 권한을 부여하려는 역할을 선택합니다.
Save 를 선택합니다.
권한 옆에 역할이 나타납니다.
SQL 명령을 사용하여 애플리케이션 패키지에 대한 권한 부여하기¶
SQL을 사용하여 애플리케이션 패키지에 대한 권한을 역할에 부여하려면 다음 예와 같이 GRANT <privileges> … TO ROLE 명령을 사용하십시오.
GRANT MANAGE RELEASES ON APPLICATION PACKAGE hello_snowflake_package TO ROLE app_release_mgr;
이 명령을 실행하면 app_release_mgr 역할에 MANAGE RELEASES 권한이 부여됩니다. 동일한 명령을 사용하여 애플리케이션 패키지에 대해 사용 가능한 다른 권한을 부여할 수 있습니다.
애플리케이션 패키지에 대한 기본 릴리스 지시문 설정하기¶
A release directive determines the version and patch of an app that is available to a consumer when they install the app or when an installed app is automatically upgraded. For information on setting the release directive, see Set the release directive for an app (Legacy)
컨슈머가 앱의 여러 인스턴스를 설치할 수 있도록 허용하기¶
공급자는 컨슈머가 앱의 여러 인스턴스를 설치할 수 있도록 애플리케이션 패키지를 구성할 수 있습니다.
앱의 여러 인스턴스를 활성화하려면 CREATE APPLICATION PACKAGE 또는 ALTER APPLICATION PACKAGE 명령의 MULTIPLE_INSTANCES = TRUE 절을 사용합니다.
앱에 대해 다중 인스턴스가 허용되는 경우 컨슈머는 계정에 최대 10개까지 앱 인스턴스를 설치할 수 있습니다.
평가판 또는 유료 목록에 포함된 애플리케이션 패키지에는 이 속성을 설정할 수 없습니다.
조심
MULTIPLE_INSTANCES 속성을 TRUE 로 설정한 후에는 설정을 해제하거나 FALSE 로 설정할 수 없습니다.
애플리케이션 패키지의 소유권 이전하기¶
애플리케이션 패키지를 만든 후 애플리케이션 패키지의 소유권을 다른 계정 수준 역할로 이전할 수 있습니다.
Snowsight 를 사용하여 소유권 이전하기¶
Snowsight 에 로그인합니다.
탐색 메뉴에서 Projects » App packages 를 선택합니다.
소유권을 이전할 애플리케이션 패키지 옆의 … 를 선택한 다음 Transfer Ownership 을 선택합니다.
Transfer to 아래에서 새 계정 수준 역할을 선택합니다.
Transfer 를 선택합니다.
SQL 명령을 사용하여 소유권 이전하기¶
SQL을 사용하여 애플리케이션 패키지의 소유권을 다른 계정 수준 역할로 이전하려면 다음 예와 같이 GRANT OWNERSHIP 명령을 사용하십시오.
GRANT OWNERSHIP ON APPLICATION PACKAGE hello_snowflake_package TO ROLE native_app_dev;
애플리케이션 패키지 삭제하기¶
Providers with the OWNERSHIP privilege on an application package can remove it from an account. However, providers cannot remove an application package that is currently associated with a listing.
After removing an application package, it is no longer available in the provider account.
조심
목록과 연결된 애플리케이션 패키지를 제거한 후 컨슈머는 애플리케이션 패키지에서 생성된 Snowflake Native App 을 볼 수 있지만 액세스할 수는 없습니다. 컨슈머가 Snowflake Native App 에 액세스하려고 하면 애플리케이션 패키지가 제거되었음을 나타내는 오류 메시지가 표시됩니다.
Delete an application package using Snowsight¶
Snowsight 에 로그인합니다.
탐색 메뉴에서 Projects » App packages 를 선택합니다.
제거하려는 애플리케이션 패키지 옆에 있는 … 를 선택한 다음 Drop 을 선택합니다.
Delete an application package using SQL commands¶
SQL을 사용하여 애플리케이션 패키지를 제거하려면 다음 예와 같이 DROP APPLICATION PACKAGE 명령을 실행하십시오.
DROP APPLICATION PACKAGE hello_snowflake_package;