{"id":153,"date":"2015-01-07T11:53:08","date_gmt":"2015-01-07T11:53:08","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2015\/01\/07\/application-insights-and-azure-websites\/"},"modified":"2022-05-25T05:23:36","modified_gmt":"2022-05-25T13:23:36","slug":"application-insights-and-azure-websites","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/application-insights-and-azure-websites\/","title":{"rendered":"Application Insights and Azure WebSites"},"content":{"rendered":"<p>Azure WebSites is a popular \u201cfully managed Platform-as-a-Service (PaaS) that enables you to build, deploy and scale enterprise-grade web Apps in seconds\u201d (see more about Azure WebSites <a href=\"http:\/\/azure.microsoft.com\/en-us\/services\/websites\/\">here<\/a>).\u00a0 <a href=\"http:\/\/azure.microsoft.com\/en-us\/services\/application-insights\/\">Application Insights<\/a> is a preview service available in the Azure Preview portal designed to help development teams get 360\u00b0 views of their applications across Availability, Performance and Usage with fast &amp; powerful troubleshooting, diagnostics and usage insights.\u00a0 While Application Insights could be used to understand if your web App was available and successful when deployed as an Azure WebSite the ability to get deep application performance management (APM) insights was limited and was a popular ask on the <a href=\"https:\/\/aka.ms\/aiuservoice\">Application Insights user voice<\/a>.<\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/01\/1638.image_thumb_4C981773.png\" width=\"724\" height=\"151\" \/><\/p>\n<p><strong>Introducing the Application Insights Azure WebSite extension\u2026..<\/strong>now it is possible to enable deeper performance management scenarios when your web App is deployed to an Azure WebSite.\u00a0 After enabling the Azure WebSite extension (detailed steps below) you\u2019ll be able to see statistics and details on your codes application dependencies.\u00a0 These application dependencies are automatically discovered.\u00a0 Below is screenshot that shows the amount of time spent in a SQL dependency including the number of SQL calls and related statistics such as the average duration and standard deviation.\u00a0<\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/01\/5270.image_thumb_1A3443F4.png\" width=\"392\" height=\"486\" \/><\/p>\n<p>\u00a0<\/p>\n<p>Also see calls to your code remote dependencies from individual requests:<\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/01\/3223.image_thumb_4ED4A02F.png\" width=\"764\" height=\"511\" \/><\/p>\n<p>\u00a0<\/p>\n<p>If you have an Azure WebSite and would like to enable Application Insights follow these steps:<\/p>\n<p>1) Onboard your application to Application Insights from Visual Studio 2013 Update 3 or later and deploy to an Azure WebSite.<\/p>\n<blockquote>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/01\/7848.image_thumb_11474266.png\" width=\"564\" height=\"495\" \/><\/p>\n<p>Note:\u00a0 If your application onboarded to Application Insights already ensure you are using the .12 SDK (or later).\u00a0 See this post <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/12\/11\/updated-application-insights-status-monitor-to-support-12-and-later-application-insights-sdk.aspx\">here<\/a> for instructions on how to update the SDK version.\u00a0<\/p>\n<\/blockquote>\n<p>2) Enable the Application Insights Extension on the Azure WebSite blade (not the Application Insight blade) for the website that was enabled for Application Insights with the .12 or later SDKs:<\/p>\n<blockquote>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/01\/2642.image_thumb_30F61C2E.png\" width=\"400\" height=\"396\" \/><\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/01\/5126.image_thumb_4C9AA824.png\" width=\"778\" height=\"381\" \/><\/p>\n<\/blockquote>\n<p>Ensure the extension is successfully installed through the notification:<\/p>\n<blockquote>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/01\/0820.image_thumb_77730C36.png\" width=\"396\" height=\"223\" \/><\/p>\n<\/blockquote>\n<p>3) Now the extension is enabled execute a few requests against your web App and navigate to your Application Insights resource blade:\u00a0<\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/01\/6303.image_thumb_1317982D.png\" width=\"453\" height=\"397\" \/><\/p>\n<p>Scroll down to the Performance lens and drill into the first or second chart to drill into the Metrics Explorer to see your code dependencies:<\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/01\/1106.image_thumb_19CAA1B0.png\" width=\"413\" height=\"191\" \/><\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/01\/8054.image_thumb_39797B78.png\" width=\"455\" height=\"525\" \/><\/p>\n<p>\u00a0<\/p>\n<p>Now you can use Application Insights for APM scenarios against your Azure website web Apps and understand if performance issues are due to your app code or a dependency your app uses.\u00a0<\/p>\n<p>For questions and\/or feedback, please visit the <a href=\"http:\/\/social.msdn.microsoft.com\/Forums\/en-US\/ApplicationInsights\/\">Application Insights Forum<\/a> and for feature requests check out our <a href=\"http:\/\/visualstudio.uservoice.com\/forums\/121579-visual-studio\/category\/77108-application-insights\">User Voice<\/a>!<\/p>\n<p>\u00a0<\/p>\n<p>**Notes: **<\/p>\n<ul>\n<li>If you have an application that you\u2019d like to enable to Application Insights but do not have a visual studio project for it (eg. it is a gallery based app) here\u2019s a blog post by Sergey Kanzhelev on a workaround to use: <a href=\"http:\/\/apmtips.com\/blog\/2014\/12\/28\/application-insights-extension-for-azure-websites\/\" title=\"http:\/\/apmtips.com\/blog\/2014\/12\/28\/application-insights-extension-for-azure-websites\/\">http:\/\/apmtips.com\/blog\/2014\/12\/28\/application-insights-extension-for-azure-websites\/<\/a> <\/li>\n<li>The Application Insights extension works for Azure WebSites that are using .NET.\u00a0 There is early support for other technologies including <a href=\"https:\/\/www.npmjs.org\/package\/applicationinsights\">Node.JS<\/a>, <a href=\"https:\/\/github.com\/Microsoft\/AppInsights-PHP\">PHP<\/a>, <a href=\"https:\/\/pypi.python.org\/pypi\/applicationinsights\">Python<\/a> and a gallery site: <a href=\"https:\/\/wordpress.org\/plugins\/application-insights\/\">WordPress<\/a>. <\/li>\n<\/ul>\n<p>\u00a0<\/p>\n<p><strong>Troubleshooting:<\/strong><\/p>\n<ul>\n<li>Windows Performance counter collection isn\u2019t supported on an Azure WebSite.\u00a0 You will see the following trace messages from diagnostic search: <\/li>\n<\/ul>\n<blockquote>\n<p><font face=\"Courier New\">AI: Performance counter ASP.NET Applications(_LM_W3SVC_1573813296_ROOT)Request Execution Time has failed to register with performance collector. Please make sure it exists. Technical details: Failed to register performance counter. Category: ASP.NET Applications, counter: Request Execution Time, instance: _LM_W3SVC_1573813296_ROOT.<\/font><\/p>\n<p><img decoding=\"async\" title=\"image\" style=\"border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px\" border=\"0\" alt=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2015\/01\/4188.image_thumb_29D97067.png\" width=\"718\" height=\"420\" \/><\/p>\n<p>To configure Application Insights to not collect the default set of Performance Counters remove this line from ApplicationInsights.config.<\/p>\n<p><font face=\"Courier New\"><Add Type=\"Microsoft.ApplicationInsights.Extensibility.PerfCollector.PerformanceCollectorModule, Microsoft.ApplicationInsights.Extensibility.PerfCollector\" \/><\/font><\/p>\n<\/blockquote>\n<ul>\n<li><a href=\"http:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/app-insights-get-started\/\">Application Insights getting started<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Azure WebSites is a popular \u201cfully managed Platform-as-a-Service (PaaS) that enables you to build, deploy and scale enterprise-grade web Apps in seconds\u201d (see more about Azure WebSites here).\u00a0 Application Insights is a preview service available in the Azure Preview portal designed to help development teams get 360\u00b0 views of their applications across Availability, Performance and [&hellip;]<\/p>\n","protected":false},"author":132,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[224,1],"tags":[],"class_list":["post-153","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure","category-devops"],"acf":[],"blog_post_summary":"<p>Azure WebSites is a popular \u201cfully managed Platform-as-a-Service (PaaS) that enables you to build, deploy and scale enterprise-grade web Apps in seconds\u201d (see more about Azure WebSites here).\u00a0 Application Insights is a preview service available in the Azure Preview portal designed to help development teams get 360\u00b0 views of their applications across Availability, Performance and [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/153","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/132"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=153"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/153\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}