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

# Microsoft Azure

> Connect an Entra app with Reader and Role Based Access Control Administrator to sync the Azure RBAC roles users hold on subscriptions, resource groups and management groups, and grant and revoke them.

## After this article

You'll be able to connect Microsoft Azure to Lumos to sync the Azure RBAC roles users hold on your management groups, subscriptions and resource groups, directly or through a Microsoft Entra group, and to grant and revoke those roles. Service principals and managed identities are covered by the [Microsoft Azure (NHI)](https://docs.lumos.com/integrations/library/non-human/azure-nhi.md) integration.

## Capabilities

| Functionality | Type | Sync | Provision | Description |
| - | - | - | - | - |
| Users | Account | Yes | No | Users who hold at least one role, directly or through a group. Users disabled in Entra show as suspended |
| Subscriptions | Resource | Yes | No | Subscriptions in the connected Entra tenant that the app can read. Subscriptions delegated from other tenants through Azure Lighthouse are skipped |
| Resource Groups | Resource | Yes | No | Every resource group in those subscriptions |
| Management Groups | Resource | Yes | No | Management groups that hold a role reaching a synced subscription |
| Roles | Permission | Yes | Yes | Built-in and custom roles. Every role assignable on a subscription is listed. On resource groups and management groups, a role is listed once a user is assigned it there directly |
| Group-held Roles | Permission | Yes | No | A role held through an Entra group, listed separately for that group, for example "Owner (via Platform Admins)" |
| Tenant-root Roles | Permission | Yes | No | Roles assigned at the tenant root (`/`) that reach a synced subscription, shown on the global resource for review |

**Provisioning behavior:**

* **Grant a role:** Lumos creates a role assignment for the user on the role's scope. If the user already holds the role through an assignment made outside Lumos, nothing changes.
* **Revoke a role:** Lumos deletes the user's own assignments of the role on that scope. Access through a group stays, and you manage it in the Microsoft Entra ID integration.

Inherited roles show on the scope where they're assigned. A role assigned on a management group shows on that management group, not on each subscription under it.

The integration doesn't sync roles on individual resources such as a single VM, eligible (PIM) assignments, or service principals and managed identities. Role conditions (ABAC) are ignored, so a conditional assignment shows as held.

## Required plan and roles

* **Entra role:** at least **Application Developer** to register the app, and **Privileged Role Administrator** to grant admin consent for the Microsoft Graph application permissions.
* **Azure role:** a role that can assign roles on each subscription or management group Lumos should manage, such as **Owner**, **User Access Administrator** or **Role Based Access Control Administrator**.
* **Authentication:** a single-tenant Microsoft Entra ID app registration with a client secret, using OAuth 2.0 client credentials. Lumos gets its token for `https://management.azure.com/.default` and exchanges the same credentials for a Microsoft Graph token.
* **Microsoft Graph permissions:**

| Permission | Needed for | Purpose |
| - | - | - |
| `User.Read.All` | Read-only and provisioning | Show who holds each role |
| `GroupMember.Read.All` | Read-only and provisioning | Show the users who hold a role through a group |

* **Azure roles on the app:**

| Role | Needed for | Purpose |
| - | - | - |
| Reader | Read-only and provisioning | Read subscriptions, resource groups, role definitions and role assignments. Role Based Access Control Administrator includes these reads, but Reader is still recommended |
| Role Based Access Control Administrator | Provisioning | Grant and revoke roles on the scope it's assigned to |

## Read-only access vs provisioning

**Is read-only possible?** Yes. Assign the app Reader and skip Role Based Access Control Administrator.

**What read-only requires.** `User.Read.All` and `GroupMember.Read.All` as application permissions with admin consent, and Reader on each subscription or management group to sync. Broader Graph permissions such as `Directory.Read.All` also work.

**What full provisioning requires.** Everything above, plus Role Based Access Control Administrator on the same scopes. The role's condition decides which roles Lumos can grant and revoke.

