Azure App Service Exception Log StackTrace Using PDB From Azure Artifacts Symbol Server

Christopher Mire 1 Reputation point
2022-09-23T15:04:45.967+00:00

My question is around logging exception stacktrace with full fidelity from having access to PDB file. In my case have an Azure App Service hosting .NET 6 web api using Application Insights for logging. Application is deployed with release build but without PDB's. The PDB's are stored on Azure Artifacts Symbol Server. Will the app know someway to retrieve the symbols from symbol server, so that it can give full fidelity stacktrace with appropriate line numbers? Or is it required to have the PDB files deployed with the application?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,407 questions
{count} votes

1 answer

Sort by: Most helpful
  1. VenkateshDodda-MSFT 19,646 Reputation points Microsoft Employee
    2022-09-29T04:02:36.363+00:00

    @Christopher Mire Thanks for your patience on this. I have checked with internal team on this and below is the feedback shared from them

    It is important that an application won’t pull symbols from a symbol server. Only the debugger loads symbols and has the ability to pull symbols from symbol servers.

    StackTrace information will be most informative with Debug build configurations. By default, Debug builds include debug symbols, while Release builds do not. The debug symbols contain most of the file, method name, line number, and column information used in constructing StackFrame and StackTrace objects.

    For your application to print stacktraces with all the debugging information, you will need to deploy the application with symbols. To get most of the information, they will need to use a debug build instead of retail or they will need to extract the information from the StackTrace object as you can see in the following example:
    https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.stacktrace

    Keep in mind that it is not recommended to release a production application with symbols for security purposes. If someone is able to download the symbol file, it will have a lot of knowledge about the application internals.

    Feel free to reach back to me if you have any further questions on this,