{"id":16475,"date":"2017-12-07T15:00:00","date_gmt":"2017-12-07T15:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/premier_developer\/?p=16475"},"modified":"2019-03-01T13:59:41","modified_gmt":"2019-03-01T20:59:41","slug":"azure-application-insights-best-practices","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/premier-developer\/azure-application-insights-best-practices\/","title":{"rendered":"Azure Application Insights Best Practices"},"content":{"rendered":"<p>In this post, Premier Developer consultant <a href=\"https:\/\/www.linkedin.com\/in\/adel-ghabboun-44082916\/\" target=\"_blank\" rel=\"noopener\">Adel Ghabboun<\/a> outlines some best practices when using Application Insights.<\/p>\n<hr \/>\n<p>Here are some <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/application-insights\/app-insights-overview\">Azure Application Insights<\/a> best practices you should consider when monitoring your application:<\/p>\n<ol>\n<li>It is always recommended to create multiple Application Insights resources to split telemetry for different environments, but do we have to? The answer is, it depends\n<ul>\n<li>You can use a single resource, and use custom dimensions to tag the data source<\/li>\n<li>Or create multiple Application Insights resources, to split the telemetry into dev\/test\/prod, back-end\/front-end, etc. With this option you get\n<ul>\n<li>Better separation of telemetry, alerts, work items configuration, permissions (RBAC)<\/li>\n<li>Spread Limits such as web test count, throttling, data allowance.<\/li>\n<li>You can do <a href=\"https:\/\/azure.microsoft.com\/en-us\/blog\/query-across-resources\/\">cross-resource queries<\/a><\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<\/li>\n<li>Often, we ask if we need <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/application-insights\/app-insights-monitor-performance-live-website-now\">Status Monitor<\/a> tool when your app is instrumented with the SDK. It depends on which version of .NET is being used.\n<ul>\n<li>If you use .NET 4.5, no dependencies are collected with the SDK, so the Status Monitor is needed here to collect detailed dependency info.<\/li>\n<li>If you use .NET 4.6, SDK collects basic info about outbound HTTP and SQL calls (Note, for more detailed dependency info, you need Status Monitor tool)<\/li>\n<\/ul>\n<\/li>\n<li>Set a capping limit for your dev\/test environment, <b>NOT<\/b> for your prod environment, otherwise you end up losing data once you reach the limit.<\/li>\n<li>Microsoft recommends using <a href=\"https:\/\/hockeyapp.net\/\">HockeyApp<\/a> for monitoring Windows desktop apps (WinForms, WPF, Console). Although telemetry can be sent to Application Insights from a desktop application using the following steps:\n<ul>\n<li>Create Application Insights resource in the Portal<\/li>\n<li>Add the <i>Microsoft.ApplicationInsights.WindowsServer <\/i>NuGet<\/li>\n<li>Update the instrumentation Key<\/li>\n<li>Instantiate a TelemtryClient in your app<\/li>\n<li>Use the API to send custom telemetry<\/li>\n<li>More info is found <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/application-insights\/app-insights-windows-desktop\">here<\/a><\/li>\n<\/ul>\n<\/li>\n<li>In case you can\u2019t see your data such as dependencies, perf counters, it is always a good practice to\n<ul>\n<li>Check your firewall practice<\/li>\n<li>Check the iKey is configured properly<\/li>\n<li>Make sure the user account under which IIS is running has privileges to access the internet<\/li>\n<li>Make sure you are calling the Flush method periodically.<\/li>\n<\/ul>\n<\/li>\n<li>Don\u2019t configure alerts you have no need for. You might end up receiving hundreds of daily email notifications you don\u2019t need, and lose track of urgent ones.<\/li>\n<li>Always think <b><u>Security<\/u><\/b> and set up your Application Insights resource permissions via <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/active-directory\/role-based-access-control-configure\">RBAC<\/a> to specify who can see your data.<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>In this post, Premier Developer consultant Adel Ghabboun outlines some best practices when using Application Insights. Here are some Azure Application Insights best practices you should consider when monitoring your application: It is always recommended to create multiple Application Insights resources to split telemetry for different environments, but do we have to? The answer is, [&hellip;]<\/p>\n","protected":false},"author":581,"featured_media":37840,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[13,81,24],"class_list":["post-16475","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-permierdev","tag-adel-ghabboun","tag-application-insights","tag-azure"],"acf":[],"blog_post_summary":"<p>In this post, Premier Developer consultant Adel Ghabboun outlines some best practices when using Application Insights. Here are some Azure Application Insights best practices you should consider when monitoring your application: It is always recommended to create multiple Application Insights resources to split telemetry for different environments, but do we have to? The answer is, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/16475","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/comments?post=16475"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/posts\/16475\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media\/37840"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/media?parent=16475"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/categories?post=16475"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/premier-developer\/wp-json\/wp\/v2\/tags?post=16475"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}