> 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/torogu/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 は Log Analytics を使用して監査ログ情報を保存し、Azure Automation の既定の保持期間（現在 30 日）を超えた Runbook 実行データをアーカイブします。

## コンポーネント

### 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" %}
次のときに作成される App Registration "RealmJoin Runbook Management" を再利用できます [オンボーディング用 Runbooks](/ja/zi-dong-hua/connecting-azure-automation.md).
{% endhint %}

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

アプリに "**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 は、Log Analytics ワークスペースを使用して独自の監査ログを保存し、Azure Automation の最大保持期間（現在 30 日）を過ぎた runbook ログをアーカイブできます。

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

## セットアップ

### パート 1 - Azure App Registration を使用した認証

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

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

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

{% tab title="新しい App Registration" %}
runbooks を統合していない場合、または別の app registration を使用したい場合は、次の操作を行います:

1. ［New Registration］を選択します

2. 名前を入力します<br>

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

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

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

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

6. ［Client Secrets］タブを選択します

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. ［Overview］タブに移動します
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. App Registration に 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 App Registration の詳細

   * **ClientId:** RealmJoin は、次のものを介して Log Analytics ワークスペースと連携します [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 Workspace の詳細

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

   ワークスペースの詳細

   * **サブスクリプション ID:** 次のものからサブスクリプション ID を指定してください [RealmJoin 監査ログ](#realmjoin-audit-logs) Log Analytics アカウント。サブスクリプション ID はサブスクリプションの概要ページで確認できます。
   * **リソース グループ**：次のものからリソース グループ名を指定してください [RealmJoin 監査ログ](#realmjoin-audit-logs) Log Analytics アカウント。
   * **ワークスペース名:** 次のものからワークスペース名を指定してください [RealmJoin 監査ログ](#realmjoin-audit-logs) Log Analytics アカウント。
   * **Customer Workspace Id:** 保存するための Log Analytics ワークスペースを指定 / 作成してください [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, and the optional `goal` query parameter:

```
GET https://docs.realmjoin.com/ja/torogu/log-analytics.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.
