Azure Profiler Traces

How to collect Azure Profiler Traces to investigate problems with AppServices?

These Profiler Traces can be captured in 2 ways:

  • Point-in-Time - These capture all the transactions in the AppService during an interval of (1 minute - Default, or the value of IIS_PROFILING_TIMEOUT_IN_SECONDS environment variable in seconds)
  • Single Transaction - Happen automatically based on the transaction status (500 are sometime captured in traces to help reactive debugging)

Obtaining a Point-in-Time Profiler Trace 

In order to generate the trace follow the steps below

  1. In Azure Select the 'AppService'
  2. Under the Menu select 'Diagnose and solve problems'
  3. Under Diagnostic Tools select 'Profiler'
  4. Under Diagnostic Tools select 'Collect .NET Profiler Trace'
  5. Under the Collect a Profiler Trace select the following:
    1. Select the Mode 'Collect and Analyze Data' - This will generate a useful report for debugging, otherwise the file can be analyzed in PerfView
    2. Check checkbox next to the Instance that you wish to debug
    3. Check 'Add thread report'
  6. Click 'Collect Profiler Trace'
  7. Click the 'Play' Button above 'Step 1: Starting Profiler'
  8. Replicate the issue
  9. After the period elapses the Profiler Trace and its report will be available under the Collect a Profiler Trace area

Obtaining an individual transaction Profiler Trace 

In order to obtain the trace and analyze it AppInsights and the Profiler Trace extension need to be turned on - here
Also sampling needs to be adequate in order to investigate specific problems - here2

  1. In Azure Select the 'AppInsights' for your AppService
  2. Under the Investigate Menu select 'Failures'
  3. Drill down to point in time when failure occurred
  4. Narrow down your transaction based on what symptoms it has from the following 4 criteria by filtering
    1. Exception
    2. Response Code
    3. Operation Name
    4. Failed Dependency
  5. Click the 'Drill into...' button
  6. On the right side under 'Select a sample operation' select one the suggested events 
  7. Check to see whether it has the Profiler Trace icon, if yes click it
  8. Analyze the trace in Azure or Download the Profiler Trace and analyze it in PerfView