Skip to content

Commit a1274f8

Browse files
committed
edit pass: profiler-articles
1 parent e16fd3b commit a1274f8

File tree

2 files changed

+43
-44
lines changed

2 files changed

+43
-44
lines changed

articles/azure-monitor/profiler/profiler-trackrequests.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Write code to track requests with Azure Application Insights | Microsoft Docs
2+
title: Write code to track requests with Application Insights | Microsoft Docs
33
description: Write code to track requests with Application Insights so you can get profiles for your requests.
44
ms.topic: conceptual
55
ms.custom: devx-track-csharp
@@ -9,15 +9,15 @@ ms.reviewer: charles.weininger
99

1010
# Write code to track requests with Application Insights
1111

12-
Azure Application Insights needs to track requests for your application in order to provide profiles for your application on the Performance page in the Azure portal.
12+
Application Insights needs to track requests for your application to provide profiles for your application on the **Performance** page in the Azure portal.
1313

14-
For applications built on already-instrumented frameworks (like ASP.NET and ASP.NET Core)S, Application Insights can automatically track requests.
14+
For applications built on already-instrumented frameworks (like ASP.NET and ASP.NET Core), Application Insights can automatically track requests.
1515

16-
But for other applications (like Azure Cloud Services worker roles and Service Fabric stateless APIs), you need to track requests with code that tells Application Insights where your requests begin and end. Requests telemetry is then sent to Application Insights, which you can view on the Performance page. Profiles are collected for those requests.
16+
For other applications (like Azure Cloud Services worker roles and Azure Service Fabric stateless APIs), you need to track requests with code that tells Application Insights where your requests begin and end. Requests telemetry is then sent to Application Insights, which you can view on the **Performance** page. Profiles are collected for those requests.
1717

1818
To manually track requests:
1919

20-
1. Early in the application lifetime, add the following code:
20+
1. Early in the application lifetime, add the following code:
2121

2222
```csharp
2323
using Microsoft.ApplicationInsights.Extensibility;
@@ -26,7 +26,7 @@ To manually track requests:
2626
TelemetryConfiguration.Active.InstrumentationKey = "00000000-0000-0000-0000-000000000000";
2727
```
2828

