> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sync.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure Cosmos DB

export const CommonAuthSchemeAzureserviceprincipalcert = () => {
  return <>
      <p>Azure サービスプリンシパルとクライアント証明書で接続するには、次のプロパティを設定します：</p>
      <ul>
        <li><strong>Auth Scheme：</strong><strong>AzureServicePrincipalCert</strong> を選択。</li>
        <li><strong>Azure Tenant：</strong>接続するMicrosoft Online テナントを入力。</li>
        <li><strong>OAuth Client Id：</strong>OAuth 認証サーバーにアプリケーションを登録した際に割り当てられたクライアントId を入力。</li>
        <li><strong>OAuth JWT Cert：</strong>Java web token（JWT）証明書ストアを入力。</li>
        <li><strong>OAuth JWT Cert Type：</strong>JWT 証明書を格納するキーストアの種類を入力。デフォルトの種類は<strong>PEMKEY_BLOB</strong> です。</li>
        <li>（オプション）<strong>OAuth JWT Cert Password：</strong>OAuth JWT 証明書のパスワードを入力。</li>
        <li>（オプション）<strong>OAuth JWT Cert Subject：</strong>OAuth JWT 証明書のサブジェクトを入力。</li>
      </ul>
      <p>アプリケーションのOAuth 証明書を取得するには：</p>
      <ol>
        <li><a href="https://portal.azure.com" target="_blank" rel="noopener noreferrer">Azure ポータル</a>にログインします。</li>
        <li>左ナビゲーションペインで<strong>すべてのサービス</strong>を選択します。次に<strong>アプリの登録</strong>を検索し選択します。</li>
        <li><strong>新規登録</strong>をクリックします。</li>
        <li>アプリケーションの名前を入力して<strong>任意のAzure AD ディレクトリ - マルチテナント</strong>を選択します。</li>
        <li>アプリケーションを作成したら、<strong>概要</strong>セクションに表示されるアプリケーション (クライアント) ID の値をコピーします。この値をOAuth クライアントId として使用します。</li>
        <li><strong>証明書とシークレット</strong>セクションに移動して、<strong>証明書のアップロード</strong>を選択します。次に、ローカルマシンからアップロードする証明書を選択します。</li>
        <li>有効期間を指定してクライアントシークレットを保存します。保存するとキーの値が表示されます。</li>
        <li>値は一度しか表示されないので、コピーしておきます。この値をOAuth クライアントシークレットとして使用します。</li>
        <li><strong>認証</strong>タブで、必ず<strong>アクセストークン (暗黙的なフローに使用)</strong> を選択します。</li>
      </ol>
    </>;
};

export const CommonAuthSchemeAzureserviceprincipal = () => {
  return <>
      <p>Azure サービスプリンシパルとクライアントシークレットで接続するには、次のプロパティを設定します：</p>
      <ul>
        <li><strong>Auth Scheme：</strong><strong>AzureServicePrincipal</strong> を選択。</li>
        <li><strong>Azure Tenant：</strong>接続するMicrosoft Online テナントを入力。</li>
        <li><strong>OAuth Client Id：</strong>OAuth 認証サーバーにアプリケーションを登録した際に割り当てられたクライアントId を入力。</li>
        <li><strong>OAuth Client Secret：</strong>OAuth 認証サーバーにアプリケーションを登録した際に割り当てられたクライアントシークレットを入力。</li>
      </ul>
      <p>アプリケーションのOAuth クライアントId およびクライアントシークレットを取得するには：</p>
      <ol>
        <li><a href="https://portal.azure.com" target="_blank" rel="noopener noreferrer">Azure ポータル</a>にログインします。</li>
        <li>左ナビゲーションペインで<strong>すべてのサービス</strong>を選択します。次に<strong>アプリの登録</strong>を検索し選択します。</li>
        <li><strong>新規登録</strong>をクリックします。</li>
        <li>アプリケーションの名前を入力して<strong>任意のAzure AD ディレクトリ - マルチテナント</strong>を選択します。</li>
        <li>アプリケーションを作成したら、<strong>概要</strong>セクションに表示されるアプリケーション (クライアント) ID の値をコピーします。この値をOAuth クライアントId として使用します。</li>
        <li><strong>証明書とシークレット</strong>セクションに移動して、アプリケーションの<strong>新しいクライアント シークレット</strong>を選択します。</li>
        <li>有効期間を指定してクライアントシークレットを保存します。保存するとキーの値が表示されます。</li>
        <li>値は一度しか表示されないので、コピーしておきます。この値をOAuth クライアントシークレットとして使用します。</li>
        <li><strong>認証</strong>タブで、必ず<strong>アクセストークン (暗黙的なフローに使用)</strong> を選択します。</li>
      </ol>
    </>;
};

