We are trying to create an Airflow Connection by setting an environment in Cloud Composer:
export AIRFLOW_CONN_GCP_CONN_ID=google_cloud_platform://?extra__google_cloud_platform__project=<project_id>&extra__google_cloud_platform__scope=https://www.googleapis.com/auth/cloud-platform&extra__google_cloud_platform__key_path=<path_to_json_file>
In logs we are getting an warning complaining that credentials are not set.
INFO - Getting connection using
google.auth.default()
since no key file is defined for hook.
When we looked into internals of code we found that if key_path
and keyfile_data
are not set then we get this error. But we are setting key_path
as mentioned in command.
For internal code we looked into gcp_api_base_hook.py
on GitHub.