# Microsoft Azure AI Foundry authentication

> To create a connection to the Microsoft Azure AI Foundry connector, you must provide
the following credentials:

## Prerequisites

To create a connection to the Microsoft Azure AI Foundry connector, you must provide
the following credentials:

* Base URL
* Client ID
* Client Secret
* Tenant ID

:::note
The connector supports only classic Foundry projects. New Foundry projects are not supported.
:::

## Retrieving your credentials

Get the credentials from the Azure Portal:

1. Get the **Base URL** by navigating to Azure AI Foundry Portal, opening your
   Project, and copying the URL.
2. Create app registration in Azure Entra ID:
   1. Go to **Azure Portal** \> **App registrations**  \> **New
      Registration**.
   2. Provide the following:
      * **Name**: e.g., `UiPath-AIFoundry-App`
      * **Redirect URI**: Leave blank for now.
   3. Note the generated **Client ID** and **Tenant ID**.
   4. Generate a **Client Secret** under **Certificates &
      Secrets**.
3. In your registered app:
   1. Go to **API permissions** \> **Add a permission** \> **APIs my organization uses** and assign the following permissions to the app: 
      * **Microsoft Cognitive Services** \> **Delegated** \> **user_impersonation**
      * **Azure Machine Learning Services** \> **Delegated** \> **user_impersonation**
   2. Select **Add permissions** to approve permissions.
   
   :::note
   **Admin consent required** should be defaulted to **No**. In organizations where it is required and set to Yes, set it to No. If the option cannot be changed from Yes, ask your administrator to grant the admin consent for this permission to the application.
   :::

   ![azure-foundry-app-permissions](https://dev-assets.cms.uipath.com/assets/images/integration-service/microsoft-cognitive-services-767478ff.webp)

4. Configure redirect URI:
   1. In UiPath, select Orchestrator from the product launcher.
   2. Select a folder, and then navigate to the **Connections** tab.
   3. Select **Add connection**.
   4. To open the connection creation page, select **Azure AI Foundry** from the list.
   5. The connection page will display a **Callback URL**.
   6. Copy this Callback URL and add it as a **Redirect URI** in your
      Azure App Registration.

## Add the Azure AI Foundry connection

1. Select Orchestrator from the product launcher.
2. Select a folder, and then navigate to the **Connections** tab.
3. Select **Add connection**.
4. To open the connection creation page, select the connector from the list. You can use the search bar to find the connector.
5. Enter the required credentials.
6. Select **Connect**.

   For any secret-type field, you can select the menu next to the field and choose **Use credential asset** to reference an Orchestrator credential asset linked to an external vault instead of entering the value directly. For more information, see [Use credential assets for connections](credential-store-connections.md).

7. Your connection has been added.
