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
- In Azure Select the 'AppService'
- Under the Menu select 'Diagnose and solve problems'
- Under Diagnostic Tools select 'Profiler'
- Under Diagnostic Tools select 'Collect .NET Profiler Trace'
- Under the Collect a Profiler Trace select the following:
- Select the Mode 'Collect and Analyze Data' - This will generate a useful report for debugging, otherwise the file can be analyzed in PerfView
- Check checkbox next to the Instance that you wish to debug
- Check 'Add thread report'
- Click 'Collect Profiler Trace'
- Click the 'Play' Button above 'Step 1: Starting Profiler'
- Replicate the issue
- 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
- In Azure Select the 'AppInsights' for your AppService
- Under the Investigate Menu select 'Failures'
- Drill down to point in time when failure occurred
- Narrow down your transaction based on what symptoms it has from the following 4 criteria by filtering
- Exception
- Response Code
- Operation Name
- Failed Dependency
- Click the 'Drill into...' button
- On the right side under 'Select a sample operation' select one the suggested events
- Check to see whether it has the Profiler Trace icon, if yes click it
- Analyze the trace in Azure or Download the Profiler Trace and analyze it in PerfView