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
Copy file name to clipboardExpand all lines: articles/logic-apps/call-azure-functions-from-workflows.md
+27-22Lines changed: 27 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,9 @@
1
1
---
2
-
title: Call Azure Functions from workflows in Azure Logic Apps
3
-
description: Learn how to call and run functions in Azure Functions from workflows in Azure Logic Apps. Extend workflows with custom code, advanced computations, and dynamic data processing.
4
-
services: logic-apps, azure-functions
2
+
title: Call Azure Functions from Workflows
3
+
description: Call and run functions in Azure Functions from workflows in Azure Logic Apps by creating custom code to perform advanced calculations or process dynamic data.
Azure Logic Apps and Azure Functions work together so that you can extend and enhance your integration workflows with custom code execution, advanced computations, and dynamic data processing. When you create functions in Azure Functions, you can call and run these functions from your workflows. The Azure Functions platform lets you run code without building a complete app or setting up separate infrastructure and provides cloud-based computing that can perform tasks. For example:
18
+
To extend your workflows with custom code that performs advanced computations or processes dynamic data, create and call functions in Azure Functionsfrom workflows in Azure Logic Apps. When you create functions in Azure Functions, you can complete tasks like the following:
19
19
20
-
-Extend your workflow's behavior by running functions created by using C# or Node.js.
21
-
- Perform calculations in your workflow.
20
+
-Run functions created by using C# or Node.js.
21
+
- Perform advanced calculations in your workflow.
22
22
- Apply advanced formatting or compute fields in your workflow.
23
23
24
-
This guide shows how to call and run a function in Azure Functions from your Azure Logic Apps workflow, whether you're using the Consumption or Standard plan. You also learn about prerequisites, limitations, and tips for working with Azure Functions to ensure seamless integration and optimal performance. For more information, see [Azure Functions](../azure-functions/functions-overview.md) and [Azure Logic Apps](logic-apps-overview.md).
24
+
This guide shows how to call and run a function in Azure Functions from your Consumption or Standard workflow in Azure Logic Apps. You also learn about the prerequisites, limitations, and tips for working with Azure Functions to ensure seamless integration and optimal performance.
25
25
26
-
> [!NOTE]
26
+
> [!TIP]
27
27
>
28
-
> If you want to run code without using Azure Functions, see:
28
+
> To run code without using Azure Functions, see:
29
29
>
30
30
> -[Run code snippets in workflows](logic-apps-add-run-inline-code.md)
31
31
> -[Create and run .NET code from Standard workflows in Azure Logic Apps](create-run-custom-code-functions.md)
For Azure Functions to operate correctly in your workflow, the following limitations apply:
40
+
For Azure Functions to operate correctly in your workflow, review the following limitations:
36
41
37
42
- Function app resources must use either the .NET or Node.js runtime stack.
38
43
39
-
- Functions must use either C# or JavaScript code.
44
+
- Functions must be written in either C# or JavaScript code.
40
45
41
46
- Functions must use the **HTTP trigger** template.
42
47
@@ -60,7 +65,7 @@ For Azure Functions to operate correctly in your workflow, the following limitat
60
65
61
66
- An [Azure function app resource](../azure-functions/functions-get-started.md), which can contain one or more Azure functions.
62
67
63
-
Make sure to use the same Azure subscription for your function app resource and logic app resource.
68
+
Make sure that your function app resource and logic app resource exist in the same Azure subscription.
64
69
65
70
- The Azure function to call from your workflow.
66
71
@@ -115,7 +120,7 @@ For Azure Functions to operate correctly in your workflow, the following limitat
115
120
116
121
For example, you can start the workflow with the general **HTTP** or **Request** trigger, or you can use a service-based trigger, such as **Azure Queues** or **Event Grid**. Inside your function, send an HTTP POST request to the trigger's URL and include the payload that you want your secondary workflow to process. For more information, see [Call, trigger, or nest logic app workflows](logic-apps-http-endpoint.md).
117
122
118
-
## Tips for working with Azure functions
123
+
## Tips for working with Azure Functions
119
124
120
125
<a name="open-ai-definition"></a>
121
126
@@ -131,7 +136,7 @@ To set up your function app so that your workflow can find and use functions tha
131
136
132
137
1. Under **Allowed Origins**, add the asterisk (*) wildcard character, remove any origins in the list, and then select **Save**.
133
138
134
-
:::image type="content" source="media/call-azure-functions-from-workflows/function-cors-origins.png" alt-text="Screenshot that shows Azure portal, CORS pane, and the * wildcard character entered under Allowed Origins." lightbox="media/call-azure-functions-from-workflows/function-cors-origins.png":::
139
+
:::image type="content" source="media/call-azure-functions-from-workflows/function-cors-origins.png" alt-text="Screenshot that shows the Azure portal, function app, and CORS pane with * entered under Allowed Origins." lightbox="media/call-azure-functions-from-workflows/function-cors-origins.png":::
135
140
136
141
### Access the property values in HTTPS requests
137
142
@@ -188,7 +193,7 @@ To call an Azure function from your workflow, add that function like any other a
188
193
189
194
### [Consumption](#tab/consumption)
190
195
191
-
1. In the [Azure portal](https://portal.azure.com), open your Consumption logic app resource, and then open the workflow in the designer.
196
+
1. In the [Azure portal](https://portal.azure.com), open your Consumption logic app resource. Open the workflow in the designer.
192
197
193
198
1. In the designer, follow the [general steps](create-workflow-with-trigger-or-action.md?tabs=consumption#add-action) to add the **Azure Functions** action named **Choose an Azure function**.
194
199
@@ -198,7 +203,7 @@ To call an Azure function from your workflow, add that function like any other a
198
203
199
204
1. Select the function, and then select **Add action**, for example:
200
205
201
-
:::image type="content" source="media/call-azure-functions-from-workflows/select-function-app-function-consumption.png" alt-text="Screenshot that shows the Consumption workflow opened in the Logic app designer with a selected function app and function in the Add an action pane.":::
206
+
:::image type="content" source="media/call-azure-functions-from-workflows/select-function-app-function-consumption.png" alt-text="Screenshot that shows the Consumption workflow designer with a selected function app and function in Add an action.":::
202
207
203
208
1. After the function's information box appears, follow these steps:
204
209
@@ -214,23 +219,23 @@ To call an Azure function from your workflow, add that function like any other a
214
219
215
220
The following example specifies a JSON object with the `content` attribute and the **From** output value from the email trigger as the **Request Body** value:
216
221
217
-
:::image type="content" source="media/call-azure-functions-from-workflows/function-request-body-example-consumption.png" alt-text="Screenshot that shows a Consumption workflow and a function with a Request Body example for the context object payload.":::
222
+
:::image type="content" source="media/call-azure-functions-from-workflows/function-request-body-example-consumption.png" alt-text="Screenshot that shows a Consumption workflow with a Request Body example for the function context object payload.":::
218
223
219
224
In this case, the context object isn't cast as a string. The object's content is directly added to the JSON payload. The following image shows the finished example:
220
225
221
-
:::image type="content" source="media/call-azure-functions-from-workflows/request-body-example-complete.png" alt-text="Screenshot that shows a Consumption workflow and a function with a finished Request Body example for the context object payload.":::
226
+
:::image type="content" source="media/call-azure-functions-from-workflows/request-body-example-complete.png" alt-text="Screenshot that shows a Consumption workflow and a function with a completed Request Body example for the function context object payload.":::
222
227
223
228
If you enter a context object other than a JSON token that passes a string, a JSON object, or a JSON array, you receive an error. However, you can cast the context object as a string by enclosing the token in quotation marks (" "). For example, if you wanted to use the **Received Time** output value:
224
229
225
-
:::image type="content" source="media/call-azure-functions-from-workflows/function-request-body-string-cast-example.png" alt-text="Screenshot that shows a Consumption workflow and a Request Body example that casts a context object as a string.":::
230
+
:::image type="content" source="media/call-azure-functions-from-workflows/function-request-body-string-cast-example.png" alt-text="Screenshot that shows a Consumption workflow with a Request Body example that casts a context object as a string.":::
226
231
227
232
1. To enter other information such as the method to use, request headers, query parameters, or authentication, open the **Advanced parameters** list, and select the parameters you want.
228
233
229
234
For authentication, your options differ based on your selected function. For more information, see [Enable authentication for functions](#enable-authentication-functions).
230
235
231
236
### [Standard](#tab/standard)
232
237
233
-
1. In the [Azure portal](https://portal.azure.com), open your Standard logic app resource, and then open the workflow in the designer.
238
+
1. In the [Azure portal](https://portal.azure.com), open your Standard logic app resource. Open the workflow in the designer.
234
239
235
240
1. In the designer, follow the [general steps](create-workflow-with-trigger-or-action.md?tabs=standard#add-action) to add the **Azure Functions** action named **Call an Azure function**.
236
241
@@ -242,7 +247,7 @@ To call an Azure function from your workflow, add that function like any other a
242
247
243
248
1. Select the function, and then select **Create new**, for example:
244
249
245
-
:::image type="content" source="media/call-azure-functions-from-workflows/select-function-app-function-standard.png" alt-text="Screenshot that shows the Standard workflow designer with page with a selected function app and function in a Create connection pane.":::
250
+
:::image type="content" source="media/call-azure-functions-from-workflows/select-function-app-function-standard.png" alt-text="Screenshot that shows the Standard workflow designer with a selected function app and function in Create connection.":::
246
251
247
252
1. After the function's information box appears, follow these steps:
0 commit comments