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/asp-net-core.md
+12-34Lines changed: 12 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -166,19 +166,19 @@ If `IConfiguration` has loaded configuration from multiple providers, then `serv
166
166
167
167
Run your application and make requests to it. Telemetry should now flow to Application Insights. The Application Insights SDK automatically collects incoming web requests to your application, along with the following telemetry.
168
168
169
-
### Live Metrics
169
+
### Live metrics
170
170
171
-
[Live Metrics](./live-stream.md) can be used to quickly verify if Application Insights monitoring is configured correctly. It might take a few minutes for telemetry to appear in the portal and analytics, but Live Metrics shows CPU usage of the running process in near real time. It can also show other telemetry like requests, dependencies, and traces.
171
+
[Live metrics](./live-stream.md) can be used to quickly verify if Application Insights monitoring is configured correctly. It might take a few minutes for telemetry to appear in the portal and analytics, but live metrics shows CPU usage of the running process in near real time. It can also show other telemetry like requests, dependencies, and traces.
172
172
173
-
#### Enable Live Metrics by using code for any .NET application
173
+
#### Enable live metrics by using code for any .NET application
174
174
175
175
> [!NOTE]
176
-
> Live Metrics is enabled by default when you onboard it by using the recommended instructions for .NET applications.
176
+
> Live metrics is enabled by default when you onboard it by using the recommended instructions for .NET applications.
177
177
178
-
To manually configure Live Metrics:
178
+
To manually configure live metrics:
179
179
180
180
1. Install the NuGet package [Microsoft.ApplicationInsights.PerfCounterCollector](https://www.nuget.org/packages/Microsoft.ApplicationInsights.PerfCounterCollector).
181
-
1. The following sample console app code shows setting up Live Metrics:
181
+
1. The following sample console app code shows setting up live metrics:
The preceding sample is for a console app, but the same code can be used in any .NET applications. If any other telemetry modules are enabled to autocollect telemetry, it's important to ensure that the same configuration used for initializing those modules is used for the Live Metrics module.
229
-
230
-
#### Add an API key to configuration
231
-
232
-
If you [create a secret API key](./live-stream.md#legacy-option-create-an-api-key) to set up an authenticated channel, you can add it to configuration.
233
-
234
-
> [!NOTE]
235
-
> Setting up an authenticated channel by configuring a secret API key is no longer recommended. Instead, we recommend securing the live metrics channel by using [Microsoft Entra authentication](./azure-ad-authentication.md#configure-and-enable-azure-ad-based-authentication).
236
-
237
-
In the *Program.cs* file, add the following namespace:
For more information on how to configure ASP.NET Core applications, see [Configuring telemetry modules in ASP.NET Core](#configure-or-remove-default-telemetrymodules).
228
+
The preceding sample is for a console app, but the same code can be used in any .NET applications. If any other telemetry modules are enabled to autocollect telemetry, it's important to ensure that the same configuration used for initializing those modules is used for the live metrics module.
251
229
252
230
### ILogger logs
253
231
@@ -329,7 +307,7 @@ var aiOptions = new Microsoft.ApplicationInsights.AspNetCore.Extensions.Applicat
@@ -531,7 +509,7 @@ By default, the following automatic-collection modules are enabled. These module
531
509
*`RequestTrackingTelemetryModule`: Collects RequestTelemetry from incoming web requests.
532
510
*`DependencyTrackingTelemetryModule`: Collects [DependencyTelemetry](./asp-net-dependencies.md) from outgoing HTTP calls and SQL calls.
533
511
*`PerformanceCollectorModule`: Collects Windows PerformanceCounters.
534
-
*`QuickPulseTelemetryModule`: Collects telemetry to show in the Live Metrics portal.
512
+
*`QuickPulseTelemetryModule`: Collects telemetry to show in the live metrics portal.
535
513
*`AppServicesHeartbeatTelemetryModule`: Collects heartbeats (which are sent as custom metrics), about the App Service environment where the application is hosted.
536
514
*`AzureInstanceMetadataTelemetryModule`: Collects heartbeats (which are sent as custom metrics), about the Azure VM environment where the application is hosted.
537
515
*`EventCounterCollectionModule`: Collects [EventCounters](eventcounters.md). This module is a new feature and is available in SDK version 2.8.0 and later.
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/asp-net.md
+9-24Lines changed: 9 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -361,19 +361,19 @@ Although it's possible to manually add the JavaScript (Web) SDK Loader Script to
361
361
362
362
For the template-based ASP.NET MVC app from this article, the file that you need to edit is *_Layout.cshtml*. You can find it under **Views** > **Shared**. To add client-side monitoring, open *_Layout.cshtml* and follow the [JavaScript (Web) SDK Loader Script-based setup instructions](./javascript-sdk.md?tabs=javascriptwebsdkloaderscript#get-started) from the article about client-side JavaScript SDK configuration.
363
363
364
-
## Live Metrics
364
+
## Live metrics
365
365
366
-
[Live Metrics](./live-stream.md) can be used to quickly verify if Application Insights monitoring is configured correctly. It might take a few minutes for telemetry to appear in the portal and analytics, but Live Metrics shows CPU usage of the running process in near real time. It can also show other telemetry like requests, dependencies, and traces.
366
+
[Live metrics](./live-stream.md) can be used to quickly verify if Application Insights monitoring is configured correctly. It might take a few minutes for telemetry to appear in the portal and analytics, but live metrics shows CPU usage of the running process in near real time. It can also show other telemetry like requests, dependencies, and traces.
367
367
368
-
### Enable Live Metrics by using code for any .NET application
368
+
### Enable live metrics by using code for any .NET application
369
369
370
370
> [!NOTE]
371
-
> Live Metrics is enabled by default when you onboard it by using the recommended instructions for .NET applications.
371
+
> Live metrics is enabled by default when you onboard it by using the recommended instructions for .NET applications.
372
372
373
-
To manually configure Live Metrics:
373
+
To manually configure live metrics:
374
374
375
375
1. Install the NuGet package [Microsoft.ApplicationInsights.PerfCounterCollector](https://www.nuget.org/packages/Microsoft.ApplicationInsights.PerfCounterCollector).
376
-
1. The following sample console app code shows setting up Live Metrics:
376
+
1. The following sample console app code shows setting up live metrics:
377
377
378
378
```csharp
379
379
using Microsoft.ApplicationInsights;
@@ -410,14 +410,14 @@ namespace LiveMetricsDemo
410
410
411
411
// Create a TelemetryClient instance. It is important
412
412
// to use the same TelemetryConfiguration here as the one
413
-
// used to set up Live Metrics.
413
+
// used to set up live metrics.
414
414
TelemetryClient client = new TelemetryClient(config);
415
415
416
416
// This sample runs indefinitely. Replace with actual application logic.
The preceding sample is for a console app, but the same code can be used in any .NET applications. If any other telemetry modules are enabled to autocollect telemetry, it's important to ensure that the same configuration used for initializing those modules is used for the Live Metrics module.
435
-
436
-
### Add an API key to configuration
437
-
438
-
If you [create a secret API key](./live-stream.md#legacy-option-create-an-api-key) to set up an authenticated channel, you can add it to configuration.
439
-
440
-
> [!NOTE]
441
-
> Setting up an authenticated channel by configuring a secret API key is no longer recommended. Instead, we recommend securing the live metrics channel by using [Microsoft Entra authentication](./azure-ad-authentication.md#configure-and-enable-azure-ad-based-authentication).
442
-
443
-
In the *applicationinsights.config* file, add `AuthenticationApiKey` to `QuickPulseTelemetryModule`:
The preceding sample is for a console app, but the same code can be used in any .NET applications. If any other telemetry modules are enabled to autocollect telemetry, it's important to ensure that the same configuration used for initializing those modules is used for the live metrics module.
Copy file name to clipboardExpand all lines: articles/azure-monitor/app/live-stream.md
+7-27Lines changed: 7 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,22 +38,24 @@ Live metrics is currently supported for ASP.NET, ASP.NET Core, Azure Functions,
38
38
39
39
1. Follow language-specific guidelines to enable live metrics:
40
40
41
-
Using OpenTelemetry (Recommended):
41
+
# [OpenTelemetry (Recommended)](#tab/otel)
42
42
43
43
*[ASP.NET](opentelemetry-enable.md?tabs=net): Live metrics is not supported.
44
44
*[ASP.NET Core](opentelemetry-enable.md?tabs=aspnetcore): Live metrics is enabled by default.
45
45
*[Java](./opentelemetry-enable.md?tabs=java): Live metrics is enabled by default.
46
46
*[Node.js](opentelemetry-enable.md?tabs=nodejs): Live metrics is enabled by default.
47
47
*[Python](opentelemetry-enable.md?tabs=python): Live metrics is enabled by default.
48
48
49
-
Using Classic API:
49
+
# [Classic API](#tab/classic)
50
50
51
-
*[ASP.NET](./asp-net.md): Live metrics is enabled by default but can also be enabled manually using code, see [Configure monitoring for ASP.NET with Azure Application Insights](./asp-net.md#enable-live-metrics-by-using-code-for-any-.net-application).
52
-
*[ASP.NET Core](./asp-net-core.md): Live metrics is enabled by default but can also be enabled manually using code, see [Application Insights for ASP.NET Core applications](./asp-net-core.md#enable-live-metrics-by-using-code-for-any-.net-application).
51
+
*[ASP.NET](./asp-net.md): Live metrics is enabled by default but can also be [enabled manually using code](./asp-net.md#enable-live-metrics-by-using-code-for-any-.net-application).
52
+
*[ASP.NET Core](./asp-net-core.md): Live metrics is enabled by default but can also be [enabled manually using code](./asp-net-core.md#enable-live-metrics-by-using-code-for-any-.net-application).
53
53
*[.NET/.NET Core Console/Worker](./worker-service.md): Live metrics is enabled by default.
54
54
*[.NET Applications: Enable using code](#enable-live-metrics-by-using-code-for-any-net-application).
55
55
*[Node.js](./nodejs.md#live-metrics)
56
56
57
+
---
58
+
57
59
2. In the [Azure portal](https://portal.azure.com), open the Application Insights resource for your application. Under **Investigate**, open **Live metrics**.
58
60
59
61
3.[Secure the control channel](#secure-the-control-channel) if you might use sensitive data like customer names in your filters.
@@ -111,10 +113,7 @@ If you want to monitor a particular server role instance, you can filter by serv
111
113
112
114
## Secure the control channel
113
115
114
-
Live metrics custom filters allow you to control which of your application's telemetry is streamed to the live metrics view in the Azure portal. The filters criteria are sent to the apps that are instrumented with the Application Insights SDK. The filter value could potentially contain sensitive information, such as the customer ID. To keep this value secured and prevent potential disclosure to unauthorized applications, you have two options:
115
-
116
-
-**Recommended:** Secure the live metrics channel by using [Microsoft Entra authentication](./azure-ad-authentication.md#configure-and-enable-azure-ad-based-authentication).
117
-
-**Legacy (no longer recommended):** Set up an authenticated channel by configuring a secret API key as explained in the [Legacy option section](#legacy-option-create-an-api-key) below.
116
+
Live metrics custom filters allow you to control which of your application's telemetry is streamed to the live metrics view in the Azure portal. The filters criteria are sent to the apps that are instrumented with the Application Insights SDK. The filter value could potentially contain sensitive information, such as the customer ID. To keep this value secured and prevent potential disclosure to unauthorized applications, secure the live metrics channel by using [Microsoft Entra authentication](./azure-ad-authentication.md#configure-and-enable-azure-ad-based-authentication).
118
117
119
118
> [!NOTE]
120
119
> On September 30, 2025, API keys used to stream live metrics telemetry into Application Insights will be retired. After that date, applications that use API keys won't be able to send live metrics data to your Application Insights resource. Authenticated telemetry ingestion for live metrics streaming to Application Insights will need to be done with [Microsoft Entra authentication for Application Insights](./azure-ad-authentication.md).
@@ -126,25 +125,6 @@ It's possible to try custom filters without having to set up an authenticated ch
126
125
127
126
:::image type="content" source="media/live-stream/live-stream-auth.png" alt-text="Screenshot that shows the Authorize connected servers dialog." lightbox="media/live-stream/live-stream-auth.png":::
128
127
129
-
### Legacy option: Create an API key
130
-
131
-
1. Select the **API Access** tab and then select **Create API key**.
132
-
133
-
:::image type="content" source="./media/live-stream/api-key.png" lightbox="./media/live-stream/api-key.png" alt-text="Screenshot that shows selecting the API Access tab and the Create API key button.":::
134
-
135
-
1. Select the **Authenticate SDK control channel** checkbox and then select **Generate key**.
136
-
137
-
:::image type="content" source="./media/live-stream/create-api-key.png" lightbox="./media/live-stream/create-api-key.png" alt-text="Screenshot that shows the Create API key pane. Select Authenticate SDK control channel checkbox and then select Generate key.":::
138
-
139
-
### Add an API key to configuration
140
-
141
-
For ASP.NET, ASP.NET Core, WorkerService, and Azure Functions apps, you can add an API key to configuration:
For Azure Functions apps (v2), you can secure the channel with an API key by using an environment variable.
184
-
185
-
> [!NOTE]
186
-
> Setting up an authenticated channel by configuring a secret API key is no longer recommended. Instead, we recommend securing the live metrics channel by using [Microsoft Entra authentication](./azure-ad-authentication.md#configure-and-enable-azure-ad-based-authentication).
187
-
188
-
Create an API key from within your Application Insights resource and go to **Settings** > **Configuration** for your Azure Functions app. Select **New application setting**, enter a name of `APPINSIGHTS_QUICKPULSEAUTHAPIKEY`, and enter a value that corresponds to your API key.
189
-
190
179
## Next steps
191
180
192
181
* Read more instructions and information about [monitoring Azure Functions](../../azure-functions/functions-monitoring.md).
0 commit comments