Skip to main content
Creates a new credential, which is a record that contains authentication information required to connect to a resource outside the database. Any user may create a credential for their own use.
CREATE CREDENTIAL Syntax
The following can make use of credentials: The following services are supported:
  • Azure (Microsoft blob storage)
  • GCS (Google Cloud Storage)
  • HDFS (Apache Hadoop Distributed File System)
  • JDBC (Java Database Connectivity, using a user-supplied driver or one of the drivers on the supported list)
  • Kafka (streaming feed)
    • Apache
    • Confluent
  • Remote Repositories
    • Docker
    • Nvidia
    • OpenAI
  • S3 (Amazon S3 Bucket)
For provider-specific syntax, see Provider-Specific Syntax. For provider-specific examples, see Creating Credentials.

Parameters

OR REPLACE

Any existing credential with the same name will be dropped before creating this one

<schema name>

Name of the schema that will contain the created credential; if no schema is specified, the credential will be created in the user’s default schema

<credential name>

Name of the credential to create; must adhere to the supported naming criteria

TYPE

The type of credential to create. Supported types include:
TypeDescription
aws_access_keyAuthenticate to Amazon Web Services (AWS) via Access Key
aws_iam_roleAuthenticate to Amazon Web Services (AWS) via IAM Role
azure_adAuthenticate to Microsoft Azure via Active Directory
azure_oauthAuthenticate to Microsoft Azure via OAuth
azure_sasAuthenticate to Microsoft Azure via Shared Access Signature (SAS) using an account-level access token, not a container-level one
azure_storage_keyAuthenticate to Microsoft Azure via Storage Key
confluentAuthenticate to a Confluent Kafka cluster or schema registry
dockerAuthenticate to a Docker repository
gcs_service_account_idAuthenticate to Google Cloud via user ID & private key
gcs_service_account_keysAuthenticate to Google Cloud via JSON key
hdfsAuthenticate to HDFS
jdbcAuthenticate via Java Database Connectivity
kafkaAuthenticate to an Apache Kafka cluster or schema registry
nvidia_api_keyAuthenticate to the Nvidia AI API
openai_api_keyAuthenticate to the OpenAI API

IDENTITY

Username to use for authenticating with the credential.

SECRET

Password to use for authenticating with the credential.

WITH OPTIONS

Optional indicator that a comma-delimited list of option/value assignments will follow. See Options for the full list of options.

Examples

To create a credential, auser_azure_active_dir_creds, for connecting to Microsoft Azure Active Directory:
CREATE CREDENTIAL (Azure AD) Example
To create a credential, kafka_cred, for connecting to Apache Kafka via SSL:
CREATE CREDENTIAL (Kafka SSL) Example

Options

The following is a list of possible credential options and their associated providers. For valid combinations of credential options per provider and authentication mechanism, see Provider-Specific Syntax.

Provider-Specific Syntax

Several authentication schemes across multiple providers are supported.

Azure

Syntax below, examples here.

GCS

Syntax below, examples here.

HDFS

Syntax below, examples here.

JDBC

Syntax below, examples here.
Password

Kafka (Apache)

Syntax below, examples here.

Kafka (Confluent)

Syntax below, examples here.

Remote Repository

Syntax below, examples here.

S3

Syntax below, examples here.