> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/cortex-cloud-posture-management/cortex-cloud-data-sources-and-connectors/vendor-specific-data-sources/microsoft/microsoft-365-new/create-a-microsoft-entra-id.md).

# Create a Microsoft Entra ID

To integrate Microsoft 365 services with Cortex Cloud Posture Management, you must create a **Microsoft Entra ID service principal** (formerly Azure AD). The service principal requires specific Microsoft Graph API permissions based on the capabilities you plan to enable.

### Prerequisites

* **Global Administrator** access to the Microsoft Entra admin center or Azure portal.
* Access to the Microsoft 365 tenant that you want to onboard.

#### Task 1. Create a Service Principal

1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com/) or the [Azure portal](https://portal.azure.com/) as a **Global Administrator**.
2. Navigate to **App registrations** > **New registration**.
3. Enter a descriptive name for the application, such as `Cortex-Cloud-Integration`.
4. For **Supported account types** drop down, select **Single Tenant Only \[Your Organisation].**
5. Click **Register**.
6. On the **Overview** page, note the following values:
   * **Application (client) ID**
   * **Directory (tenant) ID**
7. Navigate to **Certificates & secrets** > **New client secret**.
8. Create a client secret.
9. Copy the **Secret Value** and store it.

#### Task 2. Configure API Permissions

Add the required **Microsoft Graph** application permissions based on the Cortex Cloud capabilities you plan to enable.

To add a permission:

1. In the application registration, go to **API permissions**.
2. Click **Add a permission**.
3. Select **Microsoft Graph**.
4. Select **Application permissions**.
5. Search for and select the required permissions listed in the following sections. Click on **Add permissions** once all the required permissions are added to the list.

<details>

<summary>Microsoft 365 Data Security</summary>

These permissions are required to scan files for sensitive content across SharePoint and OneDrive repositories.

| Permission                   |
| ---------------------------- |
| `SensitivityLabels.Read.All` |
| `Files.Read.All`             |
| `User.Read.All`              |
| `Sites.Read.All`             |

</details>

<details>

<summary>Microsoft 365 and Entra ID Identity Posture</summary>

These permissions are required for user and group validation and for computing cross-tenant exposure scopes.

| Permission                          |
| ----------------------------------- |
| `User.Read.All`                     |
| `Group.Read.All`                    |
| `Application.Read.All`              |
| `RoleManagement.Read.Directory`     |
| `AuditLog.Read.All`                 |
| `Organization.Read.All`             |
| `DelegatedPermissionGrant.Read.All` |

{% hint style="info" %}
**Note**

`Organization.Read.All` and `DelegatedPermissionGrant.Read.All` can each be substituted by `Directory.Read.All`.
{% endhint %}

</details>

<details>

<summary>Microsoft 365 Automation and Remediation</summary>

These permissions are required for automated remediation actions.

| Permissions                            |
| -------------------------------------- |
| `Files.ReadWrite.All`                  |
| `Sites.ReadWrite.All`                  |
| `InformationProtectionPolicy.Read.All` |

</details>

<details>

<summary>Microsoft Teams Data Security Permissions</summary>

These permissions are required for scanning sensitive data in Microsoft Teams channels and messages.

| Permissions               |
| ------------------------- |
| `Chat.Read.All`           |
| `Chat.ReadWrite.All`      |
| `ChatMessage.Read.All`    |
| `Group.Read.All`          |
| `Team.ReadBasic.All`      |
| `TeamMember.Read.All`     |
| `User.Read.All`           |
| `Channel.ReadBasic.All`   |
| `ChannelMessage.Read.All` |
| `ChannelMember.Read.All`  |

</details>

#### Task 3. Grant Admin Consent

After adding all required API permissions:

1. On the **API permissions** page, click **Grant admin consent for \[Your Organization]**.
2. Confirm the consent request.
3. Verify that the status of all required permissions changes to **Granted**.

After completing these steps, use the **Directory (tenant) ID**, **Application (client) ID**, and **Client Secret** when configuring the Microsoft 365 connector in Cortex.


---

# 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://cortex-docs.paloaltonetworks.com/cortex-cloud-posture-management/cortex-cloud-data-sources-and-connectors/vendor-specific-data-sources/microsoft/microsoft-365-new/create-a-microsoft-entra-id.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.
