> ## Documentation Index
> Fetch the complete documentation index at: https://koreai-ai-for-work-dev.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring the Azure OpenAI Action

<Badge icon="arrow-left" color="gray">[Back to Actions Integrations](/ai-for-service/integrations/overview#actions)</Badge>

Connect the Platform to Azure OpenAI to resolve general queries using GPT models. See [Azure OpenAI Service](https://azure.microsoft.com/en-us/) for details.

***

## Supported Authorization Types

The platform supports Basic Auth for Azure OpenAI integration. See [App Authorization Overview](/ai-for-service/app-settings#authorization-profiles) for details.

| Authorization Type                       | Supported |
| ---------------------------------------- | --------- |
| Pre-Authorize the Integration            | Yes       |
| Allow Users to Authorize the Integration | Yes       |

***

## Step 1: Create an Azure OpenAI App

**Prerequisites:**

* Create an [Azure OpenAI](https://learn.microsoft.com/en-us/azure/cognitive-services/openai/overview) developer account.
* Copy the **API Key**, **User Sub Domain**, and **Deployment ID** values for later use.

**Steps:**

1. Log in to the [Azure portal](https://portal.azure.com) and search for **Azure OpenAI**.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img1-azure-openai-app.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=6fc93ed945eee067d7fbc81cbd1ce76b" alt="Azure portal" width="1365" height="233" data-path="ai-for-service/integrations/actions/images/configure-azure-img1-azure-openai-app.png" />

2. On the Cognitive Services Azure OpenAI page, click **Create**.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img2-azure-create.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=57a31c22b5610740870452d5e10f92ab" alt="Create" width="1356" height="299" data-path="ai-for-service/integrations/actions/images/configure-azure-img2-azure-create.png" />

3. Fill in the required fields:

   * **Resource Group** - Select or create a resource group.
   * **Region** - for example, South Central US.
   * **Name** - for example, PlatformIntegration.
   * **Pricing Tier** - for example, Standard.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img3-create-azure-app.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=4ff9f51d2ba3159c03d41870ddd93301" alt="Create app" width="1150" height="653" data-path="ai-for-service/integrations/actions/images/configure-azure-img3-create-azure-app.png" />

4. Click **Next** > **Review + Submit**, then click **Create** after validation passes.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img4-create-app.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=64994a3cdc6583b9bb6b2c9d204bf238" alt="Create app" width="1058" height="647" data-path="ai-for-service/integrations/actions/images/configure-azure-img4-create-app.png" />

5. Click **Go to Resource** to view app details.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img5-go-to-resource.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=ec5da8fa5ef46bc7d530202f6433dd0e" alt="Go to resource" width="1046" height="559" data-path="ai-for-service/integrations/actions/images/configure-azure-img5-go-to-resource.png" />

6. On the Overview page, copy the **User Domain Name**.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img6-azure-user-domain.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=644ad3c4f2cf06d65e791cb5f4c44cba" alt="User Domain Name" width="1317" height="563" data-path="ai-for-service/integrations/actions/images/configure-azure-img6-azure-user-domain.png" />

7. Under **Keys and Endpoints**, click **Show Keys** and copy the **API Key**.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img7-azure-api-key.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=d7e8d163c025cb9db1c09e40162c5529" alt="API Key" width="1364" height="591" data-path="ai-for-service/integrations/actions/images/configure-azure-img7-azure-api-key.png" />

8. Under **Model Deployments**, create a new deployment (for example, name: PlatformDeploy, model: text-davinci-001) and click **Save**.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img8-azure-deploy-model.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=598d15e24d7bba0c63f160db16f06543" alt="Deploy model" width="1355" height="653" data-path="ai-for-service/integrations/actions/images/configure-azure-img8-azure-deploy-model.png" />

9. Copy the **Model Name** of the new deployment.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img9-azure-deploy-model1.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=2e802a13ede554649c765d217cf00854" alt="Copy model name" width="1362" height="637" data-path="ai-for-service/integrations/actions/images/configure-azure-img9-azure-deploy-model1.png" />

10. Alternatively, copy credentials from **Azure OpenAI Studio > Playground > GPT-3 > View Code**.

    <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img10-azure-chatgpt-playground.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=8d63db1a2497c23abf1708c07c3c559a" alt="Playground" width="1365" height="645" data-path="ai-for-service/integrations/actions/images/configure-azure-img10-azure-chatgpt-playground.png" />

***

## Step 2: Enable the Azure OpenAI Action

Go to **App Settings > Integrations > Actions** and select **Azure OpenAI**.

### Pre-authorize the Integration (Basic Auth)

1. In the **Configurations** dialog, select the **Authorization** tab.

2. Set **Authorization Type** to **Pre-authorize the Integration** > **Basic Auth**.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img12-azure-openai-config-change.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=03fe31ff9d743a6e8d683681460067cf" alt="Auth type" width="1077" height="826" data-path="ai-for-service/integrations/actions/images/configure-azure-img12-azure-openai-config-change.png" />

3. Enter the following fields:

   | Field           | Description                          |
   | --------------- | ------------------------------------ |
   | API Key         | Secret API key from Step 1           |
   | User Sub Domain | Domain name from Step 1              |
   | Deployment ID   | Deployment ID/model name from Step 1 |

   <Note>You can enter the deployment ID for ChatGPT-3 or ChatGPT-3.5 to configure the GPT model.</Note>

4. Click **Enable**. The Integration Successful pop-up appears on first configuration.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img13-azure-action6.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=5c813a01cc03fdfa7fe707f14e10c4cf" alt="Enable" width="590" height="237" data-path="ai-for-service/integrations/actions/images/configure-azure-img13-azure-action6.png" />

<Note>The Azure OpenAI action moves from Available to Configured.</Note>

### Allow End Users to Authorize (Basic Auth)

1. In the **Configurations** dialog, select the **Authorization** tab.

2. Set **Authorization Type** to **Allow Users to Authorize the Integration** > **Basic Auth**.

3. Click **Select Authorization** > **Create New**.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img14-azure-action2.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=681072b2981d8564b6ee07d7d09b1fc0" alt="Create new" width="798" height="844" data-path="ai-for-service/integrations/actions/images/configure-azure-img14-azure-action2.png" />

4. Select the authorization mechanism (for example, **API Key**).

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img15-open-ai-api-key1-1.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=8dc4d3defcd73953a568d033387607c3" alt="API Key" width="785" height="910" data-path="ai-for-service/integrations/actions/images/configure-azure-img15-open-ai-api-key1-1.png" />

   See [App Authorization Overview](/ai-for-service/app-settings#authorization-profiles) for creating Basic Auth profiles.

5. Enter the following credentials:

   | Field                   | Description                                   |
   | ----------------------- | --------------------------------------------- |
   | Name                    | Name for the Basic Auth profile               |
   | Tenancy URLs            | Select Yes if tasks require tenancy URLs      |
   | Base URL                | Base tenant URL for the Azure OpenAI instance |
   | Authorization Check URL | Auth check URL                                |
   | Description             | Description of the auth profile               |

6. Click **Save Auth**, then select the new profile.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img16-azure-action3.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=4d746c2278fc36f64567c5a3be2ebaca" alt="Save auth" width="796" height="908" data-path="ai-for-service/integrations/actions/images/configure-azure-img16-azure-action3.png" />

7. Click **Enable**. The Integration Successful pop-up appears.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img17-azure-action5.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=3349530608d2806ea1f9495c0e967309" alt="Enable" width="794" height="848" data-path="ai-for-service/integrations/actions/images/configure-azure-img17-azure-action5.png" />

***

## Step 3: Install Azure OpenAI Action Templates

1. On the Integration Successful dialog, click **Explore Templates**.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img18-azure-action6.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=99520b15c86c1edfbaca3ac18726f403" alt="Explore templates" width="591" height="239" data-path="ai-for-service/integrations/actions/images/configure-azure-img18-azure-action6.png" />

2. Click **Install** for the desired template.

   <img src="https://mintcdn.com/koreai-ai-for-work-dev/E9o4BvEXCZ64Lebj/ai-for-service/integrations/actions/images/configure-azure-img19-azure-action7.png?fit=max&auto=format&n=E9o4BvEXCZ64Lebj&q=85&s=1cd809a6bbebd1e5df0772e3b9d084d5" alt="Install" width="589" height="287" data-path="ai-for-service/integrations/actions/images/configure-azure-img19-azure-action7.png" />

3. The associated dialog task is auto-created. Click **Go to Dialog** or navigate to **Automation AI > Use Cases > Dialogs**.

4. To use the templates, see [Using Azure OpenAI Action Templates](/ai-for-service/integrations/actions/using-the-azure-openai-action-templates).
