> ## Documentation Index
> Fetch the complete documentation index at: https://portkey-docs-chore-remove-get-model-generals-api.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure Entra

> Setup Azure Entra for SCIM provisioning with Portkey.

#### Azure Active Directory (Azure AD)

[Reference](https://learn.microsoft.com/en-us/azure/active-directory/app-provisioning/use-scim-to-provision-users-and-groups)

Setting up Azure Entra for SCIM provisioning consists of the following steps:

* **New Entra Application & SCIM Provisioning**
* **Application Roles**
* **SCIM Attribute Mapping Update**

***

##### New Entra Application

First, create a new Azure Entra application to set up SCIM provisioning with Portkey.

1. Navigate to the [Entra Applications Page](https://entra.microsoft.com/?culture=en-in\&country=in#view/Microsoft_AAD_IAM/AppGalleryBladeV2) and click **`Create your own application`**.

   <img src="https://mintcdn.com/portkey-docs-chore-remove-get-model-generals-api/qpDyd8Vo1lY3eMqy/images/scim/azure/create.png?fit=max&auto=format&n=qpDyd8Vo1lY3eMqy&q=85&s=89ca8e814193be1a4663f7f2ced91962" alt="Application Creation" width="1600" height="899" data-path="images/scim/azure/create.png" />

2. Complete the required fields to create a new application.

3. Once the application is created, navigate to the application's **Provisioning** page under the **Manage** section.

4. Click **`New Configuration`** to go to the provisioning settings page.

   <img src="https://mintcdn.com/portkey-docs-chore-remove-get-model-generals-api/qpDyd8Vo1lY3eMqy/images/scim/azure/settings.png?fit=max&auto=format&n=qpDyd8Vo1lY3eMqy&q=85&s=eb3dddb3ec91311cb7a3b0e408724bd0" alt="Provisioning Settings" width="1586" height="1344" data-path="images/scim/azure/settings.png" />

5. Obtain the **Tenant URL** and **Secret Token** from the Portkey Admin Settings page (if SCIM is enabled for your organization).

   * [Portkey Settings Page](https://app.portkey.ai/settings/organisation/sso)

   <img src="https://mintcdn.com/portkey-docs-chore-remove-get-model-generals-api/qpDyd8Vo1lY3eMqy/images/scim/portkey.png?fit=max&auto=format&n=qpDyd8Vo1lY3eMqy&q=85&s=d7ceabeb7304f8e6c9f1b6cab681aa74" alt="Portkey Admin Settings" width="1600" height="1052" data-path="images/scim/portkey.png" />

6. Fill in the values from the Portkey dashboard in Entra's provisioning settings and click **`Test Connection`**. If successful, click **`Create`**.

> If the test connection returns any errors, please contact us at [support@portkey.ai](mailto:support@portkey.ai).

***

##### Application Roles

Portkey supported roles should match Entra's application roles.

1. Navigate to **App Registrations** under **Enterprise Applications**, click **All Applications**, and select the application created earlier.
2. Go to the **App Roles** page and click **`Create app role`**.
   > Portkey supports two application-level roles:
   >
   > * **`member`**  (Organization Member)
   > * **`admin`**  (Organization Admin)
   > * **`owner`**  (Organization Owner)

<img src="https://mintcdn.com/portkey-docs-chore-remove-get-model-generals-api/qpDyd8Vo1lY3eMqy/images/scim/azure/roles.png?fit=max&auto=format&n=qpDyd8Vo1lY3eMqy&q=85&s=dc8fc66944ab91e4c81565d28d689daa" alt="App Roles" width="1600" height="482" data-path="images/scim/azure/roles.png" />

> Users assigned any other role will default to the **member** role.

3. To support group roles, create a role with the value **`group`** and a name in title-case (e.g., `Group` for the value `group`).

   <img src="https://mintcdn.com/portkey-docs-chore-remove-get-model-generals-api/qpDyd8Vo1lY3eMqy/images/scim/azure/create-roles.png?fit=max&auto=format&n=qpDyd8Vo1lY3eMqy&q=85&s=b2f14acd6370ac4bc7dcd60b32cdeda5" alt="Creating App Roles" width="1600" height="1015" data-path="images/scim/azure/create-roles.png" />

4. Assign users to the application with the desired role (e.g., **`owner`**, **`member`**, or **`admin`**) for the organization.

   <img src="https://mintcdn.com/portkey-docs-chore-remove-get-model-generals-api/qpDyd8Vo1lY3eMqy/images/scim/azure/select-role.png?fit=max&auto=format&n=qpDyd8Vo1lY3eMqy&q=85&s=f9d84fc40af1b4ef80f61bcb03d02a03" alt="Assigning Roles" width="602" height="686" data-path="images/scim/azure/select-role.png" />

***

#### Attribute Mapping

###### Adding a New Attribute

1. Go to the **Provisioning** page and click **Attribute Mapping (Preview)** to access the attributes page.

2. Enable advanced options and click **`Edit attribute list for customappsso`**.

   <img src="https://mintcdn.com/portkey-docs-chore-remove-get-model-generals-api/qpDyd8Vo1lY3eMqy/images/scim/azure/new-mapping.png?fit=max&auto=format&n=qpDyd8Vo1lY3eMqy&q=85&s=77fb1a30b2e1470c5a709525f9de8984" alt="Edit Attribute List" width="778" height="502" data-path="images/scim/azure/new-mapping.png" />

3. Add a new attribute called **`roles`** with the following properties:

   * **Multi-valued:** Enabled
   * **Type:** String

   <img src="https://mintcdn.com/portkey-docs-chore-remove-get-model-generals-api/qpDyd8Vo1lY3eMqy/images/scim/azure/mapping-properties.png?fit=max&auto=format&n=qpDyd8Vo1lY3eMqy&q=85&s=a25e5c15073bf98217943c5d32dedbf2" alt="Roles Attribute Properties" width="1544" height="214" data-path="images/scim/azure/mapping-properties.png" />

###### Adding a new mapping

1. Click on the **`Add new mapping`** link to add a new mapping. (refer to the above images).
2. Follow the values from the below image to add a new mapping.

<img src="https://mintcdn.com/portkey-docs-chore-remove-get-model-generals-api/qpDyd8Vo1lY3eMqy/images/scim/new-mapping.png?fit=max&auto=format&n=qpDyd8Vo1lY3eMqy&q=85&s=b8d42ec73718d21e3ed54702b87a2e87" alt="New Mapping Attributes" width="1488" height="1388" data-path="images/scim/new-mapping.png" />

3. Once done, save the changes.

###### Removing Unnecessary Attributes

Delete the following unsupported attributes:

* **preferredLanguage**
* **addresses (all fields)**
* **phoneNumbers**

***

#### Updating Attributes

**Update `displayName`**

1. Edit the **`displayName`** field to concatenate `firstName + lastName` instead of using the default `displayName` value from Entra records.

   <img src="https://mintcdn.com/portkey-docs-chore-remove-get-model-generals-api/qpDyd8Vo1lY3eMqy/images/scim/azure/update-displayname.png?fit=max&auto=format&n=qpDyd8Vo1lY3eMqy&q=85&s=0298a4d1a71958479f263587f8bbef52" alt="Update displayName Expression" width="1500" height="526" data-path="images/scim/azure/update-displayname.png" />

2. Save the changes and enable provisioning on the **Overview** page of the provisioning settings.

***

##### Group (Workspace) Provisioning

Portkey supports RBAC (Role-Based Access Control) for workspaces mapped to groups in Entra. Use the following naming convention for groups:

* **Format:** `ws-{group}-role-{role}`
  * **Role:** One of `admin`, `member`, or `manager`
* A user should belong to only one group per `{group}`.

**Example:**
For a `Sales` workspace:

* `ws-Sales-role-admin`
* `ws-Sales-role-manager`
* `ws-Sales-role-member`

Users assigned to these groups will inherit the corresponding role in Portkey.

<img src="https://mintcdn.com/portkey-docs-chore-remove-get-model-generals-api/qpDyd8Vo1lY3eMqy/images/scim/portkey-group-roles.png?fit=max&auto=format&n=qpDyd8Vo1lY3eMqy&q=85&s=cfec1622fe9cf1987b90ef368ad4bb72" alt="Entra Group Role Mapping" width="1600" height="425" data-path="images/scim/portkey-group-roles.png" />

***

### Support

If you face any issues with the group provisioning, please reach out to us at [here](mailto:support@portkey.ai).
