Before writing a CREATE SECRET statement:
- Read
references/parameters.mdto review all available parameters and their defaults. - For each parameter, decide whether the user's request implies a non-default value.
- Include only the parameters that differ from the default or that the user explicitly requested.
- Never use
CREATE OR REPLACE— always useCREATE SECRET IF NOT EXISTS. - Select the correct TYPE based on the use case:
GENERIC_STRINGfor API tokens or arbitrary sensitive strings accessed viaSYSTEM$GET_SECRET.PASSWORDfor username/password basic-auth credentials.OAUTH2withAPI_AUTHENTICATION+OAUTH_SCOPESfor OAuth2 client-credentials flow.OAUTH2withOAUTH_REFRESH_TOKEN+OAUTH_REFRESH_TOKEN_EXPIRY_TIME+API_AUTHENTICATIONfor OAuth2 authorization-code-grant flow.
- The secret value (SECRET_STRING, PASSWORD, OAUTH_REFRESH_TOKEN) is never shown after creation; advise users to store the original value securely.
- For OAUTH2 secrets, the referenced security integration must exist and its OAUTH_ALLOWED_SCOPES must cover any requested OAUTH_SCOPES.