> For the complete documentation index, see [llms.txt](https://docs.scepman.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.scepman.com/ja/azure-gou-cheng/split-tenancy.md).

# 分割テナンシー

{% hint style="warning" %}
SCEPman Enterprise Edition のみ
{% endhint %}

## 概要 <a href="#overview" id="overview"></a>

SCEPman は、ユーザーやデバイスに証明書を発行する Azure/Intune Tenant とは別の Azure Tenant から機能するように設定できます。分割テナントと呼ばれるこの構成は、特に **MSP にとって役立ちます** 各顧客専用のバックエンドと固有の CA を維持しながら、顧客全体で Azure インフラストラクチャのコストを統合したい場合に役立ちます。

分割テナントには、 **重大な欠点**: [マネージド ID](/ja/scepman-nodepuroi/permissions/post-installation-config.md) を使用できなくなります。これは、Graph API（Azure AD および Intune）に対する認証が、アプリの登録とクライアント シークレットを使用して処理されることを意味します。クライアント シークレットは有効期限が切れるため、（MSP が）管理する必要があります。

以降では、ホスティング Tenant を **ホーム Tenant、** 顧客 Tenant を **ターゲット Tenant**と呼びます。SCEPman リソースは **ホーム Tenant**に存在し、管理対象デバイスは **ターゲット Tenant** に存在します。以下の図を参照してください。

<figure><img src="https://114237723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoGejQeUQcw7lqnQ3WX%2Fuploads%2Ft8uOQQC6iNXE2XeveTgY%2Fscepman-split-graphic.png?alt=media&amp;token=edb7ed01-20e3-4a88-9927-01275e510d01" alt=""><figcaption></figcaption></figure>

## 構成手順

1. で、 **ホーム Tenant**で、当社の [はじめにガイド](/ja/scepman-nodepuroi/deployment-guides.md).

### SCEPman（ホーム Tenant）で

2. SCEPman の **App Service** に移動し、次に「設定」-->「環境変数」に移動します。次のパラメーターを見つけて、 **削除** します。

| 環境変数                                                            |
| --------------------------------------------------------------- |
| `AppConfig:AuthConfig:ManagedIdentityEnabledForWebsiteHostname` |
| `AppConfig:AuthConfig:ManagedIdentityEnabledOnUnixTime`         |
| `AppConfig:AuthConfig:ManagedIdentityPermissionLevel`           |

3. **名前を変更** 次の設定の名前を変更します（**値は変更しないでください**):

<table><thead><tr><th width="384">元の名前</th><th>新しい名前</th></tr></thead><tbody><tr><td><code>AppConfig:AuthConfig:ApplicationId</code></td><td><code>AppConfig:AuthConfig:HomeApplicationId</code></td></tr><tr><td><code>AppConfig:AuthConfig:TenantId</code></td><td><code>AppConfig:AuthConfig:HomeTenantId</code></td></tr></tbody></table>

4. 作成 **アプリの登録** を **ターゲット Tenant** で作成します。詳細については、こちらを参照してください。 [Azure アプリの登録](/ja/scepman-nodepuroi/permissions/azure-app-registration.md)。これにより、 **アプリの登録** SCEPman が Azure AD および Intune ディレクトリにアクセスできるようになります。 **ターゲット Tenant**.

{% hint style="warning" %}
この **クライアント シークレット** の一部として生成された **アプリの登録** には有効期限があり、期限切れになる前に更新する必要があります。更新のリマインダーを設定してください。
{% endhint %}

**作成** アプリの登録の作成時にまだ実行していない場合は、次の新しい環境変数を作成します。

<table><thead><tr><th width="395">名前</th><th>値</th></tr></thead><tbody><tr><td><code>AppConfig:AuthConfig:ApplicationId</code></td><td>の GUID <strong>アプリの登録</strong> 先ほど作成した <strong>（ターゲット Tenant）。</strong></td></tr><tr><td><code>AppConfig:AuthConfig:TenantId</code></td><td>の Tenant ID <strong>ターゲット Tenant</strong>.</td></tr><tr><td><code>AppConfig:AuthConfig:ApplicationKey</code></td><td><strong>値</strong> の <strong>クライアント シークレット</strong> の一部として作成された <strong>アプリの登録</strong> を <strong>ターゲット Tenant</strong>.</td></tr></tbody></table>

5. 変更を適用します。
6. SCEPman を再起動します **App Service**.

### Certificate Master

7. Certificate Master の **App Service** に移動し、次に「設定」>「環境変数」に移動します。
8. これで、2 つの選択肢があります。
   1. 自分の **ホーム Tenant** のユーザー（たとえばターゲット Tenant からホーム Tenant にいるゲスト ユーザーを含む）に Certificate Master へのログインと証明書の発行を許可する場合。

