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

# Microsoft Entra ID

> Prepare a Microsoft Entra ID directory so Arch can read its users, groups, applications and directory roles.

## Before you start

You need at least the Application Developer role in the Microsoft Entra directory you connect, to register an
application. Granting admin consent to Microsoft Graph application permissions needs at least the Privileged
Role Administrator role, so ask someone who holds it if you do not. Arch refuses credentials whose app
registration belongs to a different directory than the one you enter.

## Setup steps

1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com), browse to Entra ID, then App
   registrations, and select New registration. See
   [Register an application](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app).
2. Enter a name for the app, choose Single tenant only under Supported account types, and select Register.
3. On the app's Overview page, copy the Application (client) ID and the Directory (tenant) ID.
4. Select Certificates & secrets, then Client secrets, then New client secret. Enter a description, choose an
   expiration, and select Add. See
   [Add and manage app credentials](https://learn.microsoft.com/en-us/entra/identity-platform/how-to-add-credentials).
5. Copy the secret's Value, not its Secret ID. Microsoft never shows the value again after you leave the page.
6. Select API permissions, then Add a permission, then Microsoft Graph, then Application permissions. See
   [Configure an app to access a web API](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-configure-app-access-web-apis).
7. Select each permission listed under Permissions below, and no others, then select Add permissions.
8. Select Grant admin consent for your directory's name, then select Yes. Select Refresh, and check that
   Status shows Granted for your directory's name. See
   [Grant tenant-wide admin consent](https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/grant-admin-consent).
9. You now hold the Directory (tenant) ID, the Application (client) ID and the client secret's value to enter
   in Arch.

## Fields

| Field | What to enter |
| - | - |
| Directory (tenant) ID | The Directory (tenant) ID from the Overview page of the app registration. It is the directory Arch reads. |
| Application (client) ID | The Application (client) ID from the same Overview page. |
| Client secret | The Value of the client secret you added under Certificates & secrets. Copy the value, not the secret ID. Arch never shows it again after you save it. |

You do not enter an address. Arch always signs in to Microsoft's own sign-in and Microsoft Graph addresses.

## Permissions

Each permission is a Microsoft Graph application permission on the app registration, with admin consent
granted.

| Permission | What Arch reads with it |
| - | - |
| Organization.Read.All | The directory itself: its name, type and verified domains. Arch reads it first, to prove which directory answers. |
| User.Read.All | The directory's users. |
| Group.Read.All | The directory's groups. |
| GroupMember.Read.All | The members of each group. |
| Application.Read.All | App registrations, enterprise applications, the groups an enterprise application belongs to, and the app role assignments of each enterprise application. |
| RoleManagement.Read.Directory | Directory roles and who is assigned to them. |

To add a missing permission later, open the app registration, select API permissions, add the permission as
in Setup steps, and grant admin consent again. Then test the connection again in Arch. See
[Grant tenant-wide admin consent](https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/grant-admin-consent).

## Sign-in

Arch signs in as the app registration, exchanging the application ID and the client secret for a Microsoft
Graph token from your directory. When the sign-in works, the connection test goes on to read the directory
back from Microsoft Graph, checks that it is the directory you entered, and then reads the first page of every
collection a sync reads, one for each permission.

If the sign-in fails, check that the application ID and the client secret come from the same app registration
and that you copied the secret's value, not its ID. A client secret expires on the date you chose, at most two
years after you added it. If it expired or was deleted, add a new one under Certificates & secrets on the app
registration, in the Microsoft Entra admin center, and enter its value in Arch.

## Test answers

A passing test shows "Microsoft Entra directory" with one line for each data source, from Directory to App
role assignments, each read with its permission.

| Message | What it means and what to do |
| - | - |
| These Microsoft Entra credentials are incomplete. | A field is empty, or an ID is not in the form the Overview page shows. Enter the Directory (tenant) ID, the Application (client) ID and the client secret. |
| Microsoft would not issue a token for this application. | Microsoft did not accept the application ID or the client secret. Check the application ID on the Overview page, then add a new client secret and enter its value. |
| Microsoft refused to issue a token to this application. | Microsoft would not let the application sign in. Check that an administrator granted admin consent to its Microsoft Graph application permissions, then test the connection again. |
| Microsoft is temporarily unavailable or throttling this application. | Microsoft is down or is limiting the application's requests. Test the connection again in a few minutes. |
| Microsoft answered the sign-in request in an unexpected shape. | The Directory (tenant) ID may not name a Microsoft Entra directory. Check it on the Overview page, then test the connection again. |
| The sign-in request was redirected to another address. | Arch does not send a client secret to an address it is redirected to. Test the connection again, and contact Arch support if it keeps happening. |
| Microsoft could not be reached. | Arch could not reach Microsoft. Test the connection again in a few minutes. |
| Arch is running too many connection checks at once. | Nothing is wrong with the credentials. Test the connection again in a moment. |
| This application is not allowed to read the directory. | The application does not have Organization.Read.All. Add that permission, grant admin consent, then test the connection again. |
| Microsoft stopped accepting this application's sign-in. | Microsoft Graph refused the application's token. Add a new client secret under Certificates & secrets, enter its value, then test the connection again. |
| Microsoft Graph would not return this directory. | Microsoft Graph did not give a readable answer about the directory. Test the connection again in a few minutes. |
| The directory read was redirected to another address. | Arch does not follow a redirect on a signed-in request. Test the connection again, and contact Arch support if it keeps happening. |
| These credentials belong to a different Microsoft directory. | The app registration lives in another directory than the Directory (tenant) ID you entered. Enter the directory ID from the app registration's Overview page. To read another directory, add a second connection for it. |
| This application is missing Microsoft Graph permissions this connection needs. | Some reads were refused. The guidance names each missing permission. Add them, grant admin consent, then test the connection again. |
| Microsoft Graph did not answer for every collection this connection reads. | Some reads gave no clear answer. Test the connection again in a few minutes. |

## Limits

* Arch brings in the directory, its users, groups and direct group memberships, app registrations, enterprise
  applications with their app roles and app role assignments, and directory roles with their assignments.
* Devices, organizational contacts, sign-in activity, Conditional Access policies and role assignments that
  are only eligible through Privileged Identity Management are not brought in.
* Arch reads the data once a day by default. You can choose every hour, every 3, 6 or 12 hours, or once a day.
* Each run reads the whole directory again, so what was removed in Microsoft Entra ID leaves Arch after the
  next run.
* One connection reads one Microsoft Entra directory. A second connection to the same directory is refused.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.