Using application Insights under ASP.

Source: Internet
Author: User
Tags configuration settings

In Visudio Studio, the new ASP. NET core can have built-in application Insights. Application insights can help us to apply the performance of the Web application so that we optimize our application, this is step by step.

Code-side

  1. new ASP. NET Core project (ASP. NET Core 1.1 version)

    650) this.width=650; "title=" Ai1.png "src=" http://s2.51cto.com/wyfs02/M02/8D/59/ Wkiom1iyfnrqdo-haalyulkw9rq031.png-wh_500x0-wm_3-wmp_4-s_2140599624.png "alt=" Wkiom1iyfnrqdo-haalyulkw9rq031.png-wh_50 "/>

    Step three configuration settings, you can select your own resource group on Azure.

    (note: the current ASP. NET core New project is version 1.0 and can be upgraded to version 1.1 in NuGet)

  2. Set Starup.cs, when the auto-generated application insights a bit of a problem, just need to configure method two applicationinsights related functions to delete (this time these two function hints expire)

  3. Modify the code in _viewimports.cshtml as follows:

@ using Applicationinsightsdemo

@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers

@inject Microsoft.ApplicationInsights.AspNetCore. Javascriptsnippet Javascriptsnippet

    1. Modify _layout.cshtml

put @ html.applicationinsightsjavascript (telemetryconfiguration)

Switch

@ Html.raw (javascriptsnippet.fullscript)

Azure-side

Go to your own Azure portal

  1. 650) this.width=650; "title=" Ai2.png "src=" http://s4.51cto.com/wyfs02/M02/8D/56/ Wkiol1iyfqiirbutaaqjz4mo5jq849.png-wh_500x0-wm_3-wmp_4-s_4131369035.png "alt=" Wkiol1iyfqiirbutaaqjz4mo5jq849.png-wh_50 "/>

  2. View overview

    650) this.width=650; "title=" Ai3.png "src=" http://s1.51cto.com/wyfs02/M00/8D/59/ Wkiom1iyfrrc68esaarcbwodjzo639.png-wh_500x0-wm_3-wmp_4-s_2582052664.png "alt=" Wkiom1iyfrrc68esaarcbwodjzo639.png-wh_50 "/>

  3. Performance (can be patient point of the indicators, always bring you surprise)


    650) this.width=650; "title=" Ai4.png "src=" http://s4.51cto.com/wyfs02/M02/8D/56/ Wkiol1iyfz7jw7gqaafofgsqc2e131.png-wh_500x0-wm_3-wmp_4-s_883738783.png "alt=" Wkiol1iyfz7jw7gqaafofgsqc2e131.png-wh_50 "/>

    Now there is a problem, because after testing in VS, many of the applicationinsights metrics on Azure are not immediately presented, it takes a while (and also has a certain relationship with the location of the resource group I chose, right-click Domestic test Harness)


This article is from the "Gui Suewei" blog, make sure to keep this source http://axzxs.blog.51cto.com/730810/1895428

Using application Insights under ASP.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.