> For the complete documentation index, see [llms.txt](https://docs.realmjoin.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.realmjoin.com/ja/zhan-kai/infrastructure/avd-templates.md).

# AVD テンプレート

RealmJoin AVD テンプレートは、RealmJoin Client を介してアプリケーション セットを無人で適用し、Azure Virtual Desktop ホスト用のゴールデン イメージを作成します。

## 概要

この機能を使用すると、アプリケーションのセット（いわゆるテンプレート）を定義できます。このアプリケーションセットは、RealmJoin Client を使用してヘッドレス／無人でコンピューターに適用できます。

これは、Azure Virtual Desktop のマルチセッション・プールホスト向けのゴールデンイメージを作成するためのものです。

{% hint style="info" %}
Azure Virtual Desktop (AVD) テンプレートの作成と管理は、専門知識、綿密な計画、正確な構成を要する複雑な作業です。このページで説明している RealmJoin 関連のトピックについては完全にサポートしますが、より広範な AVD テンプレート化のトピックに関する支援は限られています。これには、AVD テンプレートの作成、カスタマイズ、展開、トラブルシューティングに関する一般的なガイダンスが含まれますが、これに限定されるものではありません。
{% endhint %}

## アクセス許可

この機能を有効にするには、次を定義する必要があります。 [カスタム ロール](https://docs.realmjoin.com/ja/to/permission/custom-roles.md) そして、そのロールをグループまたはユーザーに割り当てます。

以下の定義をコピーし、GroupID を適切に変更してください。

```json
{
  "Rules": [
    {
      "Name": "管理者がテンプレート作成機能にアクセスできるようにする",
      "Groups": [
        "<管理者グループのグループ ID>"
      ],
      "Permissions": [
        "CanReadTemplateTable",
        "CanReadTemplateDetails",
        "CanEditTemplate",
        "CanDeleteTemplate",
        "CanChangeTemplatePackages",
        "CanChangeTemplateTokens"
      ]
    }
  ]
}
```

## テンプレートの管理

### テンプレートの作成

1. 「templates」アイコンをクリックするか、URL を入力して Templates セクションを開きます: <https://portal.realmjoin.com/templates>

<figure><img src="https://3438325150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FxXuRmmsPeWTAz5UJG5Mm%2Fimage.png?alt=media&amp;token=8b474fea-95ba-4b94-9b29-596d2d61192b" alt=""><figcaption><p>テンプレート一覧</p></figcaption></figure>

2. 選択してください <img src="https://3438325150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FHvBdWctDPfuVmTP12ZRK%2Fimage.png?alt=media&amp;token=d520017f-4e10-4236-87ca-809154e79403" alt="" data-size="line"> アイコン (1) をクリックし、意味のある名前 (2) を入力して「保存」(3) をクリックします。

<figure><img src="https://3438325150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FuQUkRsaiVgISctj4Zb8S%2Fimage-1.png?alt=media&amp;token=5cc20b3b-0f47-4d1b-bb7e-fb693e4f6498" alt=""><figcaption><p>テンプレートを作成</p></figcaption></figure>

### テンプレートにアプリケーションを追加

1. 名前をクリックしてテンプレートを開きます。
2. テンプレートにパッケージを追加するには、次をクリックします <img src="https://3438325150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FHvBdWctDPfuVmTP12ZRK%2Fimage.png?alt=media&amp;token=d520017f-4e10-4236-87ca-809154e79403" alt="" data-size="line"> アイコン。

<figure><img src="https://3438325150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2Fe2WNicG057XlC2Zjw2TX%2Fimage-2.png?alt=media&amp;token=dc4c9bee-a032-4c7f-831b-86f6506737d6" alt=""><figcaption><p>テンプレートにパッケージを追加 - 1</p></figcaption></figure>

3. パッケージを検索し、次を押します ![](https://3438325150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FBdRIwooSznEKFEutEiNJ%2Fimage.png?alt=media\&token=67b30b07-0391-4252-a3c9-108e425452f8) アイコンを押してテンプレートに追加します。この一覧には、環境内で購読しているすべての RealmJoin パッケージが表示されます。
4. 完了したら、次をクリックします **閉じる** ボタンをクリックします。

<figure><img src="https://3438325150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FcaiKnyWcTB03y2fsTYfw%2Fimage-3.png?alt=media&amp;token=cb1c1ddd-a678-4f92-be44-49d46fe95db2" alt=""><figcaption><p>テンプレートにパッケージを追加 - 2</p></figcaption></figure>

{% hint style="info" %}
Intune パッケージは AVD テンプレートを使用して割り当てることはできません。
{% endhint %}

### テンプレートからアプリケーションを削除

1. 名前をクリックしてテンプレートを開きます。
2. アプリケーションを削除したい場合は、次をクリックします **割り当て解除**。パッケージ レベルで設定された値を上書きする引数を定義したい場合は、次をクリックすることで実行できます **Settings**.

<figure><img src="https://3438325150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FBIajMVAI5JNGAdsznMZ9%2Fimage-4.png?alt=media&amp;token=29c19b9e-0b05-4d71-be2c-70e35750ab25" alt=""><figcaption><p>テンプレートからパッケージを削除</p></figcaption></figure>

### トークンを作成

RealmJoin Client 経由でテンプレートを使用するには、トークンも必要です。

{% hint style="warning" %}
トークンは慎重に取り扱ってください。漏えいした可能性があると思われる場合は、次を押して失効させてください **取り消す** トークンの横にあるボタン。
{% endhint %}

1. トークンを作成するには、次をクリックします **トークン** タブ。
2. 次をクリックします <img src="https://3438325150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FHvBdWctDPfuVmTP12ZRK%2Fimage.png?alt=media&amp;token=d520017f-4e10-4236-87ca-809154e79403" alt="" data-size="line"> アイコン (1) をクリックし、意味のある名前 (2) を入力してクリックします **保存** (3).

<figure><img src="https://3438325150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FgPVq1LS6wTVvp5iI2iJa%2Fimage-6.png?alt=media&amp;token=39640bf1-7dfb-4433-aa00-6b0e6e1892dd" alt=""><figcaption><p>トークンを作成</p></figcaption></figure>

## ベストプラクティス

これらの推奨事項に従うことで、AVD テンプレートの安定性を保ち、パッケージが予期せずテンプレートから削除されるのを防げます。

### アプリごとに専用のパッケージ サブスクリプションを使用する

常に次を作成してください **個別のパッケージ サブスクリプション** テンプレートに追加する各アプリケーションごとに作成し、次の名前に変更してください `AVD - [PACKAGENAME]`.

{% hint style="warning" %}
既存の（非 AVD）アプリ サブスクリプションをテンプレートで再利用しないでください。AVD テンプレートで使用されるパッケージは通常の展開とは異なる方法で処理されるため、両方でサブスクリプションを共有すると予期しない動作を引き起こす可能性があります。
{% endhint %}

### 自動化はメインチャネルでのみ有効にする

自動化を次で有効にします **メイン** チャネルのみ — 次では絶対に有効にしないでください **プレビュー** チャネル。

{% hint style="danger" %}
AVD にはプレビュー オプションはなく、サブスクリプションを次から切り替えると **プレビュー** を **メイン** は新しい **新しい** サブスクリプションを作成します。これにより既存のパッケージが削除され、再ビルドされるため、そのパッケージが属していたすべてのテンプレートから削除されます。

次から更新すると **メイン** を **メイン** 新しいサブスクリプションは作成されないため、パッケージはテンプレートに残ります。
{% endhint %}

## テンプレートの使用

### AVD / ヘッドレス プロビジョニング

展開に使用するテンプレート ID とトークンを用意します。

<figure><img src="https://3438325150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MkrcM7cKOpXKri1kVrh%2Fuploads%2FVW0SRqoDYrJkVNXMF8Co%2Fimage.png?alt=media&amp;token=56d936a7-b26e-44f0-91a0-7ffb7556ffc9" alt=""><figcaption><p>テンプレート ID とトークンを確認する</p></figcaption></figure>

ゴールデンイメージとして準備したいシステム／VM 内で、次のコマンドを実行します:

1. RealmJoin をダウンロード: `Invoke-WebRequest -Uri "https://gkrealmjoin.s3.amazonaws.com/win-release/RealmJoin.exe" -OutFile "C:\temp\RealmJoin.exe"`
2. RealmJoin をインストール: `Start-Process -FilePath "C:\temp\RealmJoin.exe" -ArgumentList "-install" -Wait`
3. ヘッドレス展開を実行します。個別のテンプレート ID とトークンを必ず入力してください: `Start-Process -FilePath "C:\Program Files\RealmJoin\RealmJoinService.exe" -ArgumentList " -avdprovision <Template ID> <Template Token>"`

### ログとトレース

RealmJoin のインストールとヘッドレス展開のどちらにも、追加引数を指定できます `-trace` ログを詳細化できます。ヘッドレス展開中の状態／ログを確認するには、realmjoin.log を開き、定期的に更新してください。これは次の場所にあります `C:\Windows\Logs\`


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.realmjoin.com/ja/zhan-kai/infrastructure/avd-templates.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
