> ## Documentation Index
> Fetch the complete documentation index at: https://koreai-content-gov.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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img1-azure-openai-app.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=76391be2e3245e036587a3a9d299d216" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img2-azure-create.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=24ab6356bd0a0cf72977979aaa1db341" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img3-create-azure-app.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=1a2f7bafec2cdf3819dd2aba254e3ccc" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img4-create-app.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=549efdcf2e7a0ee3a143f7815e227db8" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img5-go-to-resource.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=7f993986b8fb8d1aaac427ffd6c1719b" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img6-azure-user-domain.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=b083a460c47befab58c4910ae722aaa1" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img7-azure-api-key.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=4ace199fbd006fcc67a21ed9c979b0b9" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img8-azure-deploy-model.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=3dda82211417c197d3c31c2dc78daeaa" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img9-azure-deploy-model1.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=e25b6b7cb4709d9645352e4baa46c1b3" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img10-azure-chatgpt-playground.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=8ea2154a0ce31bf48a37fb75bc745861" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img12-azure-openai-config-change.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=cdd4267381b938ce04d4981941324cf4" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img13-azure-action6.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=c07b83f80edaadbe9525d829e15cc2bd" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img14-azure-action2.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=4bf666576f6dc1785143998cae7782a3" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img15-open-ai-api-key1-1.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=9466ae549ed717dfde6ff02d93d56b97" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img16-azure-action3.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=a2376bed158230b842ae258793ca8524" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img17-azure-action5.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=1850bff8a0768799ca3e45a30e4b76cf" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img18-azure-action6.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=dfe8eea6f1e93df7c0804c27f237d2a2" 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-content-gov/VYRKChaiPUrorkDG/ai-for-service/integrations/actions/images/configure-azure-img19-azure-action7.png?fit=max&auto=format&n=VYRKChaiPUrorkDG&q=85&s=2771afbba4a2fe694a863a2b21cddeab" 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).
