> 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 Client を使用して、ヘッドレス / 無人の方法でコンピューターに適用できます。

これは Azure Virtual Desktop のマルチセッション プール ホスト向けのゴールデン イメージ作成を想定しています。

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

## 権限

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

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

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

## テンプレートの管理

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

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

<figure><img src="/files/23e4b948dcdd38194e552b14cad322ac9366fb8c" alt=""><figcaption><p>テンプレート一覧</p></figcaption></figure>

2. 次を選択します <img src="/files/ea28e12fb496c33be514cfb93f7bdb2fc78cf77f" alt="" data-size="line"> アイコン (1) を選択し、意味のある名前 (2) を入力して、「保存」 (3) をクリックします。

<figure><img src="/files/527f2ac1ad2d7a060e7ee3d8fdc6dda924455fd5" alt=""><figcaption><p>テンプレートを作成</p></figcaption></figure>

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

1. 名前をクリックしてテンプレートを開きます。
2. テンプレートにパッケージを追加するには、 <img src="/files/ea28e12fb496c33be514cfb93f7bdb2fc78cf77f" alt="" data-size="line"> アイコンをクリックします。

<figure><img src="/files/6df675ef13f842b0d239c33e31b4f26a781fa52e" alt=""><figcaption><p>テンプレートにパッケージを追加する - 1</p></figcaption></figure>

3. パッケージを検索し、 ![](/files/ecd7691d721f23e66ec40811e430abaf6a3bfa6b) アイコンをクリックしてテンプレートに追加します。リストには、環境でサブスクライブしているすべての RealmJoin パッケージが表示されます。
4. 完了したら、 **閉じる** ボタンをクリックします。

<figure><img src="/files/06288b7621b095002278fb0eec6c6c4cd76f386e" alt=""><figcaption><p>テンプレートにパッケージを追加する - 2</p></figcaption></figure>

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

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

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

<figure><img src="/files/d9bec83b8a41a4b9441d47d6b418c3a84af57bc6" alt=""><figcaption><p>テンプレートからのリモート パッケージ</p></figcaption></figure>

### トークンを作成する

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

{% hint style="warning" %}
トークンの取り扱いには十分注意してください。トークンが漏えいした可能性があると思われる場合は、次の **失効** ボタンをトークンの横でクリックして無効化してください。
{% endhint %}

1. トークンを作成するには、 **トークン** タブ。
2. 次をクリックします。 <img src="/files/ea28e12fb496c33be514cfb93f7bdb2fc78cf77f" alt="" data-size="line"> アイコン (1) を選択し、意味のある名前 (2) を入力して、 **保存** (3).

<figure><img src="/files/dbe89f9221550648affd699d9425713de01f37d2" 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="/files/2d4fcb82cbcb3e680fc76c5b8f946c7ced1d476b" 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 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.realmjoin.com/ja/zhan-kai/infrastructure/avd-templates.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.
