ALTER APPLICATION SERVICE

Modifies the configuration or lifecycle state of an existing Application Service. You can suspend, resume, or upgrade the service, and you can set or unset properties.

See also:

CREATE APPLICATION SERVICE , DESCRIBE APPLICATION SERVICE , DROP APPLICATION SERVICE , SHOW APPLICATION SERVICES

Syntax

ALTER APPLICATION SERVICE [ IF EXISTS ] <name> { SUSPEND | RESUME }

ALTER APPLICATION SERVICE [ IF EXISTS ] <name>
  UPGRADE [ TO VERSION <version_alias> ]

ALTER APPLICATION SERVICE [ IF EXISTS ] <name> SET
  [ AUTO_RESUME = { TRUE | FALSE } ]
  [ AUTO_SUSPEND_SECS = <num> ]
  [ EXTERNAL_ACCESS_INTEGRATIONS = ( <integration_name> [ , ... ] ) ]
  [ QUERY_WAREHOUSE = <warehouse_name> ]
  [ COMMENT = '<string_literal>' ]

ALTER APPLICATION SERVICE [ IF EXISTS ] <name> UNSET
  {
    AUTO_RESUME                  |
    AUTO_SUSPEND_SECS            |
    EXTERNAL_ACCESS_INTEGRATIONS |
    QUERY_WAREHOUSE              |
    COMMENT
  }
  [ , ... ]

Parameters

name

Specifies the identifier for the Application Service to alter.

If the identifier contains spaces or special characters, the entire string must be enclosed in double quotes. Identifiers enclosed in double quotes are also case-sensitive.

For more information, see Identifier requirements.

{ SUSPEND | RESUME }

Suspends or resumes the service. When the service is suspended, Snowflake stops its containers and stops billing for compute. When you resume the service, Snowflake starts containers using the currently deployed package version.

UPGRADE [ TO VERSION version_alias ]

Upgrades the service to a different version of its package.

  • If TO VERSION is omitted and the service was created with a version alias, such as LATEST, Snowflake re-resolves the alias to its current target version and upgrades to that version.
  • If TO VERSION is omitted and the service was created with a concrete version name, the command returns an error asking you to specify a version.
  • If TO VERSION is specified, you can pass a version name, such as VERSION$4, or an alias, such as LATEST.

If the resolved target version is the same as the running version, the upgrade is a no-op.

SET ...

Sets one or more properties on the service. Properties not listed in the SET clause are unchanged. See CREATE APPLICATION SERVICE for parameter descriptions.

UNSET ...

Removes a property, resetting it to the default.

Access control requirements

A role used to execute this operation must have the following privileges at a minimum:

PrivilegeObjectNotes
OPERATEApplication Service

Required for SUSPEND, RESUME, UPGRADE, SET, and UNSET.

READArtifact repositoryRequired for UPGRADE to resolve the target package version.

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.

Usage notes

  • An upgrade applies the new package version to the running service. Snowflake performs a rolling restart of the service containers using the new build.
  • To change the compute pool that runs the service, drop and recreate the service. You can’t change the compute pool with ALTER.
  • Suspending a service doesn’t change the deployed package version. The service resumes on the same version.

Examples

Suspend a service:

ALTER APPLICATION SERVICE my_app SUSPEND;

Resume a service:

ALTER APPLICATION SERVICE my_app RESUME;

Upgrade a service that was created with an alias to the alias’s current target (re-resolves LATEST or DEFAULT):

ALTER APPLICATION SERVICE my_app UPGRADE;

Upgrade to a specific version:

ALTER APPLICATION SERVICE my_app UPGRADE TO VERSION VERSION$5;

Change auto-suspend and external access:

ALTER APPLICATION SERVICE my_app SET
  AUTO_SUSPEND_SECS = 900
  EXTERNAL_ACCESS_INTEGRATIONS = ( my_eai, analytics_eai );