> For the complete documentation index, see [llms.txt](https://docs.gospace.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gospace.com/integrations/connecting-an-integration/microsoft-entra-id-directory.md).

# Microsoft Entra ID (directory)

Sync people and teams from Microsoft Entra ID into gospace AI.

Connect your Microsoft Entra ID (formerly Azure Active Directory) tenant so gospace AI can import your people and teams and keep them up to date, with no manual uploads.

### Before you start

* You need a **gospace AI** account with permission to manage integrations.
* You need a **Microsoft Entra ID** account that can grant admin consent for your organisation, such as a Global Administrator, Privileged Role Administrator or Cloud Application Administrator.

{% hint style="info" %}
You don't need to create an app registration or copy a client ID, client secret or tenant ID. gospace AI connects through its own Microsoft app, and you approve its access during setup.
{% endhint %}

### Permissions gospace AI asks for

When you connect, an administrator grants gospace AI's Microsoft app these read-only **application** permissions for your organisation:

| Permission             | Why it's needed                            |
| ---------------------- | ------------------------------------------ |
| `User.Read.All`        | Read the people in your directory          |
| `Group.Read.All`       | Read your groups so they can become teams  |
| `GroupMember.Read.All` | Read who belongs to each group             |
| `Team.ReadBasic.All`   | Read basic details of your Microsoft Teams |

gospace AI uses these to read your directory on a schedule, without depending on any one person's account. It never writes to your directory.

### Step 1: Connect

1. In gospace AI, go to **Settings → Connectors** and select **Add connector**. You can also start from the **People** step during onboarding.
2. In the **Connector library**, choose the Microsoft **Directory** connector.
3. Under **Admin consent required**, select **Connect with Microsoft**.
4. A Microsoft window opens. Sign in with your Entra ID admin account, check the permissions listed above, and select **Accept**.
5. The window closes and you return to setup.

{% hint style="warning" %}
If nothing opens, your browser may have blocked the pop-up. Allow pop-ups for gospace AI and try again.
{% endhint %}

### Step 2: Map your people and teams

Once you've connected, the **Mappings** step shows the fields read from your directory. Choose which field fills each gospace AI field.

**People**

| gospace AI field        | What it's used for                                                                                                        |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| **External identifier** | The stable ID that links each person to their directory record. Choose a field that never changes, such as the object ID. |
| **Email**               | The person's email address                                                                                                |
| **First name**          | The person's first name                                                                                                   |
| **Last name**           | The person's last name                                                                                                    |

**Teams**

Under **Team source**, choose where team membership comes from:

* **Groups**: each Entra ID group becomes a team, and its members become the team's members.
* **Users**: the team comes from a field on each person, such as their department.

Then choose the fields for **Team id** and **Team name**.

Select **Save mappings** to finish.

{% hint style="info" %}
We recommend mapping teams. Without them, people are imported but not grouped, and you'll have to assign teams yourself.
{% endhint %}

### Step 3: Sync

Open the connector from **Settings → Connectors** to manage it:

* **Run import** pulls your directory now.
* **Automatic sync** sets how often gospace AI pulls changes.

The connector keeps a history of its runs, so you can check when it last synced and whether it worked.

### Troubleshooting

**"Not connected — people and groups cannot be read":** gospace AI doesn't have a Microsoft consent that covers the permissions above. This can happen if consent was revoked or we've added a new permission since you connected. Select **Reconnect** and accept the permissions again.

**"No consent to read your directory" on the Mappings step:** Same cause: connect again and accept the directory permissions. The fields will then appear.

**People or teams are missing after a sync:** Check your mappings, especially **Team source** and the **External identifier**. If the problem continues, contact gospace support.

### Next steps:

{% content-ref url="/pages/lG9Yu9yv5tiXxXBWOAy1" %}
[Map your directory](/integrations/mapping-your-data/map-your-directory.md)
{% endcontent-ref %}


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gospace.com/integrations/connecting-an-integration/microsoft-entra-id-directory.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