<figure><img src="https://114237723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoGejQeUQcw7lqnQ3WX%2Fuploads%2FXqlVQSz8vRMLpm9ijTb3%2Fscepman-split-graphic2.png?alt=media&amp;token=18945a73-dc3b-416e-85da-a4f8cf267c61" alt=""><figcaption><p>オプション 1: ホーム Tenant のユーザーが Certificate Master にログインする</p></figcaption></figure>

その場合は、 **名前を変更** 次の設定の名前を変更します（**値は変更しないでください**):

<table><thead><tr><th width="385">元の名前</th><th>新しい名前</th></tr></thead><tbody><tr><td><code>AppConfig:AuthConfig:TenantId</code></td><td><code>AppConfig:AuthConfig:HomeTenantId</code></td></tr><tr><td><code>AppConfig:AuthConfig:ApplicationId</code></td><td><code>AppConfig:AuthConfig:HomeApplicationId</code></td></tr></tbody></table>

b. 自分の **ターゲット Tenant** のユーザー（たとえばホーム Tenant からターゲット Tenant にいるゲスト ユーザーを含む）に Certificate Master へのログインと証明書の発行を許可する場合。

<figure><img src="https://114237723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoGejQeUQcw7lqnQ3WX%2Fuploads%2FOKLaoNuGHkWV7zvScKvi%2Fscepman-split-graphic3.png?alt=media&amp;token=ed862008-d054-4a16-8912-07d578bc582c" alt=""><figcaption><p>オプション 2: ターゲット Tenant のユーザーが Certificate Master にログインする</p></figcaption></figure>

その場合は、次の操作を実行します。

* を開きます **PowerShell** または **Azure Cloud Shell** で **ターゲット Tenant** 次のコマンドを実行します。

```
Install-Module SCEPman -Scope CurrentUser -Force
Register-SCEPmanCertMaster -CertMasterBaseURL <url>
```

置き換え `<url>` をご自身の Certificate Master URL に置き換えます

* この **CMDlet** は、 **Application Id** と **Tenant Id** （ **ターゲット Tenant**のもの）を出力します。これら 2 つの値を
  * `AppConfig:AuthConfig:HomeApplicationId` および
  * `AppConfig:AuthConfig:HomeTenantId` として Certificate Master の設定に入力します。
* 次に、 **作成** SCEPman と同じ値を使用して、既存のものを上書きする可能性がある次の新しいアプリケーション設定を作成します。

<table><thead><tr><th width="393">名前</th><th>値</th></tr></thead><tbody><tr><td><code>AppConfig:AuthConfig:ApplicationId</code></td><td>の GUID <strong>アプリの登録</strong> 先ほど作成されたもの。</td></tr><tr><td><code>AppConfig:AuthConfig:TenantId</code></td><td>の Tenant ID <strong>ターゲット Tenant</strong>.</td></tr><tr><td><code>AppConfig:AuthConfig:ApplicationKey</code></td><td><strong>値</strong> の <strong>クライアント シークレット</strong> の一部として作成された <strong>アプリの登録</strong> 先ほど作成したものです。<br>必要に応じて、Certificate Master 用に別の新しいクライアント シークレットを作成できます。</td></tr></tbody></table>

