クロスクラウド接続を作成する

クロスクラウド接続は、アマゾン ウェブ サービス(AWS)、Microsoft Azure、Salesforce Data 360 から BigQuery にデータを取得してクエリを実行する BigQuery 接続です。これらの接続は、BigQuery Omni を使用する標準の BigQuery 接続の代替手段です。BigQuery Omni では、BigQuery が軽量のコンピューティング ワーカーをリモート リージョンにデプロイし、データ移動なしで他のクラウドのデータをクエリに使用できるようにします。

ワークロードが標準接続ではなくクロス クラウド接続を利用するメリットは次のとおりです。

  • 機能の整合性。他のクラウドから BigQuery にデータを移行すると、標準接続では利用できない BigQuery AI 機能、Gemini Enterprise Agent Platform、マテリアライズド ビュー、ユーザー定義関数などの機能に直接アクセスできます。
  • 費用対効果。クロスクラウド接続を使用するワークロードは、標準スロットの予約と確約を使用するため、個別のコンピューティング容量を管理する必要がなくなります。
  • インテリジェントなキャッシュ保存。クラウド間でデータが転送される間、BigQuery はフラグメントをローカルに自動的にキャッシュに保存し、後続のクエリでクラウド間の下り(外向き)料金が大幅に発生しないようにします。詳細については、インテリジェント キャッシュ保存をご覧ください。

ワークロードに Apache Iceberg カタログが含まれている場合や、BigQuery 以外のエンジンでクエリのサポートが必要な場合は、代わりにボーダーレス レイクハウスのクロスクラウド データアクセス機能の使用を検討してください。

始める前に

このドキュメントの各タスクを実行するために必要な権限をユーザーに与える Identity and Access Management とサードパーティのロールを付与します。

必要な BigQuery のロール

クロスクラウド接続の作成に必要な権限を取得するには、プロジェクトに対する BigQuery 管理者 roles/bigquery.admin)IAM ロールを付与するよう管理者に依頼してください。ロールの付与については、プロジェクト、フォルダ、組織に対するアクセス権の管理をご覧ください。

必要な権限は、カスタムロールや他の事前定義ロールから取得することもできます。

必要なサードパーティのロール

クロスクラウド接続の作成に必要な権限を取得するには、次のサードパーティ ロールがあることを確認してください。

  • AWS の場合: AWS アカウントで IAM ポリシーとロールを作成できるロール。
  • Azure の場合: Microsoft Entra ID(Azure AD)でアプリの登録を管理し、ターゲットの Azure アカウントに Storage Blob Data Reader などのロールを割り当てることができるロール。

AWS クロスクラウド接続を作成する

AWS クロスクラウド接続を作成する手順は次のとおりです。

  1. 標準の BigQuery 接続の場合と同様に、BigQuery の AWS IAM ポリシーを作成します。
  2. 標準の BigQuery 接続の場合と同様に、BigQuery の AWS IAM ロールを作成します。
  3. 接続リソースを作成するには、bq mk --connection コマンドを使用します。

    bq mk --connection \
        --connection_type='AWS' \
        --location=LOCATION \
        --project_id=PROJECT_ID \
        --properties='{"accessRole":{"iamRoleId":"arn:aws:iam::AWS_ACCOUNT_ID:role/ROLE_NAME"}}' \
        CONNECTION_ID

    次のように置き換えます。

    • LOCATION: BigQuery Omni のロケーションではなく、標準の BigQuery のロケーション。リージョンの選択については、リージョンの推奨事項をご覧ください。
    • PROJECT_ID: 実際の Google Cloud プロジェクト ID。
    • AWS_ACCOUNT_ID: 前の手順の AWS IAM ユーザーの ID。
    • ROLE_NAME: 選択した AWS ロール ポリシー名。
    • CONNECTION_ID: この接続リソースに付ける ID。
  4. サービス アカウントの情報をメモするには、bq show コマンドを使用します。

    bq show --connection \
        --location=LOCATION \
        PROJECT_ID.LOCATION.CONNECTION_ID
  5. 標準の BigQuery 接続の場合と同様に、サービス アカウント情報を使用して、信頼ポリシーを AWS ロールに追加します

確立した AWS クロスクラウド接続を使用して、リモートデータをクエリするテーブルとデータセットを作成できます。

AWS の例

次の例では、クロスクラウド接続を使用して、Amazon Simple Storage Service(Amazon S3)バケットから Parquet ファイルを直接クエリする外部テーブルを作成します。

CREATE SCHEMA `my-project.aws_raw_data`
  OPTIONS (
    location = 'us-east4');

