> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Azure Logic Apps

> You can connect Azure Logic Apps to Connect AI via the OpenAPI specification.

## Prerequisites

Before you connect via OpenAPI, you must first do the following:

* Connect a data source to your Connect AI account. See [Sources](/en/Sources) for more information.
* [Add a workspace](/en/Workspaces#add-a-workspace) to Workspaces.
* [Add assets](/en/Workspaces#workspace-assets) to your workspace.
* Generate a Personal Access Token (PAT) on the [Settings](/en/Settings#personal-access-tokens) page. Copy this down, as it acts as your password during authentication.
* Ensure that you have access to create a custom connector under your Azure subscription.

## Connect to Connect AI

To establish a connection from Azure Logic Apps to Connect AI via OpenAPI, follow these steps.

<Steps>
  <Step>
    In **Workspaces** in Connect AI, select a workspace and download the OpenAPI specification for the workspace. See [OpenAPI](/en/API/OpenAPI) for more information.

    <Note>
      You must use OpenAPI version 2.0 and select **Convert array types to strings**.
    </Note>

    <Frame>
      <img src="https://mintcdn.com/cdata/g6xWfJ06JOP8a8JK/en/images/powerautomate_client_endpoints.png?fit=max&auto=format&n=g6xWfJ06JOP8a8JK&q=85&s=33ebd5ae6c52fb64ddd4ae87c9a1b88b" alt="" width="750" height="533" data-path="en/images/powerautomate_client_endpoints.png" />
    </Frame>
  </Step>

  <Step>
    Log in to your Azure portal.
  </Step>

  <Step>
    In Microsoft Azure, under **Azure services**, click **Create a resource**.
  </Step>

  <Step>
    In the search bar, type *Logic Apps Custom Connector*. Click **Create** > **Logic Apps Custom Connector**.

    <Frame>
      <img src="https://mintcdn.com/cdata/6FDv4aMDihHt3ws_/en/images/logic_apps_client_create_custom.png?fit=max&auto=format&n=6FDv4aMDihHt3ws_&q=85&s=62bd9d3cb1f9ea0bfdd780c850302af6" alt="" width="279" height="599" data-path="en/images/logic_apps_client_create_custom.png" />
    </Frame>
  </Step>

  <Step>
    Enter the details for your custom connector, and then click **Review + create**.

    <Frame>
      <img src="https://mintcdn.com/cdata/6FDv4aMDihHt3ws_/en/images/logic_apps_client_create_basics.png?fit=max&auto=format&n=6FDv4aMDihHt3ws_&q=85&s=9ce5f86442c3c7ff9c65fe35fdb0171c" alt="" width="905" height="867" data-path="en/images/logic_apps_client_create_basics.png" />
    </Frame>

    Refer to the [Microsoft documentation](https://learn.microsoft.com/en-us/connectors/custom-connectors/create-logic-apps-connector) for more details.
  </Step>

  <Step>
    In the Logic Apps custom connector you created, click **Edit**. You will now import the OpenAPI definition into the custom connector. Follow the steps below or refer to the [Microsoft documentation](https://learn.microsoft.com/en-us/connectors/custom-connectors/define-openapi-definition).
  </Step>

  <Step>
    Under **1. General**, select an **Import mode** of **OpenAPI file**. Then locate the OpenAPI definition you created.

    <Frame>
      <img src="https://mintcdn.com/cdata/6FDv4aMDihHt3ws_/en/images/logic_apps_client_openapi.png?fit=max&auto=format&n=6FDv4aMDihHt3ws_&q=85&s=eda8cf2fe469147134a760efd472793c" alt="" width="1347" height="555" data-path="en/images/logic_apps_client_openapi.png" />
    </Frame>
  </Step>

  <Step>
    Enter general information about the connector, including a description. **Host** and **Base URL** are already filled in.
  </Step>

  <Step>
    In the **2. Security** step, select an **Authentication type** of **Basic authentication**. Users have to provide a user name and password before using this API. Enter the parameter labels that users will see.

    <Note>
      When you use the custom connector, the user name is the Connect AI user name, and the password is the PAT created in the prerequisites.
    </Note>
  </Step>

  <Step>
    The **3. Definition** step of the connector defines all the actions of the connector that are contained in the OpenAPI specification file. The actions include all the functions you need for the table, including list, get, create, update, and delete records.
    In the **3. Definition** step, you can edit the **Actions** and **References** imported from the OpenAPI specification.

    * **Actions**—each action in the custom connector has **General** information, as well as the **Request**, **Response**, and **Validation** of the response.
      For example, the following request is a GET request to list drives.

    <Frame>
      <img src="https://mintcdn.com/cdata/g6xWfJ06JOP8a8JK/en/images/powerapps_request.png?fit=max&auto=format&n=g6xWfJ06JOP8a8JK&q=85&s=623dffef3f60107c8344d493253b6ad0" alt="" width="686" height="851" data-path="en/images/powerapps_request.png" />
    </Frame>

    The request includes query parameters that are appended to the URL, such as `$top`, `$filter`, and `$orderby`. You can edit and delete the query parameters here. The parameters are based on the OData protocol.
    See [API Operations](/en/API/OpenAPI#api-operations) for a complete reference.
    Similarly, there is a POST request to create a new record. The request contains all the fields for the record. You can edit these fields in the definition.

    * **References**—reusable parameters that are used by both actions and triggers. Each reference has a **Definition** and **Validation**.
  </Step>

  <Step>
    Click **Update connector** to save your changes.
  </Step>

  <Step>
    You can now build Logic Apps with your custom connector. For more information about building Logic Apps with a custom connector, refer to the [Microsoft documentation](https://learn.microsoft.com/en-us/connectors/custom-connectors/use-custom-connector-logic-apps).
  </Step>
</Steps>
