Skip to content

Commit f1d1593

Browse files
authored
Merge pull request #13818 from mikepope-ms/may-23-troubleshoot-app-insights
Removed reference to classic portal (no longer needed). Also,
2 parents ae026d4 + d572921 commit f1d1593

File tree

1 file changed

+27
-25
lines changed

1 file changed

+27
-25
lines changed

articles/cloud-services/cloud-services-dotnet-diagnostics-applicationinsights.md

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -13,59 +13,61 @@ ms.devlang: na
1313
ms.topic: article
1414
ms.tgt_pltfrm: na
1515
ms.workload: na
16-
ms.date: 12/15/2015
16+
ms.date: 05/23/2017
1717
ms.author: saurabh
1818

1919
---
2020
# Troubleshoot Cloud Services using Application Insights
21-
With [Azure SDK 2.8](https://azure.microsoft.com/downloads/) and Azure diagnostics extension 1.5 you can now send your Azure Diagnostics data for your Cloud Service directly to Application Insights. The various types of logs collected by Azure Diagnostics including application logs, windows event logs, ETW logs and performance counters can now be sent to Application Insights and visualized in the Application Insights portal UI. When used along with the Application Insights SDK you can now get insights into metrics and logs coming from your application as well as the system and infrastructure level data coming from Azure Diagnostics.
21+
With [Azure SDK 2.8](https://azure.microsoft.com/downloads/) and Azure diagnostics extension 1.5, you can send Azure Diagnostics data for your Cloud Service directly to Application Insights. The logs collected by Azure Diagnostics—including application logs, Windows Event Logs, ETW Logs, and performance counters—can be sent to Application Insights. You can then visualize this information in the Application Insights portal UI. You can then use the Application Insights SDK to get insights into metrics and logs that come from your application, as well as the system and infrastructure-level data that comes from Azure Diagnostics.
2222

2323
## Configure Azure Diagnostics to send data to Application Insights
24-
Follow these steps to setup your cloud service project to send Azure Diagnostics data to Application Insights.
24+
Follow these steps to set up your cloud service project to send Azure Diagnostics data to Application Insights.
2525

26-
1) In Visual Studio Solution Explorer right-click on a role and select **properties** to open the Role designer
26+
1. In Visual Studio Solution Explorer, right-click a role and select **Properties** to open the Role designer.
2727

28-
![Solution Explorer Role Properties][1]
28+
![Solution Explorer Role Properties][1]
2929

30-
2) In Role designer under the diagnostics section select the check box to **Send diagnostics data to Application Insights**
30+
2. In the **Diagnostics** section of the Role designer, select the **Send diagnostics data to Application Insights** option.
3131

32-
![Role designer send diagnostics data to application insights][2]
32+
![Role designer send diagnostics data to application insights][2]
3333

34-
3) In the dialog that pops up select the Application Insights Resource that you would like to send the Azure diagnostics data to. The dialog allows you to select an existing Application Insights resource from your subscription or manually specify an instrumentation key for an Application Insights resource. If you don't have an existing Application Insights resource then you can create on by clicking on the **Create a new resource** link which will open a browser window to the Azure classic portal where you can create an Application Insights Resource. For more information on creating an Application Insights resource see [Create a new Application Insights resource](../application-insights/app-insights-create-new-resource.md)
34+
3. In the dialog box that pops up, select the Application Insights resource that you want to send the Azure diagnostics data to. The dialog box allows you to select an existing Application Insights resource from your subscription or to manually specify an instrumentation key for an Application Insights resource. For more information on creating an Application Insights resource, see [Create a new Application Insights resource](../application-insights/app-insights-create-new-resource.md).
3535

36-
![select application insights resource][3]
36+
![select application insights resource][3]
3737

38-
4) Once you have added the Application Insights resource, the instrumentation key for that resource is stored as a service configuration setting with the name **APPINSIGHTS_INSTRUMENTATIONKEY**. You can change this configuration setting for each service configuration or environment by selecting a different configuration from the Service configuration drop down and specifying a new instrumentation key for that configuration.
38+
Once you have added the Application Insights resource, the instrumentation key for that resource is stored as a service configuration setting with the name **APPINSIGHTS_INSTRUMENTATIONKEY**. You can change this configuration setting for each service configuration or environment. To do so, select a different configuration from the **Service Configuration** list and specify a new instrumentation key for that configuration.
3939

40-
![select service configuration][4]
40+
![select service configuration][4]
4141

42-
The **APPINSIGHTS_INSTRUMENTATIONKEY** configuration setting is used by Visual Studio to configure the diagnostics extension with the appropriate Application Insights resource information during publishing. The configuration setting is a convenient way of defining different instrumentation keys for different service configurations. Visual Studio will translate that setting and insert it into the diagnostics extension public configuration when publishing. To simplify the process of configuring the diagnostics extension with PowerShell, the package output from Visual Studio also contains the public configuration XML with the appropriate Application Insights instrumentation key included. The public config files are created in the Extensions folder and follow the pattern PaaSDiagnostics.<RoleName>.PubConfig.xml. Any PowerShell based deployments can use this pattern to map each configuration to a Role.
42+
The **APPINSIGHTS_INSTRUMENTATIONKEY** configuration setting is used by Visual Studio to configure the diagnostics extension with the appropriate Application Insights resource information during publishing. The configuration setting is a convenient way of defining different instrumentation keys for different service configurations. Visual Studio will translate that setting and insert it into the diagnostics extension public configuration during the publish process. To simplify the process of configuring the diagnostics extension with PowerShell, the package output from Visual Studio also contains the public configuration XML with the appropriate Application Insights instrumentation key. The public config files are created in the Extensions folder and follow the pattern *PaaSDiagnostics.&lt;RoleName&gt;.PubConfig.xml*. Any PowerShell-based deployments can use this pattern to map each configuration to a role.
4343

