# Azure OpenAI

Configure the OpenAI connector to work with Azure OpenAI deployments using custom base URLs and Azure-specific authentication.

## Overview

The OpenAI connector supports Azure OpenAI deployments. When using Azure OpenAI, you can configure a custom base URL in the authentication settings to point to your Azure OpenAI endpoint (e.g., `https://your-resource.openai.azure.com/`).

Azure OpenAI provides enterprise-grade security, compliance, and regional availability while offering access to OpenAI's models through Azure infrastructure.

## Authentication Setup

Follow these steps to configure authentication with Azure OpenAI:

1. Sign in to your Microsoft Azure portal and click on **Create a resource**.
   ![Azure portal home](https://tray.ai/documentation/images/connectors/artificial-intelligence/openai/openai-azure-step1-home.png)

2. On the left side of the page, click on **AI Apps and Agents**.
   ![Select AI category](https://tray.ai/documentation/images/connectors/artificial-intelligence/openai/openai-azure-step2-category.png)

3. Locate **Azure OpenAI** in the Popular Azure services list and click **Create**.
   ![Locate Azure OpenAI](https://tray.ai/documentation/images/connectors/artificial-intelligence/openai/openai-azure-step3-service.png)

4. Fill out the required fields including **Subscription**, **Resource Group**, **Region**, and **Name**. Select a **Pricing tier**, then click through **Networking** and **Review** tabs before clicking **Create** to deploy the resource.
   ![Configure resource](https://tray.ai/documentation/images/connectors/artificial-intelligence/openai/openai-azure-step4-configure.png)

5. After deployment completes, navigate to the resource's **Overview** page and select **Keys and Endpoint** from the left sidebar under Resource Management.
   ![Navigate to keys](https://tray.ai/documentation/images/connectors/artificial-intelligence/openai/openai-azure-step5-navigate.png)

6. Copy one of the API keys (Key1 or Key2) using the copy button. You will use this key for authentication in Tray.io.
   ![Copy API keys](https://tray.ai/documentation/images/connectors/artificial-intelligence/openai/openai-azure-step6-keys.png)

7. In Tray.io, create a new authentication and enter the **API Key** from Azure. In the **Base URL** field, enter your Azure OpenAI endpoint URL (e.g., `https://your-resource.openai.azure.com/`).
   ![Tray.io configuration](https://tray.ai/documentation/images/connectors/artificial-intelligence/openai/openai-azure-step7-tray-config.png)

## Important Considerations

> **Warning:** When using Azure OpenAI, note that model naming conventions differ from standard OpenAI. Azure may also have restrictions on supported operations depending on your deployment region and configuration.

### Model Naming Differences

Azure OpenAI uses deployment-based model naming, which differs from OpenAI's direct model names:

* **OpenAI**: Uses model names directly (e.g., `gpt-4o`, `text-embedding-3-small`)
* **Azure OpenAI**: Uses deployment names that you configure when deploying a model

When configuring operations in Tray.io workflows, ensure you use the correct deployment name for your Azure OpenAI resource.

### Operation Availability

Some operations may have restrictions or behave differently in Azure OpenAI depending on:

* Deployment region
* Model availability in your region
* Azure subscription tier
* Compliance and data residency requirements

### Additional Resources

For more information about Azure OpenAI:

* [Azure OpenAI models documentation](https://learn.microsoft.com/en-us/azure/ai-foundry/foundry-models/concepts/models-sold-directly-by-azure?view=foundry-classic\&tabs=global-standard-aoai%2Cstandard-chat-completions%2Cglobal-standard\&pivots=azure-openai)
* [Switching between OpenAI and Azure OpenAI endpoints](https://learn.microsoft.com/en-us/azure/ai-foundry/openai/how-to/switching-endpoints?view=foundry-classic)

## Base URL Configuration

The Base URL field in Tray.io authentication allows you to specify your Azure OpenAI endpoint. The format typically follows this pattern:

```
https://{your-resource-name}.openai.azure.com/
```

Replace `{your-resource-name}` with the name you specified when creating the Azure OpenAI resource.

> **Info:** Make sure to include the trailing slash (`/`) in your Base URL configuration to ensure proper API communication.
