Azure Cosmos DB

Version 24.1.8910


Azure Cosmos DB


CData Sync アプリケーションからAzure Cosmos DB コネクタを使用して、Azure Cosmos DB からデータを取得してサポートされている任意の同期先に移動できます。これを行うには、コネクタを追加し、コネクタへの認証を行い、接続を完了する必要があります。

Azure Cosmos DB コネクタを追加

Sync でAzure Cosmos DB のデータを使用できるようにするには、まず以下の手順でコネクタを追加する必要があります。

  1. Sync のダッシュボードから接続ページを開きます。

  2. 接続を追加をクリックしてコネクタを選択ページを開きます。

  3. データソースタブをクリックしてAzure Cosmos DB 行に移動します。

  4. 行末にある接続を設定アイコンをクリックして、新しい接続ページを開きます。接続を設定アイコンが利用できない場合は、コネクタをダウンロードアイコンをクリックしてAzure Cosmos DB コネクタをインストールします。新規コネクタのインストールについて詳しくは、接続を参照してください。

Verify the Role Assignment for Your Azure Identity

Before you connect to Azure Cosmos DB, you need to ensure that your Azure identity is assigned the correct role. The identity is the account that you use to log in to the browser (during Azure Active Directory authentication) or into the application (for Azure Service Principal authentication).

You can create custom role definitions:

  • CosmosDB Built-in Data Reader

  • CosmosDB Built-in Data Contributor

In addition, you can create custom role definintions.

You must also set the scope of the role assignment, where “/” specifies that the identity can access all the databases.

For more details about assigning roles, see Configure role-based access control with Microsoft Entra ID for your Cosmos DB account.

Azure Cosmos DB への認証

コネクタを追加したら、必須プロパティを設定する必要があります。

  • Connection Name - Enter a connection name of your choice.

  • Account Endpoint - Enter the Cosmos DB account URL. This URL is available the Keys blade (Settings > Keys) of your Cosmos DB accountof your Cosmos DB account.

CData Sync supports authenticating to Azure Cosmos DB in several ways. Select your authentication method below to proceed to the relevant section that contains the authentication details.

Account Key

To connect with account-key credentials, specify the following properties:

  • Auth Scheme - Select AccountKey.

  • Account Key (default) - Enter the master key token or resource token that is required to connect to the Azure Cosmos DB REST API.

  • Token Type - Select the type of token (master or resource) that you are using in the Account Key field. The default token type is master.

Azure Active Directory

Azure Active Directory ユーザーアカウントで接続するには、Auth SchemeAzureAD を選択します。CData Sync は、接続するための組み込みOAuth アプリケーションを提供するため、追加のプロパティは必要ありません。

Azure Service Principal

Azure サービスプリンシパルとクライアントシークレットで接続するには、次のプロパティを設定します。

  • Auth Scheme - AzureServicePrincipal を選択。

  • Azure Tenant - 接続するMicrosoft Online テナントを入力。

  • OAuth Client Id - OAuth 認証サーバーにアプリケーションを登録した際に割り当てられたクライアントId を入力。

  • OAuth Client Secret - OAuth 認証サーバーにアプリケーションを登録した際に割り当てられたクライアントシークレットを入力。

アプリケーションのOAuth クライアントId およびクライアントシークレットを取得するには:

  1. Azure ポータルにログインします。

  2. 左ナビゲーションペインですべてのサービスを選択します。次にアプリの登録を検索し選択します。

  3. 新規登録をクリックします。

  4. アプリケーションの名前を入力して任意のAzure AD ディレクトリ - マルチテナントを選択します。リダイレクトURI をCallbackURL に指定された値に設定します。

  5. アプリケーションを作成したら、概要セクションに表示されるアプリケーション (クライアント) ID の値をコピーします。この値をOAuth クライアントId として使用します。

  6. 証明書とシークレットセクションに移動して、アプリケーションの新しいクライアント シークレットを選択します。

  7. 有効期間を指定してクライアントシークレットを保存します。保存するとキーの値が表示されます。

  8. 値は一度しか表示されないので、コピーしておきます。この値をOAuth クライアントシークレットとして使用します。

  9. 認証タブで、必ずアクセストークン (暗黙的なフローに使用) を選択します。

Azure Service Principal Certificate

Azure サービスプリンシパルとクライアント証明書で接続するには、次のプロパティを設定します。

  • Auth Scheme - AzureServicePrincipalCert を選択。

  • Azure Tenant - 接続するMicrosoft Online テナントを入力。

  • OAuth Client Id - OAuth 認証サーバーにアプリケーションを登録した際に割り当てられたクライアントId を入力。

  • OAuth JWT Cert – Java web token(JWT)証明書ストアを入力。

  • OAuth JWT Cert Type – JWT 証明書を格納するキーストアの種類を入力。デフォルトの種類はPEMKEY_BLOB です。

  • OAuth JWT Cert Password(オプション)– OAuth JWT 証明書のパスワードを入力。

  • OAuth JWT Cert Subject(オプション)– OAuth JWT 証明書のサブジェクトを入力。

アプリケーションのOAuth 証明書を取得するには:

  1. Azure ポータルにログインします。

  2. 左ナビゲーションペインですべてのサービスを選択します。次にアプリの登録を検索し選択します。

  3. 新規登録をクリックします。

  4. アプリケーションの名前を入力して任意のAzure AD ディレクトリ - マルチテナントを選択します。リダイレクトURI をCallbackURL に指定された値に設定します。

  5. アプリケーションを作成したら、概要セクションに表示されるアプリケーション (クライアント) ID の値をコピーします。この値をOAuth クライアントId として使用します。

  6. 証明書とシークレットセクションに移動して、証明書のアップロードを選択します。次に、ローカルマシンからアップロードする証明書を選択します。

  7. 有効期間を指定してクライアントシークレットを保存します。保存するとキーの値が表示されます。

  8. 値は一度しか表示されないので、コピーしておきます。この値をOAuth クライアントシークレットとして使用します。

  9. 認証タブで、必ずアクセストークン (暗黙的なフローに使用) を選択します。

Complete Your Connection

To complete your connection:

  1. For the Schema property (optional), enter the schema (the Azure Cosmos DB database) with which you want to work.

  2. 高度な設定タブで接続の高度な設定を定義します。(ただし、ほとんどの場合これらの設定は必要ありません。)

  3. AzureAD で認証する場合は、Azure Cosmos DB への接続 をクリックしてAzure Cosmos DB アカウントに接続します。

  4. 作成およびテストをクリックして接続を作成します。

詳細情報

CData Sync とAzure Cosmos DB の連携について、詳しくはAzure Cosmos DB Connector for CData Sync を参照してください。