> 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 Holds](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 は、次のアプリ登録を通じて両方の 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」というアプリ登録は、次のときに作成されるため、再利用できます。 [オンボーディング runbooks](/ja/zi-dong-hua/connecting-azure-automation.md).
{% endhint %}

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

アプリに「**Monitoring Reader**」権限を、以下で使用される Log Analytics アカウントに付与してください。 [Windows Update for Business Reports Integration](#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 Integration

[Windows Update for Business Reports](https://learn.microsoft.com/en-us/windows/deployment/update/wufb-reports-overview) この機能を利用するには、環境で構成する必要があります。更新関連のイベントを次の場所に書き込みます。 [Azure Log Analytics ワークスペース](https://docs.microsoft.com/en-us/azure/azure-monitor/logs/log-analytics-overview)。RealmJoin はこの Log Analytics ワークスペースからイベントを読み取り、次の画面に表示できます。[ デバイスの詳細ページ](/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 アプリ登録を使用した認証

1. Azure Portal で、Microsoft Entra ID > Manage > App Registrations に移動します。
2. All Applications タブを選択します。
3. 次の手順を選択してください。

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

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

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

1. 「New Registration」を選択します

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

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

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

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

5. Manage > Certificates & Secrets に移動します

6. 「Client Secrets」タブを選択します

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

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

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

### パート 2 - Log Analytics ワークスペースの作成

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

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

### パート 5 - RealmJoin と Azure Log Analytics ワークスペースの接続

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

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

   * **TenantId:** Entra ID のテナント ID を入力してください。これは Entra ID の Overview ページで確認できます。<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 ワークスペース Id:** 次を入力してください: [Windows Update for Business Reports](#windows-update-for-business-reports-integration) データを収集する元となる Log Analytics ワークスペースの ID。

   ワークスペースの詳細

   * **Subscription ID:** 次の Subscription ID を入力してください。 [RealmJoin 監査ログ](#realmjoin-audit-logs) Log Analytics アカウント。サブスクリプション ID は Subscription Overview ページで確認できます。
   * **リソース グループ**: 次の場所からリソース グループ名を入力してください。 [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.
