> ## Documentation Index
> Fetch the complete documentation index at: https://docs.iru.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Azure Monitor

> Connect Azure Monitor to Iru Compliance for diagnostic settings, activity logs, alerts, and Log Analytics workspace configuration via OAuth.

### About Microsoft Azure Monitor

The **Microsoft Azure Monitor** source pulls **diagnostic settings**, **subscription activity logs**, **metric and log alert rule** configuration, and **Log Analytics workspace** settings from the connected subscription. Data is read through **Azure Resource Manager** with **delegated OAuth** as the signing-in user. Iru does **not** create or change diagnostic settings, alert rules, or workspaces.

**Activity log** visibility follows Azure’s default retention (**about 90 days** at the subscription). Iru reads what Azure exposes for that window. For longer retention, export activity logs to a **Log Analytics** workspace or **storage** in Azure.

### How It Works

Iru uses Microsoft’s **OAuth 2.0 authorization code flow** against **Azure Resource Manager**. The requested scope is:

`https://management.azure.com/user_impersonation`

| Detail             | Value                                                  |
| ------------------ | ------------------------------------------------------ |
| **Category**       | Developer tools                                        |
| **Authentication** | OAuth 2.0 (Microsoft Entra ID, Azure Resource Manager) |
| **Vendor plan**    | Any Azure subscription                                 |

#### What Iru collects

| Data type                | Notes                                                                               |
| ------------------------ | ----------------------------------------------------------------------------------- |
| Diagnostic settings      | Log categories, retention, destinations (storage, event hub, Log Analytics)         |
| Activity logs            | Subscription-level audit events (create, delete, policy, role changes, and similar) |
| Metric alert rules       | Definitions, thresholds, evaluation frequency                                       |
| Log alert rules          | Scheduled query rules and activity log alert configuration                          |
| Log Analytics workspaces | Workspace configuration and data retention settings                                 |

