SYSTEM$FETCH_EXTERNAL_SECRET_FROM_INTEGRATION
functionnot supportedIntegrations, network & secretspreviewFetches one secret value through an external secret provider security integration.
Syntax
SYSTEM$FETCH_EXTERNAL_SECRET_FROM_INTEGRATION( '<integration_name>' , '<secret_identifier>' )
Parameters
| Name | Required | Description |
|---|---|---|
integration_name | required | Name of an external secret provider security integration with TYPE = API_AUTHENTICATION and AUTH_TYPE = WORKLOAD_IDENTITY_FEDERATION. |
secret_identifier | required | Provider-specific identifier for exactly one secret: Provider Required identifier AWS Secrets Manager Full secret ARN, without a version or stage qualifier appended Azure Key Vault Secret name returned by SYSTEM$LIST_EXTERNAL_SECRETS Google Cloud Secret Manager Secret ID returned by SYSTEM$LIST_EXTERNAL_SECRETSExpandShow lessSee more |
Returns
Returns a provider-specific JSON object that contains the secret value and metadata. Every provider response includes name, value, and version_id. AWS responses include arn; Azure and Google Cloud responses include id. Example response from AWS Secrets Manager:
Usage notes
- Queries that call this function don’t appear in query history. Snowflake purges the persisted query result after approximately five minutes.
- The active query result contains the secret in plaintext. Don’t log, persist, or expose the result to unauthorized users.
- AWS binary secrets aren’t supported.
- For Google Cloud Secret Manager, the function returns the latest secret version. You can’t request an earlier version.
Access control requirements
A role used to execute this operation must have the following privileges at a minimum: Privilege | Object | Notes USAGE | Integration | Required on the specified integration. The USAGE privilege authorizes the current role to use the integration, including through role inheritance. The cloud permissions granted to the integration’s federated identity determine which operations the integration can perform and which secrets it can access. 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.