44-
5) Enabling the **Send diagnostics data to Application Insights** will automatically configure Azure diagnostics to send all performance counters and error level logs that are being collected by the Azure diagnostics agent to Application Insights. If you want to further configure what data is sent to Application Insights then you need to manually edit the *diagnostics.wadcfgx* file for each role. See [Configure Azure Diagnostics to send data to Application Insights](#configure-azure-diagnostics-to-send-data-to-application-insights) to learn more about manually updating the configuration.
44+
4) To configure Azure diagnostics to send all performance counters and error-level logs collected by the Azure diagnostics agent to Application Insights, enable the **Send diagnostics data to Application Insights** option.
4545

46-
Once the Cloud Service is configured to send Azure diagnostics data to application insights you can deploy it to Azure like you normally would making sure the Azure diagnostics extension is enabled. See [Publishing a Cloud Service using Visual Studio](../vs-azure-tools-publishing-a-cloud-service.md).
46+
If you want to further configure what data is sent to Application Insights, you must manually edit the *diagnostics.wadcfgx* file for each role. See [Configure Azure Diagnostics to send data to Application Insights](#configure-azure-diagnostics-to-send-data-to-application-insights) to learn more about manually updating the configuration.
47+
48+
When the cloud service is configured to send Azure diagnostics data to application insights, you can deploy it to Azure normally, making sure the Azure diagnostics extension is enabled. For more information, see [Publishing a Cloud Service using Visual Studio](../vs-azure-tools-publishing-a-cloud-service.md).
4749

4850
## Viewing Azure diagnostics data in Application Insights
49-
The Azure diagnostic telemetry will show up in the Application Insights resource configured for your cloud service.
51+
The Azure diagnostic telemetry shows up in the Application Insights resource configured for your cloud service.
5052

51-
The following is how the various Azure diagnostics log types map to Application Insights concepts:
53+
Azure diagnostics log types map to Application Insights concepts in these ways:
5254

53-
* Performance Counters are displayed as Custom Metrics in Application Insights
54-
* Windows Event Logs are shown as Traces and Custom Events in Application Insights
55-
* Application Logs, ETW Logs and any Diagnostics Infrastructure logs are shown as Traces in Application Insights.
55+
* Performance counters are displayed as Custom Metrics in Application Insights.
56+
* Windows Event Logs are shown as Traces and Custom Events in Application Insights.
57+
* Application logs, ETW logs, and any Diagnostics Infrastructure logs are shown as Traces in Application Insights.
5658

57-
To view Azure diagnostics data in Application Insights:
59+
To view Azure diagnostics data in Application Insights, do one of the following:
5860

59-
* Use [Metrics explorer](../application-insights/app-insights-metrics-explorer.md) to visualize any custom performance counters or counts of different types of windows event log events.
61+
* Use [Metrics explorer](../application-insights/app-insights-metrics-explorer.md) to visualize any custom performance counters or counts of different types of Windows Event Log events.
6062

61-
![Custom Metrics in Metrics Explorer][5]
63+
![Custom Metrics in Metrics Explorer][5]
6264

63-
* Use [Search](../application-insights/app-insights-diagnostic-search.md) to search across the various trace logs sent by Azure Diagnostics. For example if you had an unhandled exception in a Role which caused the Role to crash and recycle that information would show up in the *Application* channel of *Windows Event Log*. You can use the Search functionality to look at the Windows Event Log error and get the full stack trace for the exception enabling you to find the root cause of the issue.
65+
* Use [Search](../application-insights/app-insights-diagnostic-search.md) to search across the trace logs sent by Azure Diagnostics. For example, if an unhandled exception has caused the role to crash and recycle, information about the exception shows up in the *Application* channel of *Windows Event Log*. You can use search to look at the Windows Event Log error and get the full stack trace for the exception to help find the cause of the issue.
6466

65-
![Search Traces][6]
67+
![Search Traces][6]
6668

6769
## Next Steps
68-
* [Add the Application Insights SDK to your cloud service](../application-insights/app-insights-cloudservices.md) to send data about requests, exceptions, dependencies, and any custom telemetry from your application. Combined with the Azure Diagnostics data you can get a complete view of your application and system all in the same Application Insight resource.
70+
* [Add the Application Insights SDK to your cloud service](../application-insights/app-insights-cloudservices.md) to send data about requests, exceptions, dependencies, and any custom telemetry from your application. When combined with the Azure Diagnostics data, this information you can get a complete view of your application and system, all in the same Application Insight resource.
6971

7072
<!--Image references-->
7173
[1]: ./media/cloud-services-dotnet-diagnostics-applicationinsights/solution-explorer-properties.png

0 commit comments

Comments
 (0)