export const CommonAuthSchemeAzuread = ({siteName = "CData Sync"}) => {
  return <>
      <p>
        Azure Active Directory（AD）ユーザーアカウントで接続するには、<strong>Auth Scheme</strong> で<strong>AzureAD</strong> を選択します。{siteName} は、接続するための組み込みOAuth アプリケーションを提供するため、追加のプロパティは必要ありません。
      </p>
    </>;
};

export const CommonDatasourceMoreInformation = ({datasource = "the data source", advancedurl = "", siteName = "CData Sync", driverVersion = ""}) => {
  return <>
      <p>
        {siteName} と{datasource} の連携について、詳しくは{' '}
        <a href={`https://cdn.cdata.com/help/${advancedurl}${driverVersion}/jp/synch/default.htm`}>
          {datasource} Connector for {siteName}
        </a> を参照してください。
      </p>
    </>;
};

export const CommonDatasourceAddConnector = ({datasource = "the data source", title = "the connector", destination = false, siteNameShort = "Sync"}) => {
  return <>
      <p>
        {siteNameShort} で{datasource} のデータを使用できるようにするには、まず以下の手順でコネクタを追加する必要があります：
      </p>
      <ol>
        <li>{siteNameShort} のダッシュボードから<strong>接続</strong>ページを開きます。</li>
        <li><strong>接続を追加</strong>をクリックして<strong>コネクタを選択</strong>ページを開きます。</li>
        <li>
          <strong>{destination ? "同期先" : "データソース"}</strong>タブをクリックして
          <strong>{title}</strong> 行に移動します。
        </li>
        <li>
          行末にある<strong>接続を設定</strong>アイコンをクリックして、<strong>新しい接続</strong>ページを開きます。この操作により、{' '}
          <strong>接続を追加</strong>ダイアログボックスが開きます。
          <br />
          <strong>Note：</strong> <strong>接続を設定</strong>アイコンが表示されない場合は、<strong>コネクタをダウンロード</strong>アイコンをクリックして {title} コネクタをインストールしてください。
        </li>
        <li><strong>接続を追加</strong>ダイアログボックスに接続名を入力します。</li>
        <li><strong>追加</strong>をクリックして、コネクタの<strong>設定</strong>タブを開きます。</li>
      </ol>
      <p>
        新しいコネクタのインストールについての詳細は、{' '}
        <a href="../connections">接続</a>を参照してください。
      </p>
    </>;
};

export const CommonDatasourceIntroSource = ({datasource = "the data source", siteName = "CData Sync"}) => {
  return <p>
      {siteName} アプリケーションから{datasource} コネクタを使用して、{datasource} からデータを取得してサポートされている任意の同期先に移動できます。これを行うには、コネクタを追加し、コネクタへの認証を行い、接続を完了する必要があります。
    </p>;
};

export const driverVersion = "M";

export const siteNameShort = "Sync";

export const siteName = "CData Sync";

export const datasource = "Azure Cosmos DB";
export const pageTitle = "Azure Cosmos DB";
export const advancedurl = "EH";
export const oauthschemes = "AzureAD";

<CommonDatasourceIntroSource datasource={datasource} siteName={siteName} />

## Azure Cosmos DB コネクタを追加

<CommonDatasourceAddConnector datasource={datasource} title={pageTitle} destination={false} siteNameShort={siteNameShort} />

## 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 <a href="https://learn.microsoft.com/en-us/azure/cosmos-db/how-to-setup-rbac" target="_blank" rel="noopener noreferrer">Configure role-based access control with Microsoft Entra ID for your Cosmos DB account</a>.

## Azure Cosmos DB への認証

After you add the connector, you need to set the required properties.

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

{siteName} supports authenticating to {pageTitle} in several ways. Select your authentication method below to proceed to the relevant section that contains the authentication details.

* [**AccountKey**](#account-key) (default)
* [**AzureAD**](#azure-active-directory)
* [**AzureServicePrincipal**](#azure-service-principal)
* [**AzureServicePrincipalCert**](#azure-service-principal-certificate)

### Account Key

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

* **Auth Scheme:** Select **AccountKey**.
* (Default) **Account Key:** 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

<CommonAuthSchemeAzuread siteName={siteName} siteNameShort={siteNameShort} datasource={datasource} />

### Azure Service Principal

<CommonAuthSchemeAzureserviceprincipal siteName={siteName} siteNameShort={siteNameShort} datasource={datasource} />

### Azure Service Principal Certificate

<CommonAuthSchemeAzureserviceprincipalcert siteName={siteName} siteNameShort={siteNameShort} datasource={datasource} />

## 接続を完了する

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. Define advanced connection settings on the **Advanced** tab. (In most cases, though, you should not need these settings.)
3. {oauthschemes ? `If you authenticate with ${oauthschemes}, click` : "Click"} **Connect to {datasource}** to connect to your {pageTitle} account.
4. Click **Create & Test** to create your connection.

## 詳細について

<CommonDatasourceMoreInformation datasource={datasource} advancedurl={advancedurl} siteName={siteName} driverVersion={driverVersion} />
