概要
Dataplex にて他プロジェクトの BigQuery のテーブルに対して Data Profile を実施する方法を共有します。
Data Profile 作成時に別のテーブルを指定することができますが、権限不足であるというエラーが発生します。
An error occurred while creating the profile. Please try again.
Permission denied for Dataplex Service Agent (service-241625037743@gcp-sa-dataplex.iam.gserviceaccount.com) to access source BigQuery table [project:publisher-01, dataset:publisher01, table:sample_01]. Dataplex Service Agent should havebigquery.tables.get
permission for the specified table to create a DataScan for it. Please grantbigquery.tables.get
permission for the specified table via appropriate IAM roles e.g. BigQuery Data Viewer.
Dataplex Service Agent (Dataplex サービス アカウント)にアクセス権を付与が必要であるとドキュメントに記載されています。本記事では、その対応方法を提示します。ただし、付与するロールがBigQuery Data Editor
であることから最小限の権限でない可能性があることに注意してください。
BigQuery テーブルとデータ プロファイル スキャンが異なるプロジェクトにある場合、Dataplex サービス アカウントに、対応する BigQuery テーブルの読み取り権限を付与する必要があります。
引用元:データ プロファイル スキャンを作成して使用する | Dataplex | Google Cloud
エラーの再現方法
1. Dataplex にてProfile
-> CREATE DATA PROFILE SCAN
を選択
2. Define scan
にてID
に適当な名前を入力し、table
に他のプロジェクトのテーブルを指定してCONTINUE
を選択
3. Additional settings (optional)
をデフォルトのままでCREATE
を選択
4. エラーとなることを確認
An error occurred while creating the profile. Please try again.
Permission denied for Dataplex Service Agent (service-241625037743@gcp-sa-dataplex.iam.gserviceaccount.com) to access source BigQuery table [project:publisher-01, dataset:publisher01, table:sample_01]. Dataplex Service Agent should havebigquery.tables.get
permission for the specified table to create a DataScan for it. Please grantbigquery.tables.get
permission for the specified table via appropriate IAM roles e.g. BigQuery Data Viewer.