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
+ Integrate with external services using existing connectors like Outlook, Microsoft Teams, Slack and PagerDuty, or by configuring the Logic App for your own services.
25
25
26
-
In this example, we'll use the following steps to create a Logic App that uses the [common alerts schema](./alerts-common-schema.md) to send details from the alert. The example uses the following steps:
26
+
In this example, the following steps create a Logic App that uses the [common alerts schema](./alerts-common-schema.md) to send details from the alert. The example uses the following steps:
27
27
28
28
1.[Create a Logic App](#create-a-logic-app) for sending an email or a Teams post.
29
29
1.[Create an alert action group](#create-an-action-group) that triggers the logic app.
@@ -110,21 +110,31 @@ In this example, we'll use the following steps to create a Logic App that uses t
110
110
```
111
111
112
112
113
-
1. (Optional). You can customize the alert notification by extracting information about the resource using resource tags. You can then include those resource tags to the alert payload and use the information in your logical expressions for sending the notifications. In this case, we are going to create a variable for the Affected Resource IDs and split them into in an array to add to the payload. You can then use these values to customize the alert notification.
114
-
1. Select the **+** icon to insert a new step.
113
+
1. (Optional). You can customize the alert notification by extracting information about the resource using resource tags. You can then include those resource tags to the alert payload and use the information in your logical expressions for sending the notifications. Create a variable for the Affected Resource IDs and split them into in an array to add to the payload. You can then use these values to customize the alert notification.
114
+
1. Select **+** and **Add an action** to insert a new step.
115
115
116
-
:::image type="content" source="./media/alerts-logic-apps/configure-http-request-received.png" alt-text="A screenshot showing the parameters for the when http request received step.":::
116
+
:::image type="content" source="./media/alerts-logic-apps/configure-http-request-received.png" alt-text="A screenshot showing the parameters for the http request received step.":::
117
117
118
-
1. In the **Search** field, search for and select enter **Initialize variable**.
118
+
1. In the **Search** field, search for and select **Initialize variable**.
119
119
1. In the **Name** field, enter the name of the variable, such as 'AffectedResources'.
120
-
1. In the type field, select **Array**.
121
-
1. In the **Value** field, select **Dynamic Content**. In the **Expression** tab, enter:
:::image type="content" source="./media/alerts-logic-apps/initialize-variable.png" alt-text="A screenshot showing the parameters for the initializing a variable in Logic Apps.":::
120
+
1. In the **Type** field, select **Array**.
121
+
1. In the **Value** field, select **Add dynamic Content**. Select the **Expression** tab, and enter this string: *split(triggerBody()?['data']?['essentials']?['alertTargetIDs'][0], '/')*
122
+
123
+
:::image type="content" source="./media/alerts-logic-apps/initialize-variable.png" alt-text="A screenshot showing the parameters for the initializing a variable in Logic Apps.":::
124
+
125
+
1. Select **+** and **Add an action** to insert another step.
126
+
1. In the **Search** field, search for and select **Azure Resource Manager**, and then **Read a resource**.
127
+
1. Populate the array with the tags from the affected resources with this information. In each of the fields, click inside the field, and scroll down to **Enter a custom value**. Select **Add dynamic content**, and then select the **Expression** tab. Enter the strings from this table:
1. The dynamic content now includes tags from the resource that you can use in your notification.
137
+
128
138
1. Send an email or post a Teams message.
129
139
130
140
## [Send an email](#tab/send-email)
@@ -140,22 +150,22 @@ In this example, we'll use the following steps to create a Logic App that uses t
140
150
1. Sign into Office 365 when prompted to create a connection.
141
151
1. Create the email **Body** by entering static text and including content taken from the alert payload by choosing fields from the **Dynamic content** list.
142
152
For example:
143
-
- Enter *An alert has monitoring condition:* then select **monitorCondition** from the **Dynamic content** list.
144
-
- Then enter *Date fired:* and select **firedDateTime** from the **Dynamic content** list.
145
-
- Enter *Affected resources:* and select **alertTargetIDs** from the **Dynamic content** list.
146
-
153
+
- Enter the text: *An alert has been triggered with this monitoring condition:*. Then, select **monitorCondition** from the **Dynamic content** list.
154
+
- Enter the text: *Date fired:*. Then, select **firedDateTime** from the **Dynamic content** list.
155
+
- Enter the text: *Affected resources:*. Then, select **alertTargetIDs** from the **Dynamic content** list.
156
+
147
157
1. In the **Subject** field, create the subject text by entering static text and including content taken from the alert payload by choosing fields from the **Dynamic content** list.
148
158
For example:
149
-
- Enter *Alert:* and select **alertRule** from the **Dynamic content** list.
150
-
- Then enter *with severity:* and select **severity** from the **Dynamic content** list.
151
-
- Enter *has condition:* and select **monitorCondition** from the **Dynamic content** list.
152
-
159
+
- Enter the text: *Alert:*. Then, select **alertRule** from the **Dynamic content** list.
160
+
- Enter the text: *with severity:*. Then, select **severity** from the **Dynamic content** list.
161
+
- Enter the text: *has condition:*. Then, select **monitorCondition** from the **Dynamic content** list.
162
+
153
163
1. Enter the email address to send the alert to in the **To** field.
154
164
1. Select **Save**.
155
165
156
166
:::image type="content" source="./media/alerts-logic-apps/configure-email.png" alt-text="A screenshot showing the parameters tab for the send email action.":::
157
167
158
-
You've created a Logic App that will send an email to the specified address, with details from the alert that triggered it.
168
+
You've created a Logic App that sends an email to the specified address, with details from the alert that triggered it.
159
169
160
170
The next step is to create an action group to trigger your Logic App.
161
171
@@ -170,7 +180,7 @@ The next step is to create an action group to trigger your Logic App.
170
180
1. Select *User* from the **Post as** dropdown.
171
181
1. Select *Group chat* from the **Post in** dropdown.
172
182
1. Select your group from the **Group chat** dropdown.
173
-
1. Create the message text in the **Message** field by entering static text and including content taken from the alert payload by choosing fields from the **Dynamic content** list.
183
+
1. Create the message text in the **Message** field by entering static text and including content taken from the alert payload by choosing fields from the **Dynamic content** list.
174
184
For example:
175
185
- Enter *Alert:* then select **alertRule** from the **Dynamic content** list.
176
186
- Enter *with severity:* and select **severity** from the **Dynamic content** list.
@@ -179,7 +189,7 @@ The next step is to create an action group to trigger your Logic App.
179
189
1. Select **Save**
180
190
:::image type="content" source="./media/alerts-logic-apps/configure-teams-message.png" alt-text="A screenshot showing the parameters tab for the post a message in a chat or channel action.":::
181
191
182
-
You've created a Logic App that will send a Teams message to the specified group, with details from the alert that triggered it.
192
+
You've created a Logic App that sends a Teams message to the specified group, with details from the alert that triggered it.
183
193
184
194
The next step is to create an action group to trigger your Logic App.
185
195
@@ -198,7 +208,7 @@ To trigger your Logic app, create an action group, then create an alert that use
198
208
:::image type="content" source="./media/alerts-logic-apps/create-action-group.png" alt-text="A screenshot showing the actions tab of a create action group page.":::
199
209
1. In the **Actions** tab under **Action type**, select **Logic App**.
200
210
1. In the **Logic App** section, select your logic app from the dropdown.
201
-
1. Set **Enable common alert schema** to *Yes*. If you select *No*, the alert type will determine which alert schema is used. For more information about alert schemas, see [Context specific alert schemas](./alerts-non-common-schema-definitions.md).
211
+
1. Set **Enable common alert schema** to *Yes*. If you select *No*, the alert type determines which alert schema is used. For more information about alert schemas, see [Context specific alert schemas](./alerts-non-common-schema-definitions.md).
202
212
1. Select **OK**.
203
213
1. Enter a name in the **Name** field.
204
214
1. Select **Review + create**, the **Create**.
@@ -214,7 +224,7 @@ To trigger your Logic app, create an action group, then create an alert that use
214
224
215
225
:::image type="content" source="./media/alerts-logic-apps/test-action-group2.png" alt-text="A screenshot showing an action group details test page.":::
216
226
217
-
The following email will be sent to the specified account:
227
+
The following email is sent to the specified account:
218
228
219
229
:::image type="content" source="./media/alerts-logic-apps/sample-output-email.png" alt-text="A screenshot showing a sample email sent by the test page.":::
0 commit comments