CREATE EXTERNAL TABLE `my-project.aws_raw_data.sales_parquet`
WITH CONNECTION `us-east4.my-aws-connection`
  OPTIONS (
    format = 'PARQUET',
    uris = ['s3://my-data-bucket/sales/year=2025/*']);

次の例では、AWS Glue とクロスクラウド接続を使用して、データベース全体を BigQuery に連携します。

CREATE EXTERNAL SCHEMA `my-project.aws_glue_data`
WITH CONNECTION `us-east4.my-aws-connection`
  OPTIONS (
    location = 'us-east4',
    external_source = 'aws-glue://arn:aws:glue:us-east-4:123456789:database/test_database');

AWS Glue 連携の詳細については、AWS Glue 連携データセットを作成して管理するをご覧ください。

Azure クロスクラウド接続を作成する

Azure クロスクラウド接続を作成する手順は次のとおりです。

  1. 標準の BigQuery 接続と同様に、Azure テナントでアプリケーションを作成し、アプリケーション(クライアント)ID とディレクトリ(テナント)ID をメモします。
  2. 標準の BigQuery 接続と同様に、Azure アプリケーションにロールを割り当てます
  3. 接続リソースを作成するには、bq mk --connection コマンドを使用します。

    bq mk --connection \
        --connection_type='Azure' \
        --tenant_id=TENANT_ID \
        --location=LOCATION \
        --federated_azure=true \
        --federated_app_client_id=APP_ID \
        --project_id=PROJECT_ID \
        CONNECTION_ID

    次のように置き換えます。

    • TENANT_ID: Azure アカウントを含む Azure ディレクトリのテナント ID。
    • LOCATION: BigQuery Omni のロケーションではなく、標準の BigQuery のロケーション。リージョンの選択については、リージョンの推奨事項をご覧ください。
    • APP_ID: Azure アプリケーション(クライアント)ID。
    • PROJECT_ID: 実際の Google Cloud プロジェクト ID。
    • CONNECTION_ID: この接続リソースに付ける ID。
  4. サービス アカウントの情報をメモするには、bq show コマンドを使用します。

    bq show --connection \
        --location=LOCATION \
        PROJECT_ID.LOCATION.CONNECTION_ID
  5. 標準の BigQuery 接続の場合と同様に、サービス アカウント情報を使用してフェデレーション認証情報を追加します。

確立した Azure クロスクラウド接続を使用して、リモートデータにクエリを実行するためのテーブルとデータセットを作成できます。

Azure の例

次の例では、クロスクラウド接続を使用して Azure Blob Storage コンテナから Parquet ファイルを直接クエリする外部テーブルを作成します。

CREATE SCHEMA `my-project.azure_raw_data`
  OPTIONS (
    location = 'us-east4');

CREATE EXTERNAL TABLE `my-project.azure_raw_data.sales_parquet`
WITH CONNECTION `us-east4.my-azure-connection`
  OPTIONS (
    format = 'PARQUET',
    uris = ['azure://mystorageaccount.blob.core.windows.net/mycontainer/sales/year=2025/*']);

次の例では、クロスクラウド接続を使用して、Blob Storage コンテナから未加工の CSV エクスポートをクエリする外部テーブルを作成します。

CREATE EXTERNAL TABLE `my-project.azure_raw_data.daily_logs_csv`
WITH CONNECTION `us-east4.my-azure-connection`
  OPTIONS (
    format = 'CSV',
    skip_leading_rows = 1,
    uris = ['azure://mystorageaccount.blob.core.windows.net/mycontainer/logs/*.csv']);

Data 360 クロスクラウド接続を作成する

Data 360 クロスクラウド接続を作成するには、Data 360 データセットを BigQuery にリンクする手順に沿って操作します。ただし、BigQuery Omni ロケーションにリンクされたデータセットを作成する代わりに、標準の BigQuery ロケーションに作成します。リージョンの選択については、リージョンの推奨事項をご覧ください。

新しいデータセットを使用するようにクエリを更新したら、以前のリンクされたデータセットと BigQuery Omni マテリアライズド ビューを削除できます。

リージョンの推奨事項

クロスクラウド接続に標準の BigQuery リージョンを選択する場合は、費用とパフォーマンスの効率を最適化するために、データに物理的に最も近いリージョンを選択します。

次の表に、AWS リージョンと、対応する最適な BigQuery リージョンを示します。

