Skip to content

Commit 4df33fb

Browse files
committed
reorganizing content
1 parent f8edaaa commit 4df33fb

File tree

1 file changed

+60
-52
lines changed

1 file changed

+60
-52
lines changed

articles/ai-services/openai/how-to/assistants-logic-apps.md

Lines changed: 60 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -18,66 +18,23 @@ recommendations: false
1818

1919
Azure Logic Apps is fully managed by Microsoft Azure, which frees you from worrying about hosting, scaling, managing, monitoring, and maintaining solutions built with these services. When you use these capabilities to create [serverless](../../../logic-apps/logic-apps-overview.md) apps and solutions, you can just focus on the business logic and functionality. These services automatically scale to meet your needs, make automation workflows faster, and help you build robust cloud apps using little to no code.
2020

21+
## Function calling on Azure Logic Apps through the Assistants Playground
22+
2123
To accelerate and simplify the creation of intelligent applications, we are now enabling the ability to call Logic Apps workflows through function calling in Azure OpenAI Assistants.
2224

2325
The Assistants playground enumerates and lists all the workflows in your subscription that are eligible for function calling. Here are the requirements for these workflows:
2426

25-
* Consumption Logic Apps: Currently we only support consumption workflows.
26-
* Request Trigger: Function calling requires a REST-based API. Logic Apps with a request trigger provides a REST endpoint. Therefore only workflows with a request trigger are supported for function calling.
27+
* [Consumption Logic Apps](../../../logic-apps/quickstart-create-example-consumption-workflow.md): Currently we only support consumption workflows.
28+
* [Request trigger](../../../connectors/connectors-native-reqres.md?tabs=consumption): Function calling requires a REST-based API. Logic Apps with a request trigger provides a REST endpoint. Therefore only workflows with a request trigger are supported for function calling.
2729
* Schema: The workflows you want to use for function calling should have a JSON schema describing the inputs and expected outputs. Using Logic Apps you can streamline and provide schema in the trigger, which would be automatically imported as a function definition.
2830

