Marketplace provides two environment variables related to Google Cloud which can be used to connect to Google Cloud and big query:
-
ALLI_GOOGLE_CLOUD_CREDENTIALSthis is a file path. The file contains credential info that can be passed intogoogle.auth.aws.Credentials -
ALLI_GOOGLE_CLOUD_PROJECTThis is the project name and can be used to in big query connections and table names -
ALLI_GOOGLE_CLOUD_BIGQUERY_LOCATIONWhere the bigquery data is located regionall (USorEU)
Python Example
Python
import os
from google.auth import load_credentials_from_file
from google.cloud import bigquery
credentials, _ = load_credentials_from_file(os.environ['ALLI_GOOGLE_CLOUD_CREDENTIALS'])
bq = bigquery.Client(credentials=credentials, project=os.environ['ALLI_GOOGLE_CLOUD_PROJECT'])
datasets = list(bq.list_datasets())
print(datasets)