Official references: [Azure Monitor documentation](https://learn.microsoft.com/azure/azure-monitor/), [Diagnostic settings](https://learn.microsoft.com/azure/azure-monitor/essentials/diagnostic-settings), [Activity log](https://learn.microsoft.com/azure/azure-monitor/essentials/activity-log), [Roles and permissions](https://learn.microsoft.com/azure/azure-monitor/fundamentals/roles-permissions-security), [Diagnostic settings REST API](https://learn.microsoft.com/rest/api/monitor/diagnostic-settings).

### Prerequisites

* **Microsoft Entra ID** sign-in to the [Azure portal](https://portal.azure.com).
* The built-in **Monitoring Reader** role at **subscription** scope (or **Reader**, which includes the needed read paths). **Monitoring Reader** grants `Microsoft.Insights/*/read` for diagnostic settings, alert rules, and activity log access **without** write permissions.
* Browser **pop-ups** allowed so the connector wizard can open when you enable the source.

Confirm access: **Subscriptions** → your subscription → **Access control (IAM)** → **View my access**.

Example role assignment (replace placeholders):

```bash theme={null}
az role assignment create \
  --assignee <your-user-principal-name> \
  --role "Monitoring Reader" \
  --scope /subscriptions/<subscription-id>
```

### Connect Microsoft Azure Monitor to Iru

Use **Microsoft Azure** first to confirm portal access and **Monitoring Reader** (or **Reader**) coverage, then complete OAuth in **Iru Compliance**. The wizard shows **Step 1 of 1: Perform OAuth Authentication**.

<Tabs>
  <Tab title="Microsoft Azure">
    <Note>
      Complete this tab before you start OAuth in **Iru Compliance**.
    </Note>

    <Steps>
      <Step title="Sign in to the Azure portal">
        Open [portal.azure.com](https://portal.azure.com) and sign in with the account you will use in the Iru wizard.
      </Step>

      <Step title="Open your target subscription">
        Search for **Subscriptions**, then open the subscription whose **Monitor** diagnostics and metrics Iru should read.
      </Step>

      <Step title="Verify Monitoring Reader or Reader access">
        Open **Access control (IAM)** → **View my access**. Confirm **Monitoring Reader** or subscription **Reader**, per **Prerequisites**.
      </Step>

      <Step title="Allow pop-ups in your browser">
        Allow **pop-ups** for your **Iru** hostname so the Microsoft consent window can open.
      </Step>

      <Step title="Plan for the right Entra tenant">
        If you use multiple tenants, use a clean browser session so OAuth signs in to the tenant that owns the subscription.
      </Step>
    </Steps>

    <Note>
      Continue on the [**Iru Compliance**](#iru-compliance) tab.
    </Note>
  </Tab>

  <Tab title="Iru Compliance">
    <Note>
      Finish the [**Microsoft Azure**](#microsoft-azure) tab first.
    </Note>

    <Steps>
      <Step title="Open Sources">
        In Iru Compliance, on the left navigation bar, expand **Compliance** and select **Sources**.

        <Frame>
          <img src="https://mintcdn.com/iru/7HsGH7lnQ8GpVmI0/assets/media/images/iru-navigation-compliance-sources.png?fit=max&auto=format&n=7HsGH7lnQ8GpVmI0&q=85&s=595982441fd777b333b3ecfea24adc24" alt="Left navigation: Compliance expanded, Sources selected" width="424" height="1056" data-path="assets/media/images/iru-navigation-compliance-sources.png" />
        </Frame>
      </Step>

      <Step title="Turn on the integration">
        Find **Microsoft Azure Monitor** (set **Category** to **Developer tools** or use **Search by name or description**). On that card, turn on the **toggle** to start the connector wizard.
      </Step>

      <Step title="Launch OAuth and sign in">
        Select **Launch OAuth Authentication**. When the Microsoft window opens, sign in with the same account you verified in the Azure portal and click **Accept** on the consent screen.
      </Step>

      <Step title="Finish the connection">
        When the OAuth window closes and Iru finishes the exchange, the wizard shows **Connection Configured**.
      </Step>

      <Step title="Confirm the source is Active">
        Close the **Iru is requesting access to external services** browser tab, then return to **Compliance** → **Sources** and confirm the **Microsoft Azure Monitor** card is **Active**.
      </Step>
    </Steps>
  </Tab>
</Tabs>

### Troubleshooting

<AccordionGroup>
  <Accordion title="Nothing opens when you turn the source on">
    Check **pop-up blocker** settings for the Iru site and try again.
  </Accordion>

  <Accordion title="Missing or incomplete diagnostic settings">
    The signed-in account may lack **Monitoring Reader** (or **Reader**) at **subscription** scope. Verify **IAM** (see **Prerequisites**).
  </Accordion>

  <Accordion title="Activity log looks short">
    Azure retains subscription **activity logs** for about **90 days** by default. Iru reflects what is available in that window unless you have extended retention via export to Log Analytics or storage.
  </Accordion>

  <Accordion title="Wrong Microsoft Entra tenant">
    Sign **out** of the Microsoft pop-up and sign in with the account for the **correct** tenant.
  </Accordion>

  <Accordion title="Broken status">
    Turn **Microsoft Azure Monitor** **off** and **on** in **Sources**, then complete OAuth again.
  </Accordion>
</AccordionGroup>

### Related Articles

<CardGroup cols={2}>
  <Card title="Sources Management" icon="plug" href="/en/compliance/sources-management">
    Browse and manage every Compliance source.
  </Card>

  <Card title="Getting Started With Compliance" icon="rocket" href="/en/compliance/getting-started-with-compliance">
    Frameworks, actions, and **Artifacts**.
  </Card>

  <Card title="Iru Overview" icon="layer-group" href="/en/iru/platform-overview/iru-overview">
    How Endpoint, Compliance, and Identity fit together.
  </Card>

  <Card title="Artifacts Management" icon="folder-open" href="/en/compliance/artifacts-management">
    Upload, review, and organize evidence from sources and actions.
  </Card>
</CardGroup>
