1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

BigQueryのfederated queriesでConnection Errorが発生した場合の対処法

Last updated at Posted at 2023-10-28

BigQueryのfederated queriesを試していたところ、以下のエラーに遭遇。

Invalid table-valued function EXTERNAL_QUERY Failed to connect to MySQL database. 

公式ドキュメントに記載の通り、Cloud SQL への初回接続時に自動作成されるService Account(BigQuery Connection Service Agent)に対し、以下の権限を付与すれば解決する。

  • cloudsql.instances.connect
  • cloudsql.instances.get
gcloud projects add-iam-policy-binding PROJECT_ID \
    --member=serviceAccount:SERVICE_ACCOUNT_ID \
    --role=roles/cloudsql.client

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?