简体   繁体   中英

Azure Snapshot Debugging and Azure Functions

I've been trying to get Snapshot Debugging working with Azure functions all to no avail and was wondering if anyone else has had much joy with this.

In essence it seems very simple to get working (and it does work for azure websites) and just involves included a reference to Microsoft.ApplicationInsights.SnapshotCollector.

However, try as I might, I cannot get it working for Azure functions. I've tried adding the same reference and using the telemetry client with TrackException and sure enough the exception appears in the Insight blade of the Portal, but I just get the 'Collect debug snapshots...' link rather than the 'Open debug snapshot' one.

thanks

Azure functions team has released a fix for this issue. You need to do two things.

    {
   
      "version": "2.0",
      "logging": {
        "applicationInsights": {
          "snapshotConfiguration": {
            "IsEnabled": true
          }
        }
      }
    }

As of now only 2.x versions of .Net core is supported. Net framework works just fine.

在此处输入图片说明

For more details, see the issue, https://github.com/MicrosoftDocs/azure-docs/issues/24999

Member of the Snapshot Debugger team,

To enable Snapshot Debugger in your Function app, you have to update your host.json file by adding the property snapshotConfiguration as defined below and redeploy your function.

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "snapshotConfiguration": {
        "isEnabled": true
      }
    }
  }
}

Snapshot Debugger is pre-installed as part of the Azure Functions runtime, which by default it's disabled

Since Snapshot Debugger it's included in the Azure Functions runtime, it isn't needed to add extra NuGet packages nor application settings.


We have created the proper documentation of how to enable Application Insights Snapshot Debugger in Azure Function, see below: https://docs.microsoft.com/azure/azure-monitor/app/snapshot-debugger-function-app

Renato Gutiérrez

[edited to include how to enable Snapshot Debugger snippet in the answer]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM