> 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/data-security-documentation/cortex-data-security-data-sources-and-connectors/vendor-specific-data-sources/microsoft/microsoft-365/create-a-microsoft-entra-id.md).

# Create a Microsoft Entra ID

To integrate Microsoft 365 services with Cortex Cloud for Data Security and 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**, select **Accounts in this organizational directory only**.
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.

#### Microsoft 365 Data Security

These permissions are required for deep scanning, inventory rules, and sensitive content detection across SharePoint and OneDrive repositories.

**Microsoft Graph (Application permissions):**

| Permission                   | Description                                         |
| ---------------------------- | --------------------------------------------------- |
| `SensitivityLabels.Read.All` | Read all sensitivity labels.                        |
| `Files.Read.All`             | Read all files in all site collections.             |
| `User.Read.All`              | Read users' full profiles for exposure calculation. |
| `Sites.Read.All`             | Read all site collections and document libraries.   |

#### Microsoft 365 and Entra ID Identity Posture

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

**Microsoft Graph (Application permissions):**

| Permission                      | Description                                      |
| ------------------------------- | ------------------------------------------------ |
| `User.Read.All`                 | Read all users' full profiles.                   |
| `Group.Read.All`                | Read all groups and memberships.                 |
| `Application.Read.All`          | Read all application registrations.              |
| `RoleManagement.Read.Directory` | Read directory role assignments and definitions. |
| `AuditLog.Read.All`             | Read audit logs and activity reports.            |

#### Microsoft 365 Automation and Remediation

These permissions are required for automated actions, such as removing sharing links and managing user sessions.

**Microsoft Graph (Application permissions):**

| Permission                                          | Description                                             |
| --------------------------------------------------- | ------------------------------------------------------- |
| `Sites.ReadWrite.All` or `Sites.FullControl.All`    | Remove public or anonymous sharing links.               |
| `User.ReadWrite.All` or `User.ManageIdentities.All` | Apply user quarantine by disabling sign-in.             |
| `User.RevokeSessions.All`                           | Revoke user sessions.                                   |
| `User.Read.All`                                     | Read user information required for remediation context. |

### 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 Cloud.


---

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/data-security-documentation/cortex-data-security-data-sources-and-connectors/vendor-specific-data-sources/microsoft/microsoft-365/create-a-microsoft-entra-id.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
