SYSTEM$REMOTE_APP_OPERATION

functionnot supportedNative apps, listings & sharing

docs.snowflake.com ↗

System functions

Performs a remote app operation on a Snowflake Native App. This function is available only to providers.

Syntax

supportedpartialnot supportednot scored

SYSTEM$REMOTE_APP_OPERATION(
  '<operation_type>',
  '<package_name>',
  '<application_hash>'
  [, '<configuration>' ]
)

Parameters

NameRequiredDescription
'operation_type'requiredThe type of remote operation to perform. Possible values: run_sql, enable, disable, retry_upgrade.
'package_name'requiredThe name of the application package associated with the Snowflake Native App.
'application_hash'requiredThe hash value of the application. You can find this value in the APPLICATION_STATE view or by calling SYSTEM$GET_HASH_FOR_APPLICATION.
'configuration'requiredA JSON string that contains configuration fields for the operation. Required for the run_sql and disable operation types.

Returns

Returns a JSON string containing a request ID that you can use to track the result of the operation in the event table.

Operation type: run_sql

The run_sql operation runs a SQL statement on the consumer application. Read the remote app operation guide for more details. For the configuration argument, pass a JSON string that includes a sql key whose value is the SQL statement to run. For example: Only one SQL statement can be run at a time. Providing multiple SQL statements (for example, {"sql": "SELECT 1; SELECT 2"}) fails.

Operation type: disable

The disable operation disables the consumer Snowflake Native App. Read the remote app operation guide for more details. For the configuration argument, pass a JSON string that includes a reason key whose value is the reason for disabling the Snowflake Native App. For example:

Operation type: enable

The enable operation enables a consumer Snowflake Native App that has been disabled by the disable operation. For example: Note This operation can only enable applications that have been disabled by the provider. If an application was disabled by Snowflake, see What to do if an app is unavailable.

Operation type: retry_upgrade

The retry_upgrade operation retries the upgrade of a consumer Snowflake Native App. It is non-blocking. For example: