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
> This method provides optimal and superior security without having to provide credentials. Azure manages
14
+
> this identity for you and helps keep authentication information secure so that you don't have to manage
15
+
> this sensitive information. To set up a managed identity for Azure Logic Apps, see
16
+
> [Authenticate access and connections to Azure resources with managed identities in Azure Logic Apps](/azure/logic-apps/authenticate-with-managed-identity).
17
+
>
18
+
> If you need to use a different authentication type, use next highest level security option available.
19
+
> For example, suppose that you have to use connection strings instead. A connection string
20
+
> includes the authorization information required for your app to access a specific resource, service,
21
+
> or system. The access key in the connection string is similar to a root password.
22
+
>
23
+
> In production environments, always protect your access keys. Make sure to secure your connection string
24
+
> using Microsoft Entra ID, and use [Azure Key Vault](https://go.microsoft.com/fwlink/?linkid=2300117)
25
+
> to securely store and rotate your keys. Avoid distributing access keys to other users, hardcoding them,
26
+
> or saving them anywhere in plain text where others can access. Rotate your keys as soon as possible
Copy file name to clipboardExpand all lines: articles/logic-apps/logic-apps-batch-process-send-receive-messages.md
+45-28Lines changed: 45 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,15 +53,18 @@ Your batch receiver and batch sender need to share the same Azure subscription *
53
53
54
54
Before you can send messages to a batch, that batch must first exist as the destination where you send those messages. So first, you must create the "batch receiver" logic app workflow, which starts with the **Batch Trigger**. That way, when you create the "batch sender" logic app workflow, you can select the batch receiver logic app workflow. The batch receiver continues collecting messages until your specified criteria is met for releasing and processing those messages. While batch receivers don't need to know anything about batch senders, batch senders must know the destination where they send the messages.
55
55
56
-
1. In the [Azure portal](https://portal.azure.com), create a logic app workflow with the name **BatchReceiver**.
56
+
1. In the [Azure portal](https://portal.azure.com), create a logic app resource with a blank workflow.
57
+
58
+
This example creates a batch receiver.
59
+
1. with the name **BatchReceiver**.
57
60
58
61
1. On the workflow designer, select **Add a trigger**, and [follow these general steps to add the **Batch Operations** trigger named **Batch Trigger**](create-workflow-with-trigger-or-action.md#add-trigger).
59
62
60
63
1. Set the following trigger properties:
61
64
62
65
| Property | Description |
63
66
|----------|-------------|
64
-
|**Mode** <br>(Consumption workflows only) | - **Inline**: For defining release criteria inside the batch trigger <br><br>- **Integration Account**: For defining multiple release criteria configurations through an integration account. With an integration account, you can maintain these configurations all in one place rather than in separate logic apps. |
67
+
|**Mode** <br>(Consumption workflows only) | - **Inline**: For defining release criteria inside the batch trigger <br><br>- **Integration Account**: For defining multiple release criteria configurations through an integration account. With an integration account, you can maintain these configurations all in one place rather than in separate logic app resources. |
65
68
|**Batch Name**| The name for your batch. In Consumption workflows, this property appears only when **Mode** is set to **Inline**. This example uses **TestBatch**. |
66
69
|**Release Criteria**| The criteria to meet before processing each batch. By default, the batch trigger operates using "inline mode" where you define the batch release criteria inside the batch trigger. <br><br>- **Message count based**: Release the batch based on the number of messages collected by the batch. <br><br>- **Size based**: Release the batch based on the total size in bytes for all messages collected by that batch. <br><br>- **Schedule based**: Release the batch based on a recurrence schedule, which specifies an interval and frequency. You can optionally select a time zone and provide a start date and time. <br><br>To use all the specified criteria, select all the options. |
67
70
|**Message Count**| The number of messages to collect in the batch, for example, 10 messages. The batch message limit is 8,000 messages. |
@@ -95,9 +98,9 @@ Before you can send messages to a batch, that batch must first exist as the dest
95
98
96
99
* Select inside the **Subject** box to view the options for the dynamic content list (lightning icon) and expression editor (function icon). Select the lightning icon to open the dynamic content list, and select the field named **Partition Name**.
97
100
98
-
:::image type="content" source="media/logic-apps-batch-process-send-receive-messages/send-email-action-details.png" alt-text="Screenshot shows dynamic content list and selected field for Partition Name.":::
101
+
:::image type="content" source="media/logic-apps-batch-process-send-receive-messages/send-email-action-details.png" alt-text="Screenshot shows dynamic content list and selected field for Partition Name property.":::
99
102
100
-
Later, in the batch sender, you can specify a unique partition key that divides the target batch into logical subsets where you can send messages. Each set has a unique number that's generated by the batch sender logic app. This capability lets you use a single batch with multiple subsets and define each subset with the name that you provide.
103
+
Later, in the batch sender, you can specify a unique partition key that divides the target batch into logical subsets where you can send messages. Each set has a unique number that's generated by the batch sender logic app workflow. This capability lets you use a single batch with multiple subsets and define each subset with the name that you provide.
101
104
102
105
> [!IMPORTANT]
103
106
>
@@ -117,13 +120,14 @@ Before you can send messages to a batch, that batch must first exist as the dest
117
120
> [!IMPORTANT]
118
121
>
119
122
> If you're using Visual Studio Code, before you continue to the next section, make sure that you first
120
-
> [*deploy* your batch receiver logic app to Azure](/azure/logic-apps/quickstart-create-logic-apps-visual-studio-code). Otherwise, you can't select the batch receiver when you create the batch sender.
123
+
> [*deploy* your batch receiver logic app resource to Azure](/azure/logic-apps/quickstart-create-logic-apps-visual-studio-code).
124
+
> Otherwise, you can't select the batch receiver logic app workflow when you create the batch sender logic app workflow.
121
125
122
126
<aname="batch-sender"></a>
123
127
124
128
## Create batch sender
125
129
126
-
Now create one or more batch sender logic app workflows that send messages to the batch receiver logic app. In each batch sender, you specify the batch receiver and batch name, message content, and any other settings. You can optionally provide a unique partition key to divide the batch into logical subsets for collecting messages with that key.
130
+
Now create one or more batch sender logic app workflows that send messages to the batch receiver logic app workflow. In each batch sender, you specify the batch receiver and batch name, message content, and any other settings. You can optionally provide a unique partition key to divide the batch into logical subsets for collecting messages with that key.
127
131
128
132
* Make sure that you previously [created and deployed your batch receiver](#batch-receiver) so when you create your batch sender, you can select the existing batch receiver as the destination batch. While batch receivers don't need to know anything about batch senders, batch senders must know where to send messages.
129
133
@@ -133,9 +137,8 @@ Now create one or more batch sender logic app workflows that send messages to th
133
137
134
138
> [!NOTE]
135
139
>
136
-
> If you have a Standard logic app, make sure to create a stateful workflow,
137
-
> not a stateless workflow because the **Recurrence** trigger is unavailable
138
-
> for stateless workflows.
140
+
> If you have a Standard logic app resource, make sure to create a stateful workflow, not a
141
+
> stateless workflow because the **Recurrence** trigger is unavailable for stateless workflows.
139
142
140
143
1.[Follow these general steps to add the **Schedule** trigger named **Recurrence**](create-workflow-with-trigger-or-action.md#add-trigger).
141
144
@@ -151,25 +154,25 @@ Now create one or more batch sender logic app workflows that send messages to th
151
154
152
155
**Consumption workflow**
153
156
154
-
After you add the **Send to batch trigger worklow** action, a list appears and shows only the logic app resources with batch triggers that exist in the same Azure subscription *and* Azure region as your batch sender logic app.
157
+
After you add the **Send to batch trigger worklow** action, a list appears and shows only the logic app resources with batch triggers that exist in the same Azure subscription *and* Azure region as your batch sender logic app resource.
158
+
159
+
1. From the logic apps list, select the previously created logic app to use as the batch receiver. When the available triggers appear, select the trigger named **Batch_messages**.
155
160
156
-
1. From the logic apps list, select the batch receiver logic app that you previously created. When the available triggers appear, select the trigger named **Batch_messages**.
161
+
:::image type="content" source="media/logic-apps-batch-process-send-receive-messages/batch-sender-select-batch-receiver-consumption.png" alt-text="Screenshot shows Consumption workflow with Recurrence trigger and batch sender action that selects a batch receiver logic app resource and trigger.":::
157
162
158
163
> [!IMPORTANT]
159
164
>
160
-
> If you're using Visual Studio Code, and you don't see any batch receivers to select,
161
-
> check that you previously created and deployed your batch receiver to Azure. If you haven't, learn
162
-
> [how to deploy your batch receiver logic app to Azure](/azure/logic-apps/quickstart-create-logic-apps-visual-studio-code).
163
-
164
-
:::image type="content" source="media/logic-apps-batch-process-send-receive-messages/batch-sender-select-batch-receiver-consumption.png" alt-text="Screenshot shows action named Send to batch trigger workflow, along with selected batch receiver logic app and action.":::
165
+
> If you're using Visual Studio Code, and you don't see any batch receivers to select, check that
166
+
> you previously created and deployed your batch receiver to Azure. If you haven't, learn
167
+
> [how to deploy your batch receiver logic app resource to Azure](/azure/logic-apps/quickstart-create-logic-apps-visual-studio-code).
165
168
166
169
1. When you're done, select **Add action**.
167
170
168
171
**Standard workflow**
169
172
170
173
After you add the **Send to batch** action, the action pane shows the following properties in the next step for you to specify the batch name, message content, workflow name, and trigger name. You can specify information only for a batch receiver logic app workflow with a batch trigger that exists in the same Azure subscription *and* Azure region as your batch sender logic app.
171
174
172
-
:::image type="content" source="media/logic-apps-batch-process-send-receive-messages/batch-sender-standard.png" alt-text="Screenshot shows Standard workflow named BatchSender with action named Send to batch.":::
175
+
:::image type="content" source="media/logic-apps-batch-process-send-receive-messages/batch-sender-standard.png" alt-text="Screenshot shows Standard workflow with Recurrence trigger and action named Send to batch.":::
173
176
174
177
1. Set the following batch receiver action properties:
175
178
@@ -189,11 +192,17 @@ Now create one or more batch sender logic app workflows that send messages to th
189
192
190
193
1. In the editor, enter the function named **utcnow()**, and select **Add**.
191
194
192
-
:::image type="content" source="media/logic-apps-batch-process-send-receive-messages/batch-sender-details.png" alt-text="Screenshot shows BatchReceiver action pane, Message Content box with cursor, expression editor with utcNow function, and other details.":::
195
+
**Consumption workflow**
196
+
197
+
:::image type="content" source="media/logic-apps-batch-process-send-receive-messages/batch-sender-details-consumption.png" alt-text="Screenshot shows Consumption workflow, batch sender action pane, Message Content box with cursor, expression editor with utcNow function, and other details.":::
198
+
199
+
**Standard workflow**
200
+
201
+
:::image type="content" source="media/logic-apps-batch-process-send-receive-messages/batch-sender-details-standard.png" alt-text="Screenshot shows Standard workflow, batch sender action pane, Message Content box with cursor, expression editor with utcNow function, and other details.":::
193
202
194
203
1. Now set up a partition for the batch.
195
204
196
-
1. In the **BatchReceiver** action pane, from the **Advanced parameters** list, and select the following properties:
205
+
1. In the batch sender action pane, from the **Advanced parameters** list, and select the following properties:
197
206
198
207
| Property | Description |
199
208
|----------|-------------|
@@ -206,23 +215,31 @@ Now create one or more batch sender logic app workflows that send messages to th
206
215
207
216
This example generates a number between one and five. So, you're dividing this batch into five numbered partitions, which this expression dynamically sets.
208
217
209
-
:::image type="content" source="media/logic-apps-batch-process-send-receive-messages/batch-sender-partition-advanced-options.png" alt-text="Screenshot shows adding the rand() function to divide the batch into partitions.":::
218
+
:::image type="content" source="media/logic-apps-batch-process-send-receive-messages/batch-sender-partition.png" alt-text="Screenshot shows function named rand for dividing batch into partitions.":::
210
219
211
-
1. Save your workflow.
220
+
When you're done, your batch sender workflow now looks similar to the following example, based on your logic app workflow type:
221
+
222
+
**Consumption workflow**
212
223
213
-
Your sender logic app now looks similar to this example:
To test your batching solution, leave your logic apps running for a few minutes. Soon, you start getting emails in groups of five, all with the same partition key.
234
+
To test your batching solution, leave your logic app workflows running for a few minutes. Soon, you start getting emails in groups of five, all with the same partition key.
220
235
221
236
Your batch sender logic app runs every minute and generates a random number between one and five. The batch sender uses this random number as the partition key for the target batch where you send the messages. Each time the batch has five items with the same partition key, your batch receiver logic app fires and sends mail for each message.
222
237
223
238
> [!IMPORTANT]
224
-
> When you're done testing, make sure that you disable the `BatchSender` logic app to stop sending messages and avoid overloading your inbox.
239
+
>
240
+
> When you're done testing, make sure that you disable or delete your **BatchSender**
241
+
> logic app workflow to stop sending messages and avoid overloading your inbox.
225
242
226
-
## Next steps
243
+
## Related content
227
244
228
-
*[Batch and send EDI messages](../logic-apps/logic-apps-scenario-edi-send-batch-messages.md)
245
+
*[Batch and send EDI messages](/azure/logic-apps/logic-apps-scenario-edi-send-batch-messages)
0 commit comments