工作一切正常,然后我通过 Visual Studio 发布了代码更新,现在不再获取任何请求数据。 Azure 门户中的“概述”页面仅显示扁平化图表,实时指标显示消息“不可用:无法连接到您的应用程序”
这是一个 .NET 8 Asp.Net Core 应用程序
我可以看到的是,在“事务搜索”下,它将显示 TRACE 消息,仅此而已。
当您将应用程序部署到 Azure 应用服务时,Application Insights 中的实时指标将默认启用。
Connected Services
配置了 Application Insights。如果您想手动启用
Live metrics
,您可以从已部署的App Service
=> Application Insights
进行操作
点击
Turn on the Application Insights
。
如MSDoc中所述,您甚至可以从代码中启用它。
我可以在交易搜索中看到请求和跟踪。
请参阅此
SOThread中的
appsetting.json
文件设置以了解 AppInsights 配置。