CREATE CREDENTIAL Syntax
TYPEis case-insensitive.- Only the
TYPEname is checked when the credential is created; whether it is appropriate is checked where the credential is used. - When a credential is used to authenticate a
catalog, a
SECRETgiven directly takes precedence over atokensupplied inWITH OPTIONS.
For the syntax of each authentication scheme, see
Provider-Specific Syntax below. For runnable
examples of every one, see
Creating Credentials
in the Snippets section.
- 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)
Parameters
OR REPLACE
OR REPLACE
Any existing credential with the same name will be dropped before creating this one
<schema name>
<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>
<credential name>
Name of the credential to create; must adhere to the supported
naming criteria
TYPE
TYPE
The type of credential to create. Supported types include:
| Type | Description |
|---|---|
aws_access_key | Authenticate to Amazon Web Services (AWS) via Access Key |
aws_iam_role | Authenticate to Amazon Web Services (AWS) via IAM Role |
azure_ad | Authenticate to Microsoft Azure via Active Directory |
azure_oauth | Authenticate to Microsoft Azure via OAuth |
azure_sas | Authenticate to Microsoft Azure via Shared Access Signature (SAS) using an account-level access token, not a container-level one |
azure_storage_key | Authenticate to Microsoft Azure via Storage Key |
confluent | Authenticate to a Confluent Kafka cluster or schema registry |
docker | Authenticate to a Docker repository |
gcs_service_account_id | Authenticate to Google Cloud via user ID & private key |
gcs_service_account_keys | Authenticate to Google Cloud via JSON key |
hdfs | Authenticate to HDFS |
jdbc | Authenticate via Java Database Connectivity |
kafka | Authenticate to an Apache Kafka cluster or schema registry |
nvidia_api_key | Authenticate to the Nvidia AI API |
openai_api_key | Authenticate to the OpenAI API |
rest | REST / OAuth bearer-token authentication for data lake catalog endpoints |
IDENTITY
IDENTITY
Optional username to use for authenticating with the credential. Its meaning depends on the
credential
TYPE; for rest, an IDENTITY & SECRET together form an OAuth
client-credentials pair, while a SECRET alone is a bearer token.SECRET
SECRET
Optional password to use for authenticating with the credential.
WITH OPTIONS
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
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.Each form below links to a runnable example. For all of them
in one place, see
Creating Credentials
in the Snippets section.
Azure
Syntax below, examples here.Data Lake Catalog
Syntax below, examples here. Used to authenticate data lake catalogs; aSECRET alone is a bearer token, while an IDENTITY & SECRET together
form an OAuth client-credentials pair.
GCS
Syntax below, examples here.HDFS
Syntax below, examples here.JDBC
Syntax below, examples here.Password