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/azure-monitor/app/automate-with-logic-apps.md
+44-37Lines changed: 44 additions & 37 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,64 +2,69 @@
2
2
title: Automate Azure Application Insights processes by using Logic Apps
3
3
description: Learn how you can quickly automate repeatable processes by adding the Application Insights connector to your logic app.
4
4
ms.topic: conceptual
5
-
ms.date: 03/11/2019
5
+
ms.date: 07/31/2022
6
+
author: guywild
7
+
ms.author: guywild
8
+
ms.reviewer: yossi-y
6
9
---
7
10
8
11
# Automate Application Insights processes by using Logic Apps
9
12
10
13
Do you find yourself repeatedly running the same queries on your telemetry data to check whether your service is functioning properly? Are you looking to automate these queries for finding trends and anomalies and then build your own workflows around them? The Azure Application Insights connector for Logic Apps is the right tool for this purpose.
11
14
12
15
> [!NOTE]
13
-
> The Azure Application Insights connector has been replaced with the [Azure Monitor connector](../logs/logicapp-flow-connector.md) that is integrated with Azure Active Directory instead of requiring an API key and also allows you to retrieve data from a Log Analytics workspace.
16
+
> The Azure Application Insights connector has been replaced by the [Azure Monitor connector](../logs/logicapp-flow-connector.md), which is integrated with Azure Active Directory instead of requiring an API key and also allows you to retrieve data from a Log Analytics workspace.
14
17
15
18
With this integration, you can automate numerous processes without writing a single line of code. You can create a logic app with the Application Insights connector to quickly automate any Application Insights process.
16
19
17
-
You can add additional actions as well. The Logic Apps feature of Azure App Service makes hundreds of actions available. For example, by using a logic app, you can automatically send an email notification or create a bug in Azure DevOps. You can also use one of the many available [templates](../../logic-apps/logic-apps-create-logic-apps-from-templates.md) to help speed up the process of creating your logic app.
20
+
You can also add other actions. The Logic Apps feature of Azure App Service makes hundreds of actions available. For example, by using a logic app, you can automatically send an email notification or create a bug in Azure DevOps. You can also use one of the many available [templates](../../logic-apps/logic-apps-create-logic-apps-from-templates.md) to help speed up the process of creating your logic app.
18
21
19
22
## Create a logic app for Application Insights
20
23
21
24
In this tutorial, you learn how to create a logic app that uses the Analytics autocluster algorithm to group attributes in the data for a web application. The flow automatically sends the results by email, just one example of how you can use Application Insights Analytics and Logic Apps together.
22
25
23
26
### Step 1: Create a logic app
24
27
1. Sign in to the [Azure portal](https://portal.azure.com).
25
-
1.Click**Create a resource**, select**Web + Mobile**, and then select**Logic App**.
28
+
1.Select**Create a resource** >**Web + Mobile** >**Logic App**.

37
40
38
41
### Step 3: Add an Application Insights action
39
-
1.Click**New step**.
42
+
1.Select**New step**.
40
43
41
44
1. In the **Choose an action** search box, type **Azure Application Insights**.
42
45
43
-
1. Under **Actions**, click**Azure Application Insights - Visualize Analytics query**.
46
+
1. Under **Actions**, select**Azure Application Insights - Visualize Analytics query**.
44
47
45
-

48
+

46
49
47
50
### Step 4: Connect to an Application Insights resource
48
51
49
-
To complete this step, you need an application ID and an API key for your resource. You can retrieve them from the Azure portal, as shown in the following diagram:
52
+
To complete this step, you need an application ID and an API key for your resource:
50
53
51
-

54
+
1. Select **API access** > **Create API key**:
52
55
53
-

56
+

57
+
58
+

54
59
55
-
Provide a name for your connection, the application ID, and the API key.
60
+
1.Provide a name for your connection, the application ID, and the API key.

58
63
59
64
### Step 5: Specify the Analytics query and chart type
60
65
In the following example, the query selects the failed requests within the last day and correlates them with exceptions that occurred as part of the operation. Analytics correlates the failed requests, based on the operation_Id identifier. The query then segments the results by using the autocluster algorithm.
61
66
62
-
When you create your own queries, verify that they are working properly in Analytics before you add it to your flow.
67
+
When you create your own queries, verify that they're working properly in Analytics before you add it to your flow.
63
68
64
69
1. In the **Query** box, add the following Analytics query:
65
70
@@ -76,59 +81,61 @@ When you create your own queries, verify that they are working properly in Analy
76
81
77
82
1. In the **Chart Type** box, select **Html Table**.

80
85
81
86
### Step 6: Configure the logic app to send email
82
87
83
-
1. Click **New step**.
88
+
1. Select **New step**.
84
89
85
90
1. In the search box, type **Office 365 Outlook**.
86
91
87
-
1. Click **Office 365 Outlook - Send an email**.
92
+
1. Select **Office 365 Outlook - Send an email**.
88
93
89
-

94
+

90
95
91
-
1. In the **Send an email** window, do the following:
96
+
1. In the **Send an email** window:
92
97
93
98
a. Type the email address of the recipient.
94
99
95
100
b. Type a subject for the email.
96
101
97
-
c. Click anywhere in the **Body** box and then, on the dynamic content menu that opens at the right, select **Body**.
102
+
c. Select anywhere in the **Body** box and then, on the dynamic content menu that opens at the right, select **Body**.
98
103
99
-
d. Click the **Add new parameter** drop down and select Attachments and Is HTML.
104
+
d. Select the **Add new parameter** dropdown and select Attachments and Is HTML.
100
105
101
-

106
+

102
107
103
-

108
+

You can wait for the trigger to run the logic app, or you can run the logic app immediately by selecting **Run**.
125
+
126
+

127
+
128
+
When your logic app runs, the recipients you specified in the email list will receive an email that looks like this:
129
+
130
+

125
131
132
+
> [!NOTE]
133
+
> The log app generates an email with a JPG file that depicts the query result set. If your query doesn't return results, the logic app won't create a JPG file.
134
+
126
135
## Next steps
127
136
128
137
- Learn more about creating [Analytics queries](../logs/get-started-queries.md).
129
138
- Learn more about [Logic Apps](../../logic-apps/logic-apps-overview.md).
0 commit comments