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
title: Monitor performance on Azure VMs - Application Insights
3
-
description: Application performance monitoring for Azure Virtual Machines and Azure Virtual Machine Scale Sets. Chart load and response time, dependency information, and set alerts on performance.
2
+
title: Monitor performance on Azure VMs - Azure Application Insights
3
+
description: Application performance monitoring for Azure Virtual Machine and Azure Virtual Machine Scale Sets.
4
4
ms.topic: conceptual
5
-
ms.date: 11/15/2022
5
+
ms.date: 01/11/2023
6
6
ms.devlang: csharp, java, javascript, python
7
7
ms.custom: devx-track-azurepowershell
8
8
ms.reviewer: abinetabate
9
9
---
10
10
11
-
# Deploy Application Insights Agent on virtual machines and Virtual Machine Scale Sets
11
+
# Application Insights for Azure VMs and Virtual Machine Scale Sets
12
12
13
-
Enabling monitoring for your .NET or Java-based web applications running on [Azure Virtual Machines](https://azure.microsoft.com/services/virtual-machines/)and[Azure Virtual Machine Scale Sets](../../virtual-machine-scale-sets/index.yml) is now easier than ever. Get all the benefits of using Application Insights without modifying your code.
13
+
Enabling monitoring for your ASP.NET and ASP.NET Core IIS-hosted applications running on [Azure virtual machines](https://azure.microsoft.com/services/virtual-machines/)or[Azure Virtual Machine Scale Sets](../../virtual-machine-scale-sets/index.yml) is now easier than ever. Get all the benefits of using Application Insights without modifying your code.
14
14
15
-
This article walks you through enabling Application Insights monitoring by using Application Insights Agent. It also provides preliminary guidance for automating the process for large-scale deployments.
16
-
17
-
Java-based applications running on Azure Virtual Machines and Azure Virtual Machine Scale Sets are monitored with the [Application Insights Java 3.0 agent](./java-in-process-agent.md), which is generally available.
18
-
19
-
> [!IMPORTANT]
20
-
> Application Insights Agent for ASP.NET and ASP.NET Core applications running on Azure Virtual Machines and Azure Virtual Machine Scale Sets is currently in public preview. For monitoring your ASP.NET applications running on-premises, use [Application Insights Agent for on-premises servers](./status-monitor-v2-overview.md), which is generally available and fully supported.
21
-
>
22
-
> The preview version for Azure Virtual Machines and Azure Virtual Machine Scale Sets is provided without a service-level agreement. We don't recommend it for production workloads. Some features might not be supported, and some might have constrained capabilities.
23
-
>
24
-
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
15
+
This article walks you through enabling Application Insights monitoring using the Application Insights Agent and provides preliminary guidance for automating the process for large-scale deployments.
25
16
26
17
## Enable Application Insights
27
18
@@ -30,19 +21,18 @@ Auto-instrumentation is easy to enable. Advanced configuration isn't required.
30
21
For a complete list of supported auto-instrumentation scenarios, see [Supported environments, languages, and resource providers](codeless-overview.md#supported-environments-languages-and-resource-providers).
31
22
32
23
> [!NOTE]
33
-
> Auto-instrumentation is available for ASP.NET, ASP.NET Core IIS-hosted applications, and Java. Use an SDK to instrument Node.js and Python applications hosted on Azure Virtual Machines and Azure Virtual Machine Scale Sets.
34
-
24
+
> Auto-instrumentation is available for ASP.NET, ASP.NET Core IIS-hosted applications and Java. Use an SDK to instrument Node.js and Python applications hosted on an Azure virtual machines and Virtual Machine Scale Sets.
35
25
### [.NET Framework](#tab/net)
36
26
37
-
The Application Insights Agent autocollects the same dependency signals out-of-the-box as the SDK. To learn more, see [Dependency autocollection](asp-net-dependencies.md#net).
27
+
The Application Insights Agent auto-collects the same dependency signals out-of-the-box as the SDK. See [Dependency auto-collection](./auto-collect-dependencies.md#net) to learn more.
38
28
39
-
### [.NET Core/.NET](#tab/core)
29
+
### [.NET Core / .NET](#tab/core)
40
30
41
-
The Application Insights Agent autocollects the same dependency signals out-of-the-box as the SDK. To learn more, see [Dependency autocollection](asp-net-dependencies.md#net).
31
+
The Application Insights Agent auto-collects the same dependency signals out-of-the-box as the SDK. See [Dependency auto-collection](./auto-collect-dependencies.md#net) to learn more.
42
32
43
33
### [Java](#tab/Java)
44
34
45
-
We recommend [Application Insights Java 3.0 agent](./java-in-process-agent.md) for Java. The most popular libraries, frameworks, logs, and dependencies are [autocollected](./java-in-process-agent.md#autocollected-requests) along with many [other configurations](./java-standalone-config.md).
35
+
We recommend [Application Insights Java 3.0 agent](./java-in-process-agent.md) for Java. The most popular libraries, frameworks, logs, and dependencies are [auto-collected](./java-in-process-agent.md#autocollected-requests), with a multitude of [other configurations](./java-standalone-config.md)
46
36
47
37
### [Node.js](#tab/nodejs)
48
38
@@ -54,76 +44,97 @@ To monitor Python apps, use the [SDK](./opencensus-python.md).
54
44
55
45
---
56
46
57
-
## Manage Application Insights Agent for .NET applications on virtual machines by using PowerShell
47
+
Before installing the Application Insights Agent, you'll need a connection string. [Create a new Application Insights Resource](./create-workspace-resource.md) or copy the connection string from an existing application insights resource.
48
+
49
+
### Enable Monitoring for Virtual Machines
50
+
51
+
### Method 1 - Azure portal / GUI
52
+
1. Go to Azure portal and navigate to your Application Insights resource and copy your connection string to the clipboard.
53
+
54
+
:::image type="content"source="./media/azure-vm-vmss-apps/connect-string.png" alt-text="Screenshot of the connection string." lightbox="./media/azure-vm-vmss-apps/connect-string.png":::
55
+
56
+
2. Navigate to your virtual machine, open the "Extensions + applications" pane under the "Settings" section in the left side navigation menu, and select "+ Add"
58
57
59
-
Before you install Application Insights Agent, you'll need a connection string. [Create a new Application Insights resource](./create-new-resource.md) or copy the connection string from an existing Application Insights resource.
58
+
:::image type="content"source="./media/azure-vm-vmss-apps/add-extension.png" alt-text="Screenshot of the extensions pane with an add button." lightbox="media/azure-vm-vmss-apps/add-extension.png":::
59
+
60
+
3. Select the "Application Insights Agent" card, and select "Next"
61
+
62
+
:::image type="content"source="./media/azure-vm-vmss-apps/select-extension.png" alt-text="Screenshot of the install an extension pane with a next button." lightbox="media/azure-vm-vmss-apps/select-extension.png":::
63
+
64
+
4. Paste the connection string you copied at step 1 and select "Review + Create"
65
+
66
+
:::image type="content"source="./media/azure-vm-vmss-apps/install-extension.png" alt-text="Screenshot of the create pane with a review and create button." lightbox="media/azure-vm-vmss-apps/install-extension.png":::
67
+
68
+
#### Method 2 - PowerShell
60
69
61
70
> [!NOTE]
62
-
> If you're new to PowerShell, see the [Get Started Guide](/powershell/azure/get-started-azureps).
71
+
> New to PowerShell? Check out the [Get Started Guide](/powershell/azure/get-started-azureps).
63
72
64
-
Install or update Application Insights Agent as an extension for virtual machines:
73
+
Install or update the Application Insights Agent as an extension for Azure virtual machines
65
74
66
75
```powershell
67
-
$publicCfgJsonString = '
76
+
# define variables to match your environment before running
"connectionString": "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/" # Application Insights connection string, create new Application Insights resource if you don't have one. https://portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/microsoft.insights%2Fcomponents
> You can install or update Application Insights Agent as an extension across multiple virtual machines at scale by using a PowerShell loop.
92
-
93
-
Uninstall Application Insights Agent extension from a virtual machine:
107
+
> For more complicated at-scale deployments you can use a PowerShell loop to install or update the Application Insights Agent extension across multiple VMs.
94
108
109
+
Query Application Insights Agent extension status for Azure Virtual Machine
You can also view installed extensions in the [Azure Virtual Machine section](../../virtual-machines/extensions/overview.md) of the Azure portal.
118
-
119
123
> [!NOTE]
120
-
> Verify installation by selecting **Live Metrics Stream** within the Application Insights resource associated with the connection string you used to deploy the Application Insights Agent extension. If you're sending data from multiple virtual machines, select the target virtual machines under **Server Name**. It might take up to a minute for data to begin flowing.
124
+
> Verify installation by selecting **Live Metrics Stream** within the Application Insights resource associated with the connection string you used to deploy the Application Insights Agent extension. If you're sending data from multiple Virtual Machines, select the target Azure virtual machines under **Server Name**. It might take up to a minute for data to begin flowing.
121
125
122
-
## Manage Application Insights Agent for .NET applications on Virtual Machine Scale Sets by using PowerShell
126
+
## Enable Monitoring for Virtual Machine Scale Sets
123
127
124
-
Install or update Application Insights Agent as an extension for a Virtual Machine Scale Set:
128
+
### Method 1 - Azure portal / GUI
129
+
Follow the prior steps for VMs, but navigate to your Virtual Machine Scale Sets instead of your VM.
125
130
131
+
### Method 2 - PowerShell
132
+
Install or update the Application Insights Agent as an extension for Azure Virtual Machine Scale Set
126
133
```powershell
134
+
# set resource group, vmss name, and connection string to reflect your enivornment
"connectionString"= "InstrumentationKey=00000000-0000-0000-0000-000000000000;IngestionEndpoint=https://xxxx.applicationinsights.azure.com/" # Application Insights connection string, create new Application Insights resource if you don't have one. https://portal.azure.com/#blade/HubsExtension/BrowseResourceBlade/resourceType/microsoft.insights%2Fcomponents
# Note: Depending on your update policy, you might need to run Update-AzVmssInstance for each instance
183
174
```
184
175
185
176
## Troubleshooting
186
177
187
178
Find troubleshooting tips for the Application Insights Monitoring Agent extension for .NET applications running on Azure virtual machines and Virtual Machine Scale Sets.
188
179
189
-
> [!NOTE]
190
-
> The following steps don't apply to Node.js and Python applications, which require SDK instrumentation.
191
-
192
-
Extension execution output is logged to files found in the following directories:
193
-
180
+
If you are having trouble deploying the extension, then review execution output which is logged to files found in the following directories:
If your extension has deployed successfully but you're unable to see telemetry, it could be one of the following issues covered in [Agent Troubleshooting](https://learn.microsoft.com/troubleshoot/azure/azure-monitor/app-insights/status-monitor-v2-troubleshoot#known-issues).
- Updated Application Insights .NET/.NET Core SDK to 2.20.1 - red field
205
-
- Enabled SQL query collection
206
-
- Enabled support for Azure Active Directory authentication
194
+
- Updated Application Insights .NET/.NET Core SDK to 2.20.1 - red field.
195
+
- Enabled SQL query collection.
196
+
- Enabled support for Azure Active Directory authentication.
207
197
208
198
### 2.8.42
209
199
210
-
Updated Application Insights .NET/.NET Core SDK to 2.18.1 - red field
200
+
-Updated ApplicationInsights .NET/.NET Core SDK to 2.18.1 - red field.
211
201
212
202
### 2.8.41
213
203
214
-
Added ASP.NET Core auto-instrumentation feature
204
+
-Added ASP.NET Core auto-instrumentation feature.
215
205
216
206
## Next steps
217
-
218
-
* Learn how to [deploy an application to a Virtual Machine Scale Set](../../virtual-machine-scale-sets/virtual-machine-scale-sets-deploy-app.md).
219
-
*[Set up availability web tests](monitor-web-app-availability.md) to be alerted if your endpoint is down.
207
+
* Learn how to [deploy an application to an Azure Virtual Machine Scale Set](../../virtual-machine-scale-sets/virtual-machine-scale-sets-deploy-app.md).
208
+
*[Set up Availability web tests](monitor-web-app-availability.md) to be alerted if your endpoint is down.
0 commit comments