29-
## Import your Logic Apps workflows as functions
30-
31-
Here are the steps to import your Logic Apps workflows as function in the Assistants playground in Azure OpenAI Studio:
32-
33-
1. In Azure OpenAI Studio, select **Assistants**. Select an existing Assistant or create a new one. After you have configured the assistant with a name and instructions, you are ready to add a function. Select **+ Add function**.
34-
35-
:::image type="content" source="..\media\how-to\assistants\logic-apps\assistants-playground-add-function.png" alt-text="A screenshot showing the Assistant playground with the add function button." lightbox="..\media\how-to\assistants\logic-apps\assistants-playground-add-function.png":::
36-
37-
1. The **Add function** option opens a screen with two tabs. Navigate to the tab for Logic Apps to browse your workflows with a request trigger. Select the workflow from list and select **Save**.
38-
39-
> [!NOTE]
40-
> This list only shows the consumption SKU workflows and with a request trigger.
41-
42-
43-
:::image type="content" source="..\media\how-to\assistants\logic-apps\import-logic-apps.png" alt-text="A screenshot showing the menu for adding functions." lightbox="..\media\how-to\assistants\logic-apps\import-logic-apps.png":::
44-
45-
You have now successfully imported your workflow and it is ready to be invoked. The function specification is generated based on the logic apps workflow swagger and includes the schema and description based on what you configured in the request trigger action.
46-
47-
:::image type="content" source="..\media\how-to\assistants\logic-apps\edit-function.png" alt-text="A screenshot showing the imported workflow." lightbox="..\media\how-to\assistants\logic-apps\edit-function.png":::
48-
49-
The workflow now will be invoked by the Azure OpenAI Assistants based on the user prompt. Below is an example where the workflow is invoked automatically based on user prompt to get the weather.
50-
51-
:::image type="content" source="..\media\how-to\assistants\logic-apps\playground-weather-example.png" alt-text="A screenshot showing a weather prompt example." lightbox="..\media\how-to\assistants\logic-apps\playground-weather-example.png":::
52-
53-
You can confirm the invocation by looking at the logs as well as your [workflow run history](../../../logic-apps/monitor-logic-apps.md?tabs=consumption.md#review-workflow-run-history).
54-
55-
56-
:::image type="content" source="..\media\how-to\assistants\logic-apps\example-log.png" alt-text="A screenshot showing a logging example." lightbox="..\media\how-to\assistants\logic-apps\example-log.png":::
57-
58-
## FAQ
59-
60-
### What happens when a Logic Apps is imported in AI Studio and invoked
61-
62-
**The Logic Apps swagger file is used to populate function definitions**
63-
64-
Azure Logic App publishes an OpenAPI 2.0 definition (swagger) for workflows with a request trigger based on [annotations on the workflow](/rest/api/logic/workflows/list-swagger). Users are able to modify the content of this swagger by updating their workflow. AI studio uses this to generate the function definitions that the Assistant requires.
65-
66-
**How does authentication from AI Studio to Logic Apps work?**
67-
68-
Logic Apps supports two primary types of authentications to invoke a request trigger.
69-
70-
* Shared Access Signature (SAS) based authentication.
71-
72-
Users can obtain a callback URL containing a SAS using the [list callback URL](/rest/api/logic/workflows/list-callback-url) API. Logic Apps also supports using multiple keys and rotating them as needed. Logic Apps also supports creating SAS URLs with a specified validity period. For more information, see the [Logic Apps documentation](../../../logic-apps/logic-apps-securing-a-logic-app.md#generate-shared-access-signatures-sas).
73-
74-
* Microsoft Entra ID-based OAuth base authentication policy.
75-
76-
Logic Apps also supports authentication trigger invocations with Microsoft Entra ID OAuth, where you can specify authentication policies to be used in validating OAuth tokens. For more information, see the [Logic Apps documentation](../../../logic-apps/logic-apps-securing-a-logic-app.md#generate-shared-access-signatures-sas).
77-
78-
When Azure OpenAI Assistants require invoking a Logic App as part of function calling, AI Studio will retrieve the callback URL with the SAS to invoke the workflow.
31+
If you already have workflows with above three requirements, you should be able to use them in AI Studio and invoke them via user prompts.
32+
If you do not have existing workflows, you can follow the steps in this article to create them. There are two primary steps:
33+
1. [Create a Logic App on Azure portal](#create-logic-apps-workflows-for-function-calling).
34+
2. [Import your Logic Apps workflows as a function in the Assistants Playground](#import-your-logic-apps-workflows-as-functions).
7935

8036
## Create Logic Apps workflows for function calling
37+
8138
Here are the steps to create a new Logic Apps workflow for function calling.
8239

8340
1. In the Azure portal search box, enter **logic apps**, and select **Logic apps**.
@@ -129,8 +86,59 @@ Here are the steps to create a new Logic Apps workflow for function calling.
12986

13087
:::image type="content" source="..\media\how-to\assistants\logic-apps\assistants-playground-add-function.png" alt-text="A screenshot showing the Assistant playground." lightbox="..\media\how-to\assistants\logic-apps\assistants-playground-add-function.png":::
13188

89+
## Import your Logic Apps workflows as functions
90+
91+
Here are the steps to import your Logic Apps workflows as function in the Assistants playground in Azure OpenAI Studio:
92+
93+
1. In Azure OpenAI Studio, select **Assistants**. Select an existing Assistant or create a new one. After you have configured the assistant with a name and instructions, you are ready to add a function. Select **+ Add function**.
94+
95+
:::image type="content" source="..\media\how-to\assistants\logic-apps\assistants-playground-add-function.png" alt-text="A screenshot showing the Assistant playground with the add function button." lightbox="..\media\how-to\assistants\logic-apps\assistants-playground-add-function.png":::
96+
97+
1. The **Add function** option opens a screen with two tabs. Navigate to the tab for Logic Apps to browse your workflows with a request trigger. Select the workflow from list and select **Save**.
98+
99+
> [!NOTE]
100+
> This list only shows the consumption SKU workflows and with a request trigger.
101+
102+
103+
:::image type="content" source="..\media\how-to\assistants\logic-apps\import-logic-apps.png" alt-text="A screenshot showing the menu for adding functions." lightbox="..\media\how-to\assistants\logic-apps\import-logic-apps.png":::
104+
105+
You have now successfully imported your workflow and it is ready to be invoked. The function specification is generated based on the logic apps workflow swagger and includes the schema and description based on what you configured in the request trigger action.
106+
107+
:::image type="content" source="..\media\how-to\assistants\logic-apps\edit-function.png" alt-text="A screenshot showing the imported workflow." lightbox="..\media\how-to\assistants\logic-apps\edit-function.png":::
108+
109+
The workflow now will be invoked by the Azure OpenAI Assistants based on the user prompt. Below is an example where the workflow is invoked automatically based on user prompt to get the weather.
110+
111+
:::image type="content" source="..\media\how-to\assistants\logic-apps\playground-weather-example.png" alt-text="A screenshot showing a weather prompt example." lightbox="..\media\how-to\assistants\logic-apps\playground-weather-example.png":::
112+
113+
You can confirm the invocation by looking at the logs as well as your [workflow run history](../../../logic-apps/monitor-logic-apps.md?tabs=consumption.md#review-workflow-run-history).
114+
115+
116+
:::image type="content" source="..\media\how-to\assistants\logic-apps\example-log.png" alt-text="A screenshot showing a logging example." lightbox="..\media\how-to\assistants\logic-apps\example-log.png":::
117+
118+
## FAQ
119+
120+
**What are Logic App connectors?**
121+
132122
Azure Logic Apps has connectors to hundreds of line-of-business (LOB) applications and databases including but not limited to: SAP, Salesforce, Oracle, SQL, and more. You can also connect to SaaS applications or your in-house applications hosted in virtual networks. These out of box connectors provide operations to send and receive data in multiple formats. Leveraging these capabilities with Azure OpenAI assistants, you should be able to quickly bring your data for Intelligent Insights powered by Azure OpenAI.
133123

124+
**What happens when a Logic Apps is imported in AI Studio and invoked**
125+
126+
The Logic Apps swagger file is used to populate function definitions. Azure Logic App publishes an OpenAPI 2.0 definition (swagger) for workflows with a request trigger based on [annotations on the workflow](/rest/api/logic/workflows/list-swagger). Users are able to modify the content of this swagger by updating their workflow. AI studio uses this to generate the function definitions that the Assistant requires.
127+
128+
**How does authentication from AI Studio to Logic Apps work?**
129+
130+
Logic Apps supports two primary types of authentications to invoke a request trigger.
131+
132+
* Shared Access Signature (SAS) based authentication.
133+
134+
Users can obtain a callback URL containing a SAS using the [list callback URL](/rest/api/logic/workflows/list-callback-url) API. Logic Apps also supports using multiple keys and rotating them as needed. Logic Apps also supports creating SAS URLs with a specified validity period. For more information, see the [Logic Apps documentation](../../../logic-apps/logic-apps-securing-a-logic-app.md#generate-shared-access-signatures-sas).
135+
136+
* Microsoft Entra ID-based OAuth base authentication policy.
137+
138+
Logic Apps also supports authentication trigger invocations with Microsoft Entra ID OAuth, where you can specify authentication policies to be used in validating OAuth tokens. For more information, see the [Logic Apps documentation](../../../logic-apps/logic-apps-securing-a-logic-app.md#generate-shared-access-signatures-sas).
139+
140+
When Azure OpenAI Assistants require invoking a Logic App as part of function calling, AI Studio will retrieve the callback URL with the SAS to invoke the workflow.
141+
134142
## See also
135143

136144
* [Learn more about Assistants](../concepts/assistants.md)

0 commit comments

Comments
 (0)