9. 変更を保存
10. SCEPman Certificate Master を再起動します **App Service**.
11. を通じて証明書を要求する権限を付与します **Certificate Master** Web アプリ。詳細については、 [こちら](/ja/scepman-nodepuroi/permissions/post-installation-config.md#granting-the-rights-to-request-certificates-via-the-certificate-master-website).

概要として、 **Certificate Master** で使用されるアカウントとその用途は以下のとおりです。

| アカウント                                  | 用途                                                                                                                     | 注記                                                            |
| -------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| マネージド ID                               | <ul><li>SCEPman に送信された CSR を承認する</li><li>Storage Account へのアクセス</li></ul>                                              | 該当なし                                                          |
| アプリ ID を使用したアプリの登録 `ApplicationId`     | Certificate Master はこのコンテキストで Microsoft Graph にアクセスし、Intune 経由で登録された証明書を確認します                                          | もし `ApplicationKey` が存在しない場合は、代わりにマネージド ID が使用されます。           |
| アプリ ID を使用したアプリの登録 `HomeApplicationId` | ユーザーが認証される **対象** このアプリケーションです。Certificate Master にアクセスするユーザーが存在する Tenant 内にある必要があります（ただし、他の Tenant のゲスト ユーザーも承認できます）。 | もし `HomeApplicationId` が存在しない場合、 `ApplicationId` が代わりに使用されます。 |

これで分割テナントの構成は完了です。MDM に基づいて SCEP プロファイルを構成できます。

## 複数のターゲット Tenant を使用する場合の考慮事項

異なるターゲット Tenant に証明書を発行する複数の SCEPman インスタンスが必要な場合は、これらのインスタンスを相互に分離するために追加の構成手順を実行する必要があります。

考えられる構成としては、すべての SCEPman App Service のコンピューティング リソースを提供する単一の App Service Plan を保持する管理リソース グループを含めることができます。複数の Tenant に対してこれを行う際には、次の点を考慮する必要があります。

* 各インスタンスには、区別するために独自のリソース グループを割り当てる必要があります
* アクセス許可を分離するため、各インスタンス用にアプリの登録を作成する必要があります
* App Service Plan は複数のインスタンスにサービスを提供するため、独立した管理リソース グループ内に作成する必要があります

この図では、管理 Tenant とその 2 つの SCEPman インスタンスが Contoso および Tailwind の Tenant に証明書を提供します。

```mermaid
graph LR
  subgraph t0[管理 Tenant]
  subgraph rg0[rg-scepman-mgmt]
    asp[asp-scepman-mgmt]
  end

  subgraph rg1[rg-scepman-contoso]
    app1[app-scepman-contoso]
    appreg1[scepman-api-contoso]
  end

  subgraph rg2[rg-scepman-tailwind]
    app2[app-scepman-tailwind]
    appreg2[scepman-api-tailwind]
  end
  end

  subgraph t1[Contoso Tenant]
    i1[Intune]
    e1[Entra ID]
  end

  subgraph t2[Tailwind Tenant]
    i2[Intune]
    e2[Entra ID]
  end

  classDef rg stroke:#6dc3d1, fill:#d5ecf2
  classDef asp stroke:#2962FF, fill:#e0e7ff
  classDef app stroke:#fcd116, fill:#FFF8D8
  classDef appreg stroke:#6DD185, fill:#ddffd8
  classDef tenant stroke:#4d93c0, fill:#d0e2f0
  classDef entra color:#ffffff, stroke:#0b58a4, fill:#0078d6
  classDef intune stroke:#2ebddd, fill:#d9f4fa

  class rg0,rg1,rg2 rg
  class asp asp
  class app1,app2 app
  class appreg1,appreg2 appreg
  class t0,t1,t2 tenant
  class e1,e2 entra
  class i1,i2 intune

  asp --サービス提供--> app1
  asp --サービス提供--> app2

  app1 --> appreg1
  appreg1 -- データを読み取る--> i1
  appreg1 -- データを読み取る--> e1
  i1 --証明書を要求する--> app1

  app2 --> appreg2
  appreg2 --データを読み取る--> i2
  appreg2 --データを読み取る--> e2
  i2 --証明書を要求する--> app2
```

### 既存の App Service Plan に新しい SCEPman インスタンスを追加する

を使用して新しい SCEPman インスタンスをデプロイする際、 [エンタープライズ デプロイ方法](https://docs.scepman.com/scepman-deployment/deployment-options/enterprise-deployment) このインスタンスを追加する既存の App Service Plan のリソース ID を入力することができます。

<figure><img src="https://114237723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoGejQeUQcw7lqnQ3WX%2Fuploads%2FxHUNSYYW9FleCHCmxiGB%2Fimage.png?alt=media&amp;token=dd7885b4-fe66-444a-b507-eaa0c2d0880d" alt=""><figcaption></figcaption></figure>

このリソース ID は、既存の App Service Plan のプロパティで確認できます。

<figure><img src="https://114237723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LoGejQeUQcw7lqnQ3WX%2Fuploads%2FvfeVKRZqRbm4U4BcRTCE%2Fimage.png?alt=media&amp;token=f7304314-93f5-4c50-8ae9-b8809407adeb" alt=""><figcaption></figcaption></figure>

### 顧客固有のアプリの登録を作成する

アプリのアクセス許可を分離するには、カスタム アプリの登録を指定するようにデプロイ後コマンドを調整する必要があります。

{% code overflow="wrap" %}

```powershell
Complete-SCEPmanInstallation -SCEPmanAppServiceName "app-scepman-contoso" -AzureADAppNameForSCEPman "scepman-api-contoso" -AzureADAppNameForCertMaster "certmaster-contoso" -SearchAllSubscriptions 6>&1
```

{% endcode %}

このコマンドにより、以前のインスタンスから分離された、完全に構成済みの SCEPman インスタンスが作成されます。これで、このインスタンスの分割テナントを構成できます。

顧客 Tenant からこのサービスにアクセスできるようにする場合は、Certificate Master に関する上記のセクションを必要に応じて適用できます。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.scepman.com/ja/azure-gou-cheng/split-tenancy.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
