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

# Microsoft Entra ID

> Step-by-step guide to configure Microsoft Entra ID (Azure AD) for CrewAI Factory authentication

## Overview

This is a requirement to install CrewAI Enterprise on an Azure environment that uses Microsoft Entra as the authentication provider.

<Note>
  **Installing for the first time?** Use a Deployment Guide for a complete end-to-end walkthrough including infrastructure setup, a full `values.yaml`, and post-install steps:

  * [AWS EKS + Entra ID + Wharf + Studio V2](/deployment-guides/aws-entraid-wharf-studio)
  * [GCP GKE + Entra ID + Wharf + Studio V2](/deployment-guides/gcp-entraid-wharf-studio)
  * [Azure AKS + Entra ID + Wharf + Studio V2](/deployment-guides/azure-entraid-wharf-studio)
</Note>

## Initial App Registration

Go to [portal.azure.com](http://portal.azure.com) and select **"Microsoft Entra ID"** under **"Azure services"**. In the **"Overview"** screen, under **"Add"**, click **"App registration"**

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-app-registration.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=93074a2b75ed115e33749a95b2ee1d1e" alt="Azure App Registration" width="566" height="333" data-path="images/entra-id/entra-app-registration.png" />

Fill in the fields to create the application:

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-app-registration-form.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=59d43106b010bea321da685e6b87a490" alt="Azure App Registration Form" width="884" height="797" data-path="images/entra-id/entra-app-registration-form.png" />

* **Name:** Choose a name for the application (Suggested: `CrewAI`)
* Under **supported account types**, choose **"Accounts in this organization directory only"**
  * This will ensure that only users from this Azure organization will be able to log in into the application.
* **Redirect URI**
  * In the **"select a platform"**, choose **"web"**
  * Fill in the redirect URI with your application domain + `/auth/entra_id/callback`
    * e.g. `https://crewai.thedomain.com/auth/entra_id/callback`

<Warning>
  The redirect URI must be `https://<your-domain>/auth/entra_id/callback`. This must be configured in Azure before running `helm install` — authentication will fail at login if it is missing or incorrect.
</Warning>

When finished, click **"Register"**.

## Collecting Credentials

In the app details page, grab the values **"Application (client) ID"** and **"Directory (tenant) ID"**

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-app-credentials.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=b7a3b556394ecea17a95d14d1c67b836" alt="Azure App Credentials" width="451" height="454" data-path="images/entra-id/entra-app-credentials.png" />

<Note>
  You can also access this page through the left sidebar of under **"App registrations"** and then clicking your app name in the list that is shown.
</Note>

## Creating Client Secret

On the left sidebar of the app details page, under **"Manage"**, access **"Certificates & Secrets"**, and create a new client secret.

On the right panel that appears, write in the description of that secret (e.g. *CrewAI Enterprise*) and choose the expiration date. Click **"Add"** to create the secret.

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-client-secret-creation.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=88230837720fa6fb8903b98354ab7895" alt="Azure Client Secret Creation" width="1162" height="793" data-path="images/entra-id/entra-client-secret-creation.png" />

Now copy the client secret. Note that if you leave this page without copying the secret, you won't be able to see it again and will need to create another secret.

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-client-secret-value.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=6eb00d38ba5b4701ecb414d177f5a310" alt="Azure Client Secret Value" width="1140" height="225" data-path="images/entra-id/entra-client-secret-value.png" />

## Granting Admin Consent

Go back to Azure portal, and under **"Azure services"**, go to **"Enterprise applications"**. Under **"All applications"**, choose the app that was just created.

In the left sidebar, under **"Security"**, click **"Permissions"**. In the screen that appears, click **"Grant admin consent for CrewAI"**.

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-admin-consent.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=316f3e169d25904d3847dbb27d9e359c" alt="Azure Admin Consent" width="649" height="732" data-path="images/entra-id/entra-admin-consent.png" />

Admin consent should be granted for Microsoft Graph to **User.Read**. This is how it should be looking in the end:

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-permissions.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=8afa7509750f465c61e4e09df06a5051" alt="Azure Permissions" width="908" height="257" data-path="images/entra-id/entra-permissions.png" />

## Configuring App Roles

App Roles allow Entra ID to communicate each user's role directly to CrewAI Factory via the JWT token. This is the recommended way to grant admin panel access to Entra ID users — no additional commands are needed after login.

Go back to **"App registrations"** and select your app. In the left sidebar, under **"Manage"**, click **"App roles"**, then **"Create app role"**.

Create the following two roles:

| Display name  | Value           | Description            | Allowed member types |
| ------------- | --------------- | ---------------------- | -------------------- |
| Member        | `member`        | Regular platform users | Users/Groups         |
| Factory Admin | `factory-admin` | Admin panel access     | Users/Groups         |

For each role, ensure the **"Do you want to enable this app role?"** checkbox is checked before saving.

<Note>
  The `member` role value is not checked anywhere in the app — it is purely a way to grant login access when "Assignment required" is enabled. Only `factory-admin` grants admin panel access.
</Note>

## Configuring User Access

In the left sidebar, under **"Manage"**, go to **"Properties"**, and set the **"Assignment required?"** option to **"Yes"**. This will set up the application to only be accessed by only specific users and groups. After doing the changes, click **"Save"**.

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-properties-assignment.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=ae75be1abb86ebb63731cc00adfdc49d" alt="Azure Properties Assignment" width="1046" height="812" data-path="images/entra-id/entra-properties-assignment.png" />

In the left sidebar, under **"Manage"**, now click **"Users and groups"**. There we can assign specific users or whole groups to access the application. Users that are not assigned here will not be able to log in into the CrewAI enterprise platform. Click **"Add user/group"** and select desired users/groups, assigning the appropriate role to each:

* **Regular users** → select the **Member** role
* **Admin users** → select the **Factory Admin** role

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-users-and-groups.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=5dc8245478ff050e6a541953de9412ab" alt="Azure Users and Groups" width="665" height="543" data-path="images/entra-id/entra-users-and-groups.png" />

<Note>
  App Roles are included in the JWT automatically — no additional OAuth scopes are needed. After login, you can verify the token contains the expected `roles` claim (e.g. `"roles": ["factory-admin"]` for admin users).
</Note>

## Environment Variables

Application setup in Azure portal is finished. Now, with the credentials obtained in the previous steps, configure them in your Helm values file when deploying the CrewAI enterprise application.

### Helm Values Configuration

<Warning>
  `ENTRA_ID_CLIENT_ID` and `ENTRA_ID_TENANT_ID` are non-sensitive identifiers that belong under `envVars:`. Only `ENTRA_ID_CLIENT_SECRET` is a credential and belongs under `secrets:`. Placing them under `secrets:` stores the values in a Kubernetes Secret but the chart template does not inject Entra ID values from the secrets section into pod environment variables. The result is a silent authentication failure — the pod starts normally but all login attempts fail because CLIENT\_ID and TENANT\_ID are absent from the pod environment.
</Warning>

```yaml theme={null}
envVars:
  AUTH_PROVIDER: "entra_id"
  ENTRA_ID_CLIENT_ID: "<Application (client) ID>"
  ENTRA_ID_TENANT_ID: "<Directory (tenant) ID>"

secrets:
  ENTRA_ID_CLIENT_SECRET: "<Client secret value>"
```

## Helm Chart Configuration

The following is a complete, working Helm values snippet with all required Entra ID values in their correct sections:

```yaml theme={null}
envVars:
  AUTH_PROVIDER: "entra_id"
  ENTRA_ID_CLIENT_ID: "<Application (client) ID>"      # from App Registration overview
  ENTRA_ID_TENANT_ID: "<Directory (tenant) ID>"        # from App Registration overview

  # Optional: required only if enabling CLI login (see section below)
  # ENTRA_ID_DEVICE_AUTHORIZATION_CLIENT_ID: "<Application (client) ID>"
  # ENTRA_ID_CUSTOM_OPENID_SCOPE: "<scope URI, e.g. api://crewai-cli-dev/read>"

secrets:
  ENTRA_ID_CLIENT_SECRET: "<Client secret value>"      # from Certificates & Secrets
```

<Warning>
  `ENTRA_ID_CLIENT_ID` and `ENTRA_ID_TENANT_ID` are non-sensitive identifiers that belong under `envVars:`. Only `ENTRA_ID_CLIENT_SECRET` is a credential and belongs under `secrets:`. Placing them under `secrets:` stores the values in a Kubernetes Secret but the chart template does not inject Entra ID values from the secrets section into pod environment variables. The result is a silent authentication failure — the pod starts normally but all login attempts fail because CLIENT\_ID and TENANT\_ID are absent from the pod environment.
</Warning>

<Note>
  `oauth.enabled` is NOT required for Entra ID SSO. It controls a separate Built-In Integrations microservice for tool connections (Microsoft 365 Outlook, OneDrive, Teams). If you want those tool integrations, see the [Microsoft 365 Integrations guide](/features/microsoft-integrations). Entra ID SSO works without `oauth.enabled: true`.
</Note>

## Combining With Other Features

* **Wharf (trace collection)**: No additional values needed — Wharf is enabled by default. Ensure the `wharf` database is pre-created. See [Wharf reference](/reference/chart-values/wharf).
* **Studio V2**: Configured entirely post-install via the web UI and `kubectl exec` commands. See [Enable Studio V2](/features/studio-v2).
* **Microsoft 365 integrations** (Outlook, OneDrive, Teams as tools): Requires `oauth.enabled: true` and a separate OAuth app registration. This is separate from Entra ID SSO. See [Microsoft Integrations](/features/microsoft-integrations).
* **ArgoCD / GitOps**: Auto-generated secrets must be set explicitly. See the [ArgoCD guide](/configuration/argocd).

## Optional: Enable CLI Login

<Note>
  This section is only required if you want to use the `crewai` CLI tool with Entra ID authentication. If you are only configuring web-based SSO, skip this section. `ENTRA_ID_DEVICE_AUTHORIZATION_CLIENT_ID` and `ENTRA_ID_CUSTOM_OPENID_SCOPE` are not needed for web login.
</Note>

<Note>
  This will guide you in the process of updating your Entra ID setup and also the CrewAI Factory installation in order to support login from the CrewAI CLI tool.
</Note>

Go to [portal.azure.com](http://portal.azure.com), then **"App Registrations"** and choose the app you use for SSO authentication for the CrewAI Factory installation. In this example, it's **"CrewAI Dev"**:

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-app-selection.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=2b625ef0167e9f756b5b8f8e86adff53" alt="Azure App Selection" width="1414" height="1030" data-path="images/entra-id/entra-app-selection.png" />

### Enable Public Client Flows

Now, under **"Manage"** > **"Authentication"** we are going to scroll down to **"Advanced Settings"** and enable the **"Allow public client flows"** option. This will allow us to use the **"device code authorization grant"** flow, which is required for native applications such as CLIs.

Change it to **"Yes"** and click **"Save"**.

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-public-client-flows.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=1ed42621509a36bcce1eaf262d778fb9" alt="Azure Public Client Flows" width="1008" height="1039" data-path="images/entra-id/entra-public-client-flows.png" />

### Expose an API

Now, we'll navigate to **"Expose and API"** on the left panel, still under **"Manage"**.

There, click on **"Add"** that is on the side of **"Application ID URI"** and create the application ID. You can use the default one that is provided or create your own. A good pattern is to start with `api://`. After that, click **"Save"**

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-application-id-uri.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=ed49a64c63c3518e0e9a80a92ebb1add" alt="Azure Application ID URI" width="1415" height="1032" data-path="images/entra-id/entra-application-id-uri.png" />

Now, click **"Add a scope"** within the same page, and choose a name for your scope. We recommend setting it to `read`.

Change the **"Who can consent?"** to **"Admins and users"**, fill whatever is desired on the display name and description fields, ensure the state is **"Enabled"** and then click **"Add scope"**.

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-add-scope.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=ad600b8b4341f5e7fc2addf5c0c9c0ff" alt="Azure Add Scope" width="1415" height="1028" data-path="images/entra-id/entra-add-scope.png" />

The created scope should look like this on the **"Expose an API"** page:

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-scope-created.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=b2224c02110a72864c4f0f9d26ad2f6e" alt="Azure Scope Created" width="1343" height="808" data-path="images/entra-id/entra-scope-created.png" />

Store the value of this scope (in this case `api://crewai-cli-dev/read`). It will be used earlier in an environment variable on your Factory Installation.

### Update Access Token Version

Now, under **"Management"** on the left sidebar, navigate to **"Manifest"**. Search for the configuration named `accessTokenAcceptedVersion`. The value would likely be `null`, like this:

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-manifest-before.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=5db2fb122c097cb552ac82996dc741b9" alt="Azure Manifest Before" width="850" height="723" data-path="images/entra-id/entra-manifest-before.png" />

Change the value to `2` and click **"Save"**.

<img src="https://mintcdn.com/crewai-enterprise/FDCCTm3UPXc6a0tn/images/entra-id/entra-manifest-after.png?fit=max&auto=format&n=FDCCTm3UPXc6a0tn&q=85&s=78d3d6a0a770e0690fd99fd8970ed2c0" alt="Azure Manifest After" width="856" height="711" data-path="images/entra-id/entra-manifest-after.png" />

```json theme={null}
"accessTokenAcceptedVersion": 2
```

### Additional Environment Variables

Now that Entra ID is configured to allow CLI login, we need to add one extra environment variable to our Factory Installation:

```bash theme={null}
# This should have the same value as the client ID provided earlier
ENTRA_ID_DEVICE_AUTHORIZATION_CLIENT_ID="insert the Application (client) ID here"
# This should have the value of the scope you defined on the "Expose an API" page. E.g. 'api://crewai-cli-dev/read'
ENTRA_ID_CUSTOM_OPENID_SCOPE="insert the scope here"
```

## CLI Configuration

Now you are ready to configure your enterprise CLI login.

Make sure your `crewai` CLI is version 1.6.0 or higher. To configure the Entra ID provider just run the following command:

```bash theme={null}
crewai enterprise configure https://your-factory-url.app
```

All set! You're now ready to authenticate using Entra ID!

```bash theme={null}
crewai login
```
