是否可以在本地观看应用程序洞察

Is it possible to watch application insights locally

有一个 web.api 应用程序插入了 Application Insights。AI 在发布到 Azure 时非常有效。不幸的是,有时出于测试目的需要在 iis express 中启动应用程序。通常我从 cmd 这样做:"c:\program files\iis express\iisexpress" /port:1337 /path:c:\tracker_pub.
在这种情况下是否可以查看 AI 统计数据?特别是我希望看到有时会发生的异常。

是的,只要您的应用程序正在接收请求并且您的本地机器有互联网连接,所以它可以将事件发送到 AI 数据收集端点它应该记录 activity 当 运行 在 iis 中表示。推荐的方法是将此数据发送到不同的检测密钥(在 AI 门户中创建新的 AI 资源后),这样您的本地测试流量就不会与您的生产数据混淆,这也是测试新自定义的好方法您要添加的事件。如果您在 iis express 运行 时没有看到任何数据,最好的调试方法是在 Visual Studio 中使用 F5 启动您的应用程序,您将在您的 Visual Studio 中看到即将发送的每个事件调试输出 window。

请阅读this. You can use LinqPad to get all internal telemetry live. Also if you have VS 2015 Update 1 there is an Application Insights hub where you can find AI telemetry (same as in the VS output). You can read about it here. And also this