AWS リージョン 最も近い BigQuery リージョン その他の近い BigQuery リージョン
us-east-1 us-east4 us-east1
us-east5
us-central1
us-east-2 us-east5 us-east4
us-east1
us-central1
us-west-1 us-west2 us-west4
us-west1
us-west3
us-west-2 us-west1 us-west3
us-west4
us-west2
ca-central-1 northamerica-northeast1 northamerica-northeast2
us-east4
us-east5
sa-east-1 southamerica-east1 southamerica-west1
us-east1
us-south1
eu-west-1 europe-west1 europe-west2
europe-west9
europe-west4
eu-west-2 europe-west2 europe-west1
europe-west9
europe-west4
eu-west-3 europe-west9 europe-west1
europe-west2
europe-west3
eu-central-1 europe-west3 europe-west4
europe-west1
europe-west6
eu-central-2 europe-west6 europe-west8
europe-west12
europe-west3
eu-north-1 europe-north1 europe-west4
europe-central2
europe-west1
eu-south-1 europe-west8 europe-west12
europe-west6
europe-west3
eu-south-2 europe-southwest1 europe-west9
europe-west1
europe-west8
me-central-1 me-central1 me-central2
me-west1
asia-south1
me-south-1 me-central2 me-central1
me-west1
asia-south1
af-south-1 europe-southwest1 me-central2
me-west1
europe-west1
ap-east-1 asia-east2 asia-east1
asia-southeast1
asia-northeast1
ap-northeast-1 asia-northeast1 asia-northeast2
asia-northeast3
asia-east1
ap-northeast-2 asia-northeast3 asia-northeast2
asia-northeast1
asia-east1
ap-northeast-3 asia-northeast2 asia-northeast1
asia-northeast3
asia-east1
ap-south-1 asia-south1 asia-south2
me-central1
asia-southeast1
ap-south-2 asia-south2 asia-south1
asia-southeast1
me-central1
ap-southeast-1 asia-southeast1 asia-southeast2
asia-east1
asia-south1
ap-southeast-2 australia-southeast1 australia-southeast2
asia-southeast2
asia-southeast1
ap-southeast-3 asia-southeast2 asia-southeast1
australia-southeast1
asia-east1

次の表に、Azure リージョンと、対応する最適な BigQuery リージョンを示します。

Azure リージョン 最も近い BigQuery リージョン その他の近い BigQuery リージョン
米国東部 us-east4 us-east1
us-east5
us-central1
米国東部 2 us-east4 us-east1
us-east5
us-south1
米国西部 us-west1 us-west2
us-west3
us-west4
米国西部 2 us-west1 us-west4
us-west3
us-west2
米国西部 3 us-west4 us-west2
us-west3
us-west1
米国中部 us-central1 us-east5
us-east4
us-east1
米国中北部 us-east5 us-central1
us-east4
us-east1
米国中南部 us-south1 us-east5
us-central1
us-east1
米国中西部 us-west3 us-central1
us-west4
us-west2
カナダ中部 northamerica-northeast2 northamerica-northeast1
us-east5
us-east4
カナダ東部 northamerica-northeast1 northamerica-northeast2
us-east4
us-east5
西ヨーロッパ europe-west4 europe-west1
europe-west3
europe-west9
北ヨーロッパ europe-west1 europe-west2
europe-west9
europe-west4
フランス中部 europe-west9 europe-west1
europe-west2
europe-west3
フランス南部 europe-west9 europe-southwest1
europe-west8
europe-west1
ドイツ中西部 europe-west3 europe-west4
europe-west1
europe-west6
ドイツ北部 europe-west3 europe-west4
europe-central2
europe-west2
スイス北部 europe-west6 europe-west8
europe-west12
europe-west3
スイス西部 europe-west6 europe-west9
europe-west8
europe-west3
英国南部 europe-west2 europe-west1
europe-west9
europe-west4
英国西部 europe-west2 europe-west1
europe-west9
europe-west4
ノルウェー東部 europe-north1 europe-west4
europe-central2
europe-west1
ノルウェー西部 europe-north1 europe-west4
europe-central2
europe-west1
スウェーデン中部 europe-north1 europe-west4
europe-central2
europe-west1
東アジア asia-east2 asia-east1
asia-southeast1
asia-northeast1
東南アジア asia-southeast1 asia-southeast2
asia-east1
asia-south1
東日本 asia-northeast1 asia-northeast2
asia-northeast3
asia-east1
日本西部 asia-northeast2 asia-northeast1
asia-northeast3
asia-east1
韓国中部 asia-northeast3 asia-northeast2
asia-northeast1
asia-east1
オーストラリア東部 australia-southeast1 australia-southeast2
asia-southeast2
asia-southeast1
オーストラリア南東部 australia-southeast2 australia-southeast1
asia-southeast1
asia-east1
オーストラリア中部 australia-southeast1 australia-southeast2
asia-southeast2
asia-southeast1
インド西部 asia-south1 asia-south2
me-central1
asia-southeast1
中央インド asia-south1 asia-south2
me-central1
asia-southeast1
南インド asia-south1 asia-south2
asia-southeast1
me-central1

次のステップ