29-
For more information about this global instrumentation key configuration, see [Use Service Fabric with Application Insights](https://github.com/Azure-Samples/service-fabric-dotnet-getting-started/blob/dev/appinsights/ApplicationInsights.md).
29+
For more information about this global instrumentation key configuration, see [Use Service Fabric with Application Insights](https://github.com/Azure-Samples/service-fabric-dotnet-getting-started/blob/dev/appinsights/ApplicationInsights.md).
3030

3131
1. For any piece of code that you want to instrument, add a `StartOperation<RequestTelemetry>` **using** statement around it, as shown in the following example:
3232

@@ -42,7 +42,7 @@ To manually track requests:
4242
}
4343
```
4444

45-
Calling `StartOperation<RequestTelemetry>` within another `StartOperation<RequestTelemetry>` scope isn't supported. You can use `StartOperation<DependencyTelemetry>` in the nested scope instead. For example:
45+
Calling `StartOperation<RequestTelemetry>` within another `StartOperation<RequestTelemetry>` scope isn't supported. You can use `StartOperation<DependencyTelemetry>` in the nested scope instead. For example:
4646

4747
```csharp
4848
using (var getDetailsOperation = client.StartOperation<RequestTelemetry>("GetProductDetails"))

articles/azure-monitor/profiler/profiler.md

Lines changed: 36 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,130 +8,129 @@ ms.reviewer: jogrima
88

99
# Enable Profiler for Azure App Service apps
1010

11-
Application Insights Profiler is pre-installed as part of the App Services runtime. You can run Profiler on ASP.NET and ASP.NET Core apps running on Azure App Service using Basic service tier or higher. Follow these steps even if you've included the App Insights SDK in your application at build time.
11+
Application Insights Profiler is preinstalled as part of the Azure App Service runtime. You can run Profiler on ASP.NET and ASP.NET Core apps running on App Service by using the Basic service tier or higher. Follow these steps even if you've included the Application Insights SDK in your application at build time.
1212

1313
To enable Profiler on Linux, walk through the [ASP.NET Core Azure Linux web apps instructions](profiler-aspnetcore-linux.md).
1414

1515
> [!NOTE]
1616
> Codeless installation of Application Insights Profiler follows the .NET Core support policy.
1717
> For more information about supported runtime, see [.NET Core Support Policy](https://dotnet.microsoft.com/platform/support/policy/dotnet-core).
1818
19-
2019
## Prerequisites
2120

22-
- An [Azure App Services ASP.NET/ASP.NET Core app](../../app-service/quickstart-dotnetcore.md).
23-
- [Application Insights resource](/previous-versions/azure/azure-monitor/app/create-new-resource) connected to your App Service app.
21+
- An [Azure App Service ASP.NET/ASP.NET Core app](../../app-service/quickstart-dotnetcore.md).
22+
- [Application Insights resource](/previous-versions/azure/azure-monitor/app/create-new-resource) connected to your App Service app.
2423

2524
## Verify "Always On" setting is enabled
2625

27-
1. In the Azure portal, navigate to your App Service.
28-
1. Under **Settings** in the left side menu, select **Configuration**.
26+
1. In the Azure portal, go to your App Service.
27+
1. Under **Settings** on the left side menu, select **Configuration**.
2928

30-
:::image type="content" source="./media/profiler/configuration-menu.png" alt-text="Screenshot of selecting Configuration from the left side menu.":::
29+
:::image type="content" source="./media/profiler/configuration-menu.png" alt-text="Screenshot that shows selecting Configuration from the left side menu.":::
3130

3231
1. Select the **General settings** tab.
33-
1. Verify **Always On** > **On** is selected.
32+
1. Verify that **Always On** > **On** is selected.
3433

35-
:::image type="content" source="./media/profiler/always-on.png" alt-text="Screenshot of the General tab on the Configuration pane and showing the Always On being enabled.":::
34+
:::image type="content" source="./media/profiler/always-on.png" alt-text="Screenshot that shows the General tab on the Configuration pane showing that Always On is enabled.":::
3635

37-
1. Select **Save** if you've made changes.
36+
1. Select **Save** if you made changes.
3837

3938
## Enable Application Insights and Profiler
4039

4140
### For Application Insights and App Service in the same subscription
4241

4342
If your Application Insights resource is in the same subscription as your App Service:
4443

45-
1. Under **Settings** in the left side menu, select **Application Insights**.
44+
1. Under **Settings** on the left side menu, select **Application Insights**.
4645

47-
:::image type="content" source="./media/profiler/app-insights-menu.png" alt-text="Screenshot of selecting Application Insights from the left side menu.":::
46+
:::image type="content" source="./media/profiler/app-insights-menu.png" alt-text="Screenshot that shows selecting Application Insights from the left side menu.":::
4847

4948
1. Under **Application Insights**, select **Enable**.
50-
1. Verify you've connected an Application Insights resource to your app.
49+
1. Verify that you connected an Application Insights resource to your app.
5150

52-
:::image type="content" source="./media/profiler/enable-app-insights.png" alt-text="Screenshot of enabling App Insights on your app.":::
51+
:::image type="content" source="./media/profiler/enable-app-insights.png" alt-text="Screenshot that shows enabling Application Insights on your app.":::
5352

5453
1. Scroll down and select the **.NET** or **.NET Core** tab, depending on your app.
55-
1. Verify **Collection Level** > **Recommended** is selected.
56-
1. Under **Profiler**, select **On**.
57-
- If you chose the **Basic** collection level earlier, the Profiler setting is disabled.
58-
1. Select **Apply**, then **Yes** to confirm.
54+
1. Verify that **Collection Level** > **Recommended** is selected.
55+
1. Under **Profiler**, select **On**.
56+
- If you chose the **Basic** collection level earlier, the Profiler setting is disabled.
57+
1. Select **Apply** > **Yes** to confirm.
5958

60-
:::image type="content" source="./media/profiler/enable-profiler.png" alt-text="Screenshot of enabling Profiler on your app.":::
59+
:::image type="content" source="./media/profiler/enable-profiler.png" alt-text="Screenshot that shows enabling Profiler on your app.":::
6160

6261
### For Application Insights and App Service in different subscriptions
6362

64-
If your Application Insights resource is in a different subscription from your App Service, you'll need to enable Profiler manually by creating app settings for your Azure App Service. You can automate the creation of these settings using a template or other means. The settings needed to enable the Profiler:
63+
If your Application Insights resource is in a different subscription from your App Service, you need to enable Profiler manually by creating app settings for your App Service. You can automate the creation of these settings by using a template or other means. The settings needed to enable the Profiler:
6564

66-
|App Setting | Value |
65+
|App setting | Value |
6766
|---------------|----------|
6867
|APPINSIGHTS_INSTRUMENTATIONKEY | iKey for your Application Insights resource |
6968
|APPINSIGHTS_PROFILERFEATURE_VERSION | 1.0.0 |
7069
|DiagnosticServices_EXTENSION_VERSION | ~3 |
7170

72-
Set these values using:
73-
- [Azure Resource Manager Templates](../app/azure-web-apps-net-core.md#app-service-application-settings-with-azure-resource-manager)
71+
Set these values by using:
72+
- [Azure Resource Manager templates](../app/azure-web-apps-net-core.md#app-service-application-settings-with-azure-resource-manager)
7473
- [Azure PowerShell](/powershell/module/az.websites/set-azwebapp)
7574
- [Azure CLI](/cli/azure/webapp/config/appsettings)
7675

7776
## Enable Profiler for regional clouds
7877

79-
Currently the only regions that require endpoint modifications are [Azure Government](../../azure-government/compare-azure-government-global-azure.md#application-insights) and [Azure China](/azure/china/resources-developer-guide).
78+
Currently, the only regions that require endpoint modifications are [Azure Government](../../azure-government/compare-azure-government-global-azure.md#application-insights) and [Azure China](/azure/china/resources-developer-guide).
8079

81-
|App Setting | US Government Cloud | China Cloud |
80+
|App setting | US Government Cloud | China Cloud |
8281
|---------------|---------------------|-------------|
8382
|ApplicationInsightsProfilerEndpoint | `https://profiler.monitor.azure.us` | `https://profiler.monitor.azure.cn` |
8483
|ApplicationInsightsEndpoint | `https://dc.applicationinsights.us` | `https://dc.applicationinsights.azure.cn` |
8584

8685
## Enable Azure Active Directory authentication for profile ingestion
8786

88-
Application Insights Profiler supports Azure AD authentication for profiles ingestion. For all profiles of your application to be ingested, your application must be authenticated and provide the required application settings to the Profiler agent.
87+
Application Insights Profiler supports Azure Active Directory (Azure AD) authentication for profiles ingestion. For all profiles of your application to be ingested, your application must be authenticated and provide the required application settings to the Profiler agent.
8988

9089
Profiler only supports Azure AD authentication when you reference and configure Azure AD using the [Application Insights SDK](../app/asp-net-core.md#configure-the-application-insights-sdk) in your application.
9190

9291
To enable Azure AD for profiles ingestion:
9392

9493
1. Create and add the managed identity to authenticate against your Application Insights resource to your App Service.
9594

96-
a. [System-Assigned Managed identity documentation](../../app-service/overview-managed-identity.md?tabs=portal%2chttp#add-a-system-assigned-identity)
95+
1. [System-assigned managed identity documentation](../../app-service/overview-managed-identity.md?tabs=portal%2chttp#add-a-system-assigned-identity)
9796

98-
b. [User-Assigned Managed identity documentation](../../app-service/overview-managed-identity.md?tabs=portal%2chttp#add-a-user-assigned-identity)
97+
1. [User-assigned managed identity documentation](../../app-service/overview-managed-identity.md?tabs=portal%2chttp#add-a-user-assigned-identity)
9998

10099
1. [Configure and enable Azure AD](../app/azure-ad-authentication.md?tabs=net#configure-and-enable-azure-ad-based-authentication) in your Application Insights resource.
101100

102101
1. Add the following application setting to let the Profiler agent know which managed identity to use:
103102

104-
For System-Assigned Identity:
103+
For system-assigned identity:
105104

106-
| App Setting | Value |
105+
| App setting | Value |
107106
| -------------- |--------- |
108107
| APPLICATIONINSIGHTS_AUTHENTICATION_STRING | `Authorization=AAD` |
109108

110-
For User-Assigned Identity:
109+
For user-assigned identity:
111110

112-
| App Setting | Value |
111+
| App setting | Value |
113112
| ------------- | -------- |
114113
| APPLICATIONINSIGHTS_AUTHENTICATION_STRING | `Authorization=AAD;ClientId={Client id of the User-Assigned Identity}` |
115114

116115
## Disable Profiler
117116

118117
To stop or restart Profiler for an individual app's instance:
119118

120-
1. Under **Settings** in the left side menu, select **WebJobs**.
119+
1. Under **Settings** on the left side menu, select **WebJobs**.
121120

122-
:::image type="content" source="./media/profiler/web-jobs-menu.png" alt-text="Screenshot of selecting web jobs from the left side menu.":::
121+
:::image type="content" source="./media/profiler/web-jobs-menu.png" alt-text="Screenshot that shows selecting web jobs from the left side menu.":::
123122

124123
1. Select the webjob named `ApplicationInsightsProfiler3`.
125124

126-
1. Click **Stop** from the top menu.
125+
1. Select **Stop** on the top menu.
127126

128-
:::image type="content" source="./media/profiler/stop-web-job.png" alt-text="Screenshot of selecting stop for stopping the webjob.":::
127+
:::image type="content" source="./media/profiler/stop-web-job.png" alt-text="Screenshot that shows selecting stop for stopping the webjob.":::
129128

130129
1. Select **Yes** to confirm.
131130

132131
We recommend that you have Profiler enabled on all your apps to discover any performance issues as early as possible.
133132

134-
Profiler's files can be deleted when using WebDeploy to deploy changes to your web application. You can prevent the deletion by excluding the App_Data folder from being deleted during deployment.
133+
You can delete Profiler's files when you use WebDeploy to deploy changes to your web application. You can prevent the deletion by excluding the *App_Data* folder from being deleted during deployment.
135134

136135
## Next steps
137136
Learn how to...

0 commit comments

Comments
 (0)