![](/img/trans.png)
[英]Microsoft Azure Web App - ASP.NET is not authorized to access the requested resource
[英]Access performance counters for ASP.NET Web App in Microsoft Azure
我正在使用一种诊断工具,该工具需要从作为Web App发布到Azure的Web应用程序端(asp.net)监视活动/空闲/池化数据库连接。 从客户端进行监视非常重要,因为我的目标是在应用程序负载下连接池的某些问题。
我在.NET Data Provider for SqlServer
的性能计数器类别.NET Data Provider for SqlServer
找到了所有必需的信息 ,可以在本地访问并跟踪所有必需的数据。
不幸的是,一旦我将代码发布到Azure,我就会得到以下异常: UnauthorizedAccessException: Access to the registry key 'Global' is denied
System.UnauthorizedAccessException: Access to the registry key 'Global' is denied.
at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)
at Microsoft.Win32.RegistryKey.InternalGetValue(String name, Object defaultValue, Boolean doNotExpand, Boolean checkSecurity)
at Microsoft.Win32.RegistryKey.GetValue(String name)
at System.Diagnostics.PerformanceMonitor.GetData(String item)
at System.Diagnostics.PerformanceCounterLib.GetPerformanceData(String item)
at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String category)
at System.Diagnostics.PerformanceCounterLib.GetCategorySample(String machine, String category)
at System.Diagnostics.PerformanceCounterCategory.GetCounterInstances(String categoryName, String machineName)
有什么方法可以访问Azure环境中Web应用程序实例的性能计数器?
从https://docs.microsoft.com/zh-cn/azure/application-insights/app-insights-performance-counters :
性能计数器不适用于Azure Web Apps。 但是您可以将Azure诊断发送到Application Insights 。
我知道,云服务或虚拟机将是解决方法-并不是真正的解决方法 ,更像是其他游戏。
您绝对可以在App Service中使用http://azureserviceprofiler.com ,但我不知道您是否在寻找所需的粒度。 不错,尝试一下。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.