You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -39,15 +39,15 @@ Azure Logic Apps supports 1,400+ connectors and native, built-in data operations
39
39
40
40
This article shows how to a workflow from Azure Logic Apps as an agent action tool in Foundry. A wizard guides you through how to set up the action. You can then edit the workflow or extend the workflow in the workflow designer for Azure Logic Apps.
41
41
42
-
> [!NOTE]
43
-
>
44
-
> This article refers to the [Microsoft Foundry (classic)](/azure/foundry-classic/what-is-foundry#microsoft-foundry-portals) portal. For more information about the new portal, see the new [Microsoft Foundry portal](/azure/foundry/what-is-foundry)?
45
-
46
42
For more information, see:
47
43
48
44
-[What is Azure Logic Apps?](/azure/logic-apps/logic-apps-overview)
> This article refers to the [Microsoft Foundry (classic)](/azure/foundry-classic/what-is-foundry#microsoft-foundry-portals) portal. For more information about the new portal, see the new [Microsoft Foundry portal](/azure/foundry/what-is-foundry)
50
+
51
51
## Prerequisites
52
52
53
53
- An Azure account and subscription. [Get a free Azure account](https://azure.microsoft.com/pricing/purchase-options/azure-account?cid=msft_learn).
@@ -90,10 +90,10 @@ For more information, see:
90
90
91
91
:::image type="content" source="media/add-agent-action-create-run-workflow/foundry-logic-apps-arch.png" alt-text="Architecture diagram that shows relationship between example agent in Foundry and example logic app workflow in multitenant Azure Logic Apps." border="false" lightbox="media/add-agent-action-create-run-workflow/foundry-logic-apps-arch.png":::
92
92
93
-
For more information, see:
93
+
For more information, see:
94
94
95
-
-[Quickstart: Create an example Consumption logic app workflow using the Azure portal](/azure/logic-apps/quickstart-create-example-consumption-workflow)
96
-
-[What are connectors in Azure Logic Apps](/azure/connectors/introduction)
95
+
-[Quickstart: Create an example Consumption logic app workflow using the Azure portal](/azure/logic-apps/quickstart-create-example-consumption-workflow)
96
+
-[What are connectors in Azure Logic Apps](/azure/connectors/introduction)
97
97
98
98
- Set up the following environment variables with information from your Foundry project:
99
99
@@ -251,6 +251,20 @@ To try the new agent action by using the **Agents playground**, follow these ste
251
251
252
252
:::image type="content" source="media/add-agent-action-create-run-workflow/test-action.png" alt-text="Screenshot shows Foundry window with Agents playground page, test prompt about London weather with format instructions, and response." lightbox="media/add-agent-action-create-run-workflow/test-action.png":::
253
253
254
+
## 6: Delete resources
255
+
256
+
If you don't need the resources that you created for this guide, delete them so you don't continue getting charged. You can either follow these steps to delete the resource group that contains these resources, or you can delete each resource individually.
257
+
258
+
1. In the Foundry portal, to remove the action from the agent, next to the action name, select the ellipses (**...**) button, and then select **Remove**.
259
+
260
+
1. In the [Azure portal](https://portal.azure.com) title bar search box, enter **resource groups**, and select **Resource groups**.
261
+
262
+
1. Find the resource group that contains your deployed hub resources.
263
+
264
+
1. On the **Overview** page toolbar, select **Delete resource group**.
265
+
266
+
1. When the confirmation pane appears, enter the resource group name, and select **Delete**.
Register your Consumption logic app workflow by providing its name and trigger information. For the sample code, see the [AzureLogicAppTool utility on GitHub](https://github.com/azure-ai-foundry/foundry-samples/blob/main/samples-classic/python/getting-started-agents/logic_apps/user_logic_apps.py).
309
+
Register your Consumption logic app resource by providing the trigger name and information. To find the `AzureLogicAppTool` utility code, visit the [full sample on GitHub](https://github.com/azure-ai-foundry/foundry-samples/blob/main/samples-classic/python/getting-started-agents/logic_apps/user_logic_apps.py).
296
310
297
311
```python
298
312
from user_logic_apps import AzureLogicAppTool
299
313
300
-
# Extract subscription and resource group from environment variables
314
+
# Logic app details
315
+
LOGIC_APP_NAME="your_logic_app_name"
316
+
TRIGGER_NAME="your_trigger_name"
317
+
318
+
# Register the logic app name with the agent tool utility by extracting the following values from environment variables
print(f"Registered logic app '{LOGIC_APP_NAME}' with trigger '{TRIGGER_NAME}'.")
312
326
```
313
327
314
-
## 4: Create an agent and connect a logic app workflow as a tool through an action
328
+
## 4: Create an agent with a logic app workflow as an action (tool)
315
329
316
-
The following code creates an agent and adds an action that runs a logic app workflow as a tool. For this example, the logic app workflow sends an email.
330
+
The following code creates an agent and attaches the logic app as an agent action or tool. In this example, the logic app workflow sends an email.
317
331
318
332
```python
319
333
from azure.ai.agents.models import ToolSet, FunctionTool
320
334
from user_functions import fetch_current_datetime
321
335
from user_logic_apps import create_send_email_function
322
336
323
-
# Create the specialized "send_email_via_logic_app" function
Delete the agent when you finish to clean up resources so you don't continue getting charged.
401
+
402
+
```python
403
+
# Delete the agent
404
+
project_client.agents.delete_agent(agent.id)
405
+
print("Deleted agent.")
377
406
```
378
407
379
408
:::zone-end
@@ -458,144 +487,7 @@ If you make changes to the weather workflow or want to test a different workflow
458
487
459
488
On the **Output** tab, the **Response Body** contains the results and response from the workflow.
460
489
461
-
1. If your workflow run produces errors or requires troubleshooting, open the workflow's run history. Examine each operation's inputs and outputs by using the relevant steps in [View workflow run history](view-workflow-status-run-history.md)).
462
-
463
-
## 6: Delete resources
464
-
465
-
If you don't need the resources that you created for this guide, delete them so you don't continue getting charged. You can either follow these steps to delete the resource group that contains these resources, or you can delete each resource individually.
466
-
467
-
1. In the Foundry portal, to remove the action from the agent, next to the action name, select the ellipses (**...**) button, and then select **Remove**.
468
-
469
-
1. In the [Azure portal](https://portal.azure.com) title bar search box, enter **resource groups**, and select **Resource groups**.
470
-
471
-
1. Find the resource group that contains your deployed hub resources.
472
-
473
-
1. On the **Overview** page toolbar, select **Delete resource group**.
474
-
475
-
1. When the confirmation pane appears, enter the resource group name, and select **Delete**.
476
-
477
-
:::zone-end
478
-
479
-
:::zone pivot="python"
480
-
481
-
## 1: Create a project client
482
-
483
-
To connect to your Foundry project and other resources, follow these steps to create a client object:
484
-
485
-
```python
486
-
import os
487
-
from azure.ai.projects import AIProjectClient
488
-
from azure.identity import DefaultAzureCredential
489
-
490
-
# Initialize the AIProjectClient
491
-
project_client = AIProjectClient(
492
-
endpoint=os.environ["PROJECT_ENDPOINT"],
493
-
credential=DefaultAzureCredential()
494
-
)
495
-
```
496
-
497
-
## 2: Register your logic app
498
-
499
-
Register your Consumption logic app resource by providing the trigger name and information. To find the `AzureLogicAppTool` utility code, visit the [full sample on GitHub](https://github.com/azure-ai-foundry/foundry-samples/blob/main/samples-classic/python/getting-started-agents/logic_apps/user_logic_apps.py).
500
-
501
-
```python
502
-
from user_logic_apps import AzureLogicAppTool
503
-
504
-
# Logic app details
505
-
LOGIC_APP_NAME="your_logic_app_name"
506
-
TRIGGER_NAME="your_trigger_name"
507
-
508
-
# Register the logic app name with the agent tool utility by extracting the following values from environment variables
Delete the agent when you finish to clean up resources so you don't continue getting charged.
591
-
592
-
```python
593
-
# Delete the agent
594
-
project_client.agents.delete_agent(agent.id)
595
-
print("Deleted agent.")
596
-
```
597
-
598
-
:::zone-end
490
+
1. If your workflow run produces errors or requires troubleshooting, open the workflow's run history. Examine each operation's inputs and outputs by using the relevant steps in [View workflow run history](view-workflow-status-run-history.md).
0 commit comments