> 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/rogu/log-analytics.md).

# Azure Log Analytics Workspace への接続

## 概要

RealmJoin Portal では、次のような Windows 更新プログラムの潜在的な問題を表示できます [Windows Update SafeGuard の保留](https://docs.microsoft.com/en-us/windows/deployment/update/safeguard-holds) と統合することで [Windows Update for Business Reports](https://learn.microsoft.com/en-us/windows/deployment/update/wufb-reports-overview).

また、RealmJoin Portal は、監査ログ情報を保存し、Azure Automation の既定の制限（現在は 30 日）を超えた Runbook 実行データをアーカイブするために Log Analytics を使用します。

## コンポーネント

### Azure アプリ登録

RealmJoin は、2 つの Log Analytics ワークスペースの両方と、次の方法で連携します [Entra ID のアプリケーション登録](https://docs.microsoft.com/en-us/azure/active-directory/develop/app-objects-and-service-principals).

{% hint style="info" %}
"RealmJoin Runbook Management" というアプリ登録を再利用できます。これは、次のときに作成されます [オンボーディング runbook](/ja/zi-dong-hua/connecting-azure-automation.md).
{% endhint %}

このアプリは ClientId と ClientSecret を使用して認証されます。証明書またはマネージド ID の使用は現在サポートされていません。

アプリに「**Monitoring Reader**」権限を、次の用途で使用する Log Analytics アカウントに付与してください [Windows Update for Business Reports の統合](#windows-update-for-business-reports-integration) および「**Monitoring Contributor**」権限を [RealmJoin 監査ログ](#realmjoin-audit-logs) Log Analytics アカウント。

RealmJoin は、次も使用します [Customer Workspace Key](#customer-workspace-key) データを直接次に書き込むために [RealmJoin 監査ログ](#realmjoin-audit-logs).

### Windows Update for Business Reports の統合

[Windows Update for Business Reports](https://learn.microsoft.com/en-us/windows/deployment/update/wufb-reports-overview) この機能を利用するには、環境で構成する必要があります。更新関連のイベントを次の場所に書き込みます [Azure Log Analytics Workspace](https://docs.microsoft.com/en-us/azure/azure-monitor/logs/log-analytics-overview)。RealmJoin はこの Log Analytics Workspace からイベントを読み取り、次に表示できます[ デバイスの詳細ページ](/ja/ugd-management/user-list/device-details.md).

{% hint style="info" %}
同じ Log Analytics アカウントを両方に使用できます [Windows Update for Business Reports](https://learn.microsoft.com/en-us/windows/deployment/update/wufb-reports-overview) および [RealmJoin 監査ログ](#realmjoin-audit-logs)。この場合は「**Monitoring Contributor**」権限を割り当ててください。
{% endhint %}

### RealmJoin 監査ログ

RealmJoin は、Runbook ログを Azure Automation の最大保持期間（現在は 30 日）後にアーカイブするだけでなく、独自の監査ログを保存するためにも Log Analytics Workspace を使用できます。

ログを 30 日を超えて保存するには、次を変更する必要があることに注意してください [ワークスペースの既定のデータ保持期間](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/data-retention-archive?tabs=portal-1%2Cportal-2)。これも既定では 30 日に設定されています。

## セットアップ

### パート 1 - Azure アプリ登録を使用した認証

1. Azure Portal で、Microsoft Entra ID > 管理 > アプリ登録 に移動します。
2. ［すべてのアプリケーション］タブを選択します。
3. 次の手順を選択してください。

{% tabs %}
{% tab title="既存の Runbook 統合" %}
すでに [Azure Runbooks と統合している場合は](/ja/zi-dong-hua/connecting-azure-automation.md)、既存のアプリ登録を再利用できます。

1. "RealmJoin Runbooks Management" アプリ登録を選択します。
2. 管理 > 証明書とシークレット に移動します。
3. ［クライアント シークレット］タブを選択します。
4. 新しいクライアント シークレットを作成します。
   * 説明と有効期限は、社内の命名規則とセキュリティ ポリシーに従って設定してください。
     {% endtab %}

{% tab title="新しいアプリ登録" %}
runbook を統合していない場合、または別のアプリ登録を使用したい場合は、次の手順を実行します:

1. ［新規登録］を選択します

2. 名前を指定します<br>

   <figure><img src="/files/56a29bdd57476858a005967b90471aaf5bf12135" alt=""><figcaption></figcaption></figure>

3. アプリケーションを登録します

4. アプリケーションを選択します

5. 管理 > 証明書とシークレット に移動します

6. ［クライアント シークレット］タブを選択します

7. 新しいクライアント シークレットを作成します
   * 説明と有効期限は、社内の命名規則とセキュリティ ポリシーに従って設定します
     {% endtab %}
     {% endtabs %}

8. で使用するために、シークレット値を安全に控えておきます [パート 5](#part-4-connecting-realmjoin-and-azure-log-analytics-workspace).

{% hint style="warning" %}
証明書とシークレットのページから移動すると、Azure によってシークレットが難読化されます。シークレットは取得できなくなり、新しいシークレットを作成する必要があります。
{% endhint %}

### パート 2 - Log Analytics Workspace の作成

1. Azure Portal で、Log Analytics Workspace に移動します
2. ［作成］を選択します
3. 必要に応じて、リソース グループ、名前、リージョンを指定します
4. ［概要］タブに移動します
5. 次の項目を確認してください [パート 5](#part-5-connecting-realmjoin-and-azure-log-analytics-workspace)
   1. リソース グループ名
   2. ワークスペース名
   3. ワークスペース ID

### パート 3 - Windows Update for Business Reports の有効化

1. Azure Portal で、Monitor > Workbooks に移動します
2. "Windows Update for Business reports" を検索します<br>

   <figure><img src="/files/8e6d48616a000a3b0e59a79fc4e4b33965966d72" alt=""><figcaption></figcaption></figure>
3. サブスクリプションと、以前に作成したワークスペースを設定します。RealmJoin のログと Windows Update for Business reports に別のワークスペースを使用したい場合は、別のワークスペースを作成してリンクしてください。\
   ![](/files/35680c02dbdb4bee5d67e0de5ea1198d92709e28)
4. 設定を保存します

{% hint style="warning" %}
Windows Update for Business reports の適用には最大 24 時間かかる場合があります
{% endhint %}

### パート 4 - Azure の権限

1. Log Analytics Workspace が存在するサブスクリプションに移動します
2. アクセス制御 (IAM) を選択します
3. ロールの割り当てを追加します
4. アプリ登録に Monitoring Contributor 権限を付与します<br>

   <figure><img src="/files/b5bb0e4cb8e82c49167344daedc98c8336957ef4" alt=""><figcaption></figcaption></figure>
5. ロールの割り当てを確認して保存します

### パート 5 - RealmJoin と Azure Log Analytics Workspace の接続

<figure><img src="/files/27b71f77fdaf3055fd695a164bd0d077037c7baa" alt=""><figcaption><p>Log Analytics 設定ページ</p></figcaption></figure>

1. RealmJoin Portal で、設定 に移動します ![](/files/41ac01ba4c11902c8943570dbe46e98060045269) > Log Analytics
2. 次の項目を入力してください:\
   Tenant の詳細

   * **TenantId:** Entra ID のテナント ID を指定してください。これは Entra ID の概要ページで確認できます<br>

     <figure><img src="/files/4cc7fa0a8bb123a13ac7e3928f053a924d92db83" alt=""><figcaption></figcaption></figure>

   Azure アプリ登録の詳細

   * **ClientId:** RealmJoin は、LogAnalytics ワークスペースと、次の経由で連携します [Azure アプリ登録](#azure-app-registration)。RealmJoin が認証できるように、アプリの ClientId/AppId と Secret を指定してください。<br>

     <figure><img src="/files/9976b74d7fa5bd2d7b6c06d4f66f0ae182ff924e" alt=""><figcaption></figcaption></figure>
   * **ClientSecret:** ClientId と組み合わせて RealmJoin へのアクセスを提供するために使用します。これは、次の手順で作成したシークレットです [パート 1](#part-1-authentication-using-azure-app-registration).<br>

     <figure><img src="/files/d532d37133c40feabae380167acbfd3772fd487f" alt=""><figcaption></figcaption></figure>

   Windows Update for Business ワークスペースの詳細

   * **Update Compliance Workspace Id:** 次を指定してください [Windows Update for Business Reports](#windows-update-for-business-reports-integration) データを収集する Log Analytics Workspace の ID。

   ワークスペースの詳細

   * **Subscription ID:** 次の場所から Subscription ID を指定してください [RealmJoin 監査ログ](#realmjoin-audit-logs) Log Analytics アカウント。サブスクリプション ID は Subscription の概要ページで確認できます。
   * **リソース グループ**：次の場所からリソース グループ名を指定してください [RealmJoin 監査ログ](#realmjoin-audit-logs) Log Analytics アカウント。
   * **ワークスペース名:** 次の場所からワークスペース名を指定してください [RealmJoin 監査ログ](#realmjoin-audit-logs) Log Analytics アカウント。
   * **Customer Workspace Id:** RealmJoin の監査ログと runbook ログ データを保存するための Log Analytics Workspace を指定または作成してください [RealmJoin の監査ログおよび runbook ログ データ](#realmjoin-audit-logs).<br>

     <figure><img src="/files/e428af2c9be47102b1b6885a5297a25b52b9f947" alt=""><figcaption></figcaption></figure>
   * **Customer Workspace Key:** RealmJoin は Log Analytics のエージェントとして動作します。ワークスペースへのデータ書き込みを許可するため、このワークスペースの「Primary Key」を指定してください。
     * 「Primary Key」は、次のさまざまな方法で取得できます:
       * [Azure CLI](https://learn.microsoft.com/en-us/cli/azure/monitor/log-analytics/workspace?view=azure-cli-latest#az-monitor-log-analytics-workspace-get-shared-keys):\
         `az monitor log-analytics workspace get-shared-keys --resource-group MyResourceGroup --workspace-name MyWorkspace`
       * [PowerShell](https://learn.microsoft.com/en-us/powershell/module/az.operationalinsights/get-azoperationalinsightsworkspacesharedkey?view=azps-14.6.0):\
         `Get-AzOperationalInsightsWorkspaceSharedKey -ResourceGroupName "MyResourceGroup" -Name "MyWorkspace"`
       * [RestAPI](https://learn.microsoft.com/en-us/rest/api/loganalytics/shared-keys/get-shared-keys?view=rest-loganalytics-2025-07-01\&tabs=HTTP):\
         `POST https://management.azure.com/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/sharedKeys?api-version=2025-07-01`
3. 押します **保存** すべての項目を入力した後に。すべて正常に動作していれば、システムからフィードバックが表示されます。


---

# 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:

```
GET https://docs.realmjoin.com/ja/rogu/log-analytics.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