**Watch out for.** A successful connection doesn't confirm provisioning. Lumos connects without Role Based Access Control Administrator, and Azure only checks the role's scope and condition when Lumos grants or revokes. A grant on a management group needs the role on that management group, not on the subscriptions under it. A condition that leaves out Owner and User Access Administrator stops Lumos from granting or revoking them. The Graph permissions are read-only, so Lumos never creates or changes users or groups in Entra.

## Instructions

**Phase 1: Register an app in Microsoft Entra**

1. In the [Microsoft Entra admin center](https://entra.microsoft.com), go to **Entra ID → App registrations → New registration**.
2. Name the app. Under **Supported account types**, choose **Single tenant only**, leave **Redirect URI** empty, and click **Register**.
3. From the app's **Overview**, copy the **Application (client) ID** and **Directory (tenant) ID**.
4. Go to **Certificates & secrets → Client secrets → New client secret**, pick an expiry, and copy the secret **Value**. It's shown only once. Create a new secret before this one expires, or Lumos can no longer connect.
5. Go to **API permissions → Add a permission → Microsoft Graph → Application permissions**, add `User.Read.All` and `GroupMember.Read.All`, and click **Add permissions**.
6. Click **Grant admin consent for \<your organization>**.

**Phase 2: Give the app roles in Azure**

1. In the [Azure portal](https://portal.azure.com), open a subscription (or management group) Lumos should manage.
2. Go to **Access control (IAM) → Add → Add role assignment** and choose **Reader**.
3. On the **Members** tab, keep **User, group, or service principal** selected, click **Select members**, and select the app from Phase 1.
4. Click **Review + assign**.
5. For provisioning, go to **Access control (IAM) → Add → Add role assignment** again, open the **Privileged administrator roles** tab, and select **Role Based Access Control Administrator**. Select the app on the **Members** tab.
6. On the **Conditions** tab, choose **Allow user to only assign selected roles to selected principals (fewer privileges)** and click **Select roles and principals**. Choose the **Constrain roles and principal types** template, select every role Lumos should grant and revoke, set the principal type to **Users**, and save. The template covers both assigning and removing those roles. The condition doesn't change which roles Lumos syncs.
7. Click **Review + assign**.
8. Repeat for each subscription, or assign the roles once on a management group to cover every subscription under it.

**Phase 3: Connect in Lumos**

1. Find the Microsoft Azure card in your Lumos integrations.
2. Enter the **Tenant ID**, **Client ID**, and **Client Secret**.
3. Click **Connect**.

## API Endpoints Used

> [!NOTE]
>
> The API endpoints this integration uses are available to logged-in Lumos customers. Log in to view them.

## Troubleshooting

**"This app is missing the Microsoft Graph application permissions".** Add `User.Read.All` and `GroupMember.Read.All` as application permissions under **API permissions**, then click **Grant admin consent**.

**"This app can't see any Azure subscriptions" or "can't read role assignments".** Assign the app Reader on each subscription or management group Lumos should manage. A new role assignment can take a few minutes to apply, so wait and reconnect.

**"Azure rejected this app's sign-in".** Check the Tenant ID, Client ID, and Client Secret. Make sure you copied the secret's **Value**, not its **Secret ID**, and that the secret hasn't expired.

**"Azure denied the app managing role assignments".** The app doesn't hold Role Based Access Control Administrator on the scope named in the error, or the role isn't allowed by its condition. Assign Role Based Access Control Administrator on that scope or a scope above it, and add the role to the condition. A grant on a subscription doesn't cover a management group above it.

**"Azure can't find the user yet".** A user created in Entra moments ago can take a few minutes to reach Azure. Try again shortly.

**A user still shows a role after leaving a group.** Group membership comes from Microsoft Graph, which can lag. The role clears on a later sync.

**A management group shows its ID instead of its name.** The app needs Reader on that management group to read its display name.
