Reference

Authentication Service account JSON


Description

No description available [API reference]

Instructions

Service-account JSON path. Use this for unattended Linked Server, ADF, or Power BI gateway refresh.

  1. In Google Cloud Console open IAM & Admin > Service Accounts and create an account.
  2. Grant a Spanner role such as Cloud Spanner Database User (read) or a writer role if you need DML.
  3. Create a JSON key and download it to a folder only the DSN process can read. Do not put the key in the connector XML or git/TFVC.
  4. Set GOOGLE_APPLICATION_CREDENTIALS or paste the JSON file path into Credentials file.
  5. Fill Project, Instance, and Database (from Spanner Studio).
  6. Finish the wizard. Then click Test Connection on the DSN Main UI (the wizard does not run Test Connection).
  7. Done. You can query from C#, Python, PowerShell, and ODBC apps.

Parameters

Parameter Required Default value Options
Name: DriverFilePaths

Label: JDBC driver file(s)

Filled by the wizard after download. Separate multiple JARs with a semicolon (e.g. C:\ZappySys\Jdbc\MyConnector\driver.jar).
YES C:\ZappySys\Jdbc\Google Cloud Spanner\google-cloud-spanner-jdbc-2.40.0-single-jar-with-dependencies.jar
Name: ProjectId

Label: Project id

GCP project id (e.g. MY_PROJECT).
YES MY_PROJECT
Name: InstanceId

Label: Instance id

Spanner instance id (e.g. MY_INSTANCE).
YES MY_INSTANCE
Name: credentials

Label: Credentials file (JSON)

Full path to the service-account JSON key. The wizard maps this to the JDBC credentials property (e.g. C:\keys\spanner.json).
YES
Name: DriverClass

Label: Driver class

Optional. Leave blank to auto-detect from the JAR unless SPI is ambiguous (e.g. com.google.cloud.spanner.jdbc.JdbcDriver).
com.google.cloud.spanner.jdbc.JdbcDriver
Name: Database

Label: Database name

Database, schema, or catalog name (e.g. MyDatabase).
MyDatabase
Name: CredentialsPath

Label: Credentials path

Path to the service-account JSON key (e.g. C:\keys\spanner.json).
C:\keys\spanner.json