ALTER APPLICATION SERVICE
statementpartialNative apps, listings & sharingModifies the configuration or lifecycle state of an existing Application Service. You can suspend, resume, disable, enable, or upgrade the service, and you can set or unset properties.
Syntax
supportedpartialnot supportednot scored
ALTER APPLICATION SERVICE [ IF EXISTS ] <name> { SUSPEND | RESUME }
ALTER APPLICATION SERVICE [ IF EXISTS ] <name> { DISABLE | ENABLE }
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> ]
[ MIN_INSTANCES = <num> ]
[ MAX_INSTANCES = <num> ]
[ COMMENT = '<string_literal>' ]
ALTER APPLICATION SERVICE [ IF EXISTS ] <name> UNSET
{
AUTO_RESUME |
AUTO_SUSPEND_SECS |
EXTERNAL_ACCESS_INTEGRATIONS |
QUERY_WAREHOUSE |
MIN_INSTANCES |
MAX_INSTANCES |
COMMENT
}
[ , ... ]
Parameters
| Name | Required | Description |
|---|---|---|
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. SUSPEND and RESUME apply to a service on managed compute. A service on managed compute runs until you suspend it. | |
{ DISABLE | ENABLE } | Disables or enables a service on serverless compute. No request can start a disabled service. While disabled, the service keeps its Application Service object, deployed package, configuration, privilege grants, and endpoint URL. Enabling recreates the serverless runtime with the same endpoint. Preview Feature — Open Available to all accounts. You can’t upgrade, redeploy, or change the configuration of a disabled service. Enable it first. A serverless service that stopped after its AUTO_SUSPEND_SECS idle period isn’t disabled: the next request starts it again. | |
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. |
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.
- Use SUSPEND and RESUME for a service on managed compute, and DISABLE and ENABLE for a service on serverless compute.
- Suspending a service doesn’t change the deployed package version. The service resumes on the same version.
- If RESUME fails because the service’s runtime image is no longer allowed, Snowflake returns an error similar to: Application service 'my_app' cannot be resumed because its runtime image is blocked. Upgrade the service to a new version before resuming. Deploy a new package version (for example with UPGRADE or snow app deploy) that uses a supported runtime image, then resume the service.
- If MAX_INSTANCES isn’t set, it matches MIN_INSTANCES. If neither is set, Snowflake runs one instance.
- To change both values in one statement, include both in the same SET clause.
- You can’t set a SPECIFICATION with ALTER APPLICATION SERVICE ... SET. To update the specification of a service, use CREATE OR ALTER APPLICATION SERVICE. A specification is the full intended state of the service, so it resets any property it doesn’t set. ALTER APPLICATION SERVICE ... SET remains the way to change a single property in place.
Access control requirements
A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes OPERATE | Application Service | Required for SUSPEND, RESUME, DISABLE, ENABLE, UPGRADE, SET, and UNSET. READ | Artifact repository | Required 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.
Known gaps
- IF EXISTS is not exercised by any test
See also
- CREATE APPLICATION SERVICE
- DESCRIBE APPLICATION SERVICE
- DROP APPLICATION SERVICE
- SHOW APPLICATION SERVICES