Azure-docs: Is JavaScriptSnippet.FullScript Deprecated?

Created on 26 Apr 2019  Â·  5Comments  Â·  Source: MicrosoftDocs/azure-docs

This quickstart suggests inserting a JS blob into the page to initiate tracking. Is the use of JavaScriptSnippet.FullScript not recommended/deprecated?

Sample

@inject Microsoft.ApplicationInsights.AspNetCore.JavaScriptSnippet JavaScriptSnippet
<!DOCTYPE html>
<html lang="en">
<head>
// ... other header content
@Html.Raw(JavasScriptSnippet.FullScript)
// ... other header content
</head>

Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 application-insightsvc cxp doc-enhancement in-progress triaged

Most helpful comment

Nope, not deprecated, the most up-to-date recommendation from the engineering team is here and is using the method you described: https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core-no-visualstudio#enable-client-side-telemetry-for-web-applications.

If using the Visual Studio Application Insights configuration approach that is described in the Quickstart the client-side JS will automatically get added for you so the JS blob insertion is not necessary. I will pull that from this quickstart as it is likely causing confusion. Thanks for calling that out!

All 5 comments

Nope, not deprecated, the most up-to-date recommendation from the engineering team is here and is using the method you described: https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core-no-visualstudio#enable-client-side-telemetry-for-web-applications.

If using the Visual Studio Application Insights configuration approach that is described in the Quickstart the client-side JS will automatically get added for you so the JS blob insertion is not necessary. I will pull that from this quickstart as it is likely causing confusion. Thanks for calling that out!

The change to fix this is merged internally, it will go-live in the public docs between 3-4 PM (UTC-7). Thanks again for helping make our docs better!

@itanex Thank you for reaching out to us! If you have any further questions, please tag me in your reply and we will be happy to continue the conversation.

@kobulloc-MSFT So do we need to add this or not, documentation still has it listed....

@bbakermmc if you add Application Insights to an ASP.NET Core template based project via Visual Studio using the Add > Application Insights Telemetry enablement experience client-side monitoring is automatically added for you, but you can always check _ViewImports.cshtml _Layout.cshtml to confirm.

If you add Application Insights manually in VS Code or with some other IDE you need to follow the steps to add client-side monitoring described here:

https://docs.microsoft.com/en-us/azure/azure-monitor/app/asp-net-core#enable-client-side-telemetry-for-web-applications

The doc for how to monitor .NET Core without Visual Studio was consolidated into this doc after this PR thread was closed. In retrospect the H2 should be modified to ##Enable client-side telemetry for web applications (No Visual Studio) to make clear this should only be needed for non Visual Studio projects. Or projects not based on the standard ASP.NET VS templates. I will take care of that to avoid further confusion. Thanks for calling this out!

Was this page helpful?
0 / 5 - 0 ratings