使用Azure Application Insight监控on-Premises网站

时间:2016-02-25 14:49:56

标签: azure azure-application-insights

我正在尝试使用Azure Application Insight监控本地网站(非公开)。我创建了一个网络测试,用于ping内部部署网站。但是,Web测试失败并出现以下错误:

System.Net.WebException: Unable to connect to the remote server --->
System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 9.9.9.9:999 at 
System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)

at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)

--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.VisualStudio.TestTools.WebStress.WebTestTransaction.ResponseReceived(IAsyncResult result)

2 个答案:

答案 0 :(得分:1)

确保您可以在浏览器中连接到Application Insights Availability Web Test的URL。如果无法从Internet访问URL,则Application Insights Web Test将无法运行。 Application Insights需要能够访问您在Internet上指定的URL,因此任何内部仅可访问的地址都不起作用。

答案 1 :(得分:0)

根据您的特定要求,您可以在DMZ或环境中的其他计算机上添加Web服务的中间层,该计算机可以访问Azure公共资源以及内部资源。通过此Web服务,只需使用每个不同页面请求或事件的自定义数据调用应用程序洞察代码。然后从您的应用程序尝试调用此Web服务。

此外,由于您的资源是内部资源而无法访问Azure App Insights,因此您应该在内部运行Web测试而不是在线版本。

这不是一个理想的解决方案,但应该适用于您的情况。