CREATE ARTIFACT REPOSITORY

statementsupportedContainer services & dev tooling

docs.snowflake.com ↗

Object: ARTIFACT REPOSITORY

Creates a new artifact repository in the current or specified schema, or replaces an existing artifact repository. An artifact repository stores versioned packages that are used by downstream Snowflake objects. Two repository types are supported: - APPLICATION: stores packaged application builds that a CREATE APPLICATION SERVICE deploys. - PYPI: stores Python packages resolved from an external Python package index through an API integration.

Syntax

supportedpartialnot supportednot scored

CREATE [ OR REPLACE ] ARTIFACT REPOSITORY [ IF NOT EXISTS ] <name>
  TYPE = { APPLICATION | PYPI }
  [ API_INTEGRATION = '<integration_name>' ]
  [ INDEX_URL = '<url>' ]
  [ AUTHENTICATION_SECRET = <secret_name> ]
  [ PACKAGE_RETENTION = { ON_OBJECT_CREATION } ]
  [ [ WITH ] TAG ( <tag_name> = '<tag_value>' [ , ... ] ) ]
  [ COMMENT = '<string_literal>' ]

Parameters

NameRequiredDescription
namerequiredSpecifies the identifier for the artifact repository. The identifier must be unique for the schema where the repository is created. For more details, see Identifier requirements.
TYPE = { APPLICATION | PYPI }requiredSpecifies the type of content the repository stores. APPLICATION: stores versioned application packages. Required when the repository is referenced by CREATE APPLICATION SERVICE. PYPI: stores Python packages fetched from an external package index. The API_INTEGRATION parameter is required for this type.
API_INTEGRATION = 'integration_name'optionalSpecifies the API integration that provides access to the external Python package index. Required when TYPE = PYPI. Not used when TYPE = APPLICATION.
INDEX_URL = 'url'optionalSpecifies the HTTPS URL of the PyPI-compatible package index that a customer-hosted Python artifact repository fetches packages from (for example, 'https://nexus.example.com/repository/pypi-proxy/simple/'). The host must be covered by the API_ALLOWED_PREFIXES of the referenced API integration. Used only for customer-hosted PyPI repositories.
AUTHENTICATION_SECRET = secret_nameoptionalSpecifies the secret that Snowflake uses to authenticate to the customer-hosted Python artifact repository. The secret must be included in the ALLOWED_AUTHENTICATION_SECRETS of the referenced API integration. Used only for customer-hosted PyPI repositories.
PACKAGE_RETENTION = ON_OBJECT_CREATIONoptionalControls when Snowflake retains packages downloaded from a customer-hosted Python artifact repository: When not set (default), packages are retained asynchronously in the background after each CREATE FUNCTION or CREATE PROCEDURE. When set to ON_OBJECT_CREATION, CREATE FUNCTION and CREATE PROCEDURE download and retain every referenced package before the statement returns. For details, see Package retention and caching. Used only for customer-hosted PyPI repositories.
TAG ( tag_name = 'tag_value' [ , ... ] )optionalAssigns a tag to the repository. For more details about object tagging, see Introduction to object tagging.
COMMENT = 'string_literal'optionalSpecifies a comment for the artifact repository. DEFAULT: No value

Usage notes

Access control requirements

If your role does not own the objects in the following table, then your role must have the listed privileges on those objects: Privilege | Object | Notes CREATE ARTIFACT REPOSITORY | Schema | Required to create a new artifact repository in the schema. USAGE | API integration | Required only when TYPE = PYPI. The following privileges can be granted on an artifact repository after it’s created: Privilege | Object | Notes OWNERSHIP | Artifact repository | Grants full control, including publishing new package versions and dropping the repository. READ | Artifact repository | Allows downloading packages and artifacts. Grant this to any role that references the repository in CREATE APPLICATION SERVICE. Operating on an object in a schema requires at least one privilege on the parent database and at least one privilege on the parent schema. For instructions on creating a custom role with a specified set of privileges, see Creating custom roles. For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

See also

Referenced by