# Microsoft Azure OpenAI authentication

> This connector supports two authentication methods: **OAuth 2.0 Client credentials** and **API key**.

## Prerequisites

This connector supports two authentication methods: **OAuth 2.0 Client credentials** and **API key**.

To create a connection, you need the following credentials:
* **OAuth 2.0 Client credentials**:
    * **Azure OpenAI Resource** - Your Azure resource name.
    * **Tenant ID** - The Azure Active Directory (AAD) tenant ID associated with your Microsoft Azure OpenAI account. Tenant ID for single-tenant apps is found in the Overview section. Use `common` for personal, enterprise, or multi-tenant accounts.
    * **Client ID** - The client ID of the registered application in AAD. You can find it in the Overview section of your Microsoft Azure application registration.
    * **Client Secret** - The client secret of the registered application in AAD. You can create a new client secret in the **Certificates & secrets** section of your Microsoft Azure application registration.
    * **API version** - This represents the [REST API version](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#rest-api-versioning) used to interact with the Azure OpenAI service. You can input any API version you want to connect to.
* **API key**:
    * **API Key** - The API key associated with your Microsoft Azure OpenAI account.
    * **Azure OpenAI Resource** - Your Azure resource name.
    * **API version** - This represents the [REST API version](https://learn.microsoft.com/en-us/azure/ai-services/openai/reference#rest-api-versioning) used to interact with the Azure OpenAI service. You can input any API version you want to connect to.

## Retrieving the Azure OpenAI Resource

When calling the OpenAI API, the endpoint contains `https://<your-resource-name>.openai.azure.com`, where `<your-resource-name>` is your actual Azure resource name.

:::note
When you configure the connection, supply only the resource name. Exclude the `.openai.azure.com` suffix.
:::

You can retrieve the resource name only from Azure. If you deployed your own OpenAI service, the name of the instance name
(during the deployment phase) represents the resource name. To learn more, refer to the [Create and deploy an Azure OpenAI Service resource](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal) guide in the Microsoft official documentation.

## Add the Microsoft Azure OpenAI connection

To create a connection to your Microsoft Azure OpenAI instance, you need to perform the following steps:

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. Select the authentication type: **OAuth 2.0 Client credentials** or **API key**.
6. Enter the required credentials and 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).
