locked
(New Azure Portal) Application Insights & Azure Cloud Service Deployment RRS feed

  • Question

  • Good evening,

    the previous VS Online based AI provided instructions how to install the MMA upon Cloud Service Deployment / VM creation etc (re: UnifiedBootstrap.bat etc, see http://blogs.msdn.com/b/visualstudioalm/archive/2014/04/16/new-agent-for-application-insights-available.aspx).

    Is this still needed one way or another for the new, Azure Portal based AI?

    Thanks,

    -Jörg

    Saturday, November 15, 2014 8:35 PM

Answers

  • Hello Jörg,

    MMA agent is not required to send data to the new AI pipeline.

    The new approach is to call AI SDK methods to log the data to AI. SDK configuration will also allow you to change Instrumentation key programmatically from inside of your application to avoid XML manipulation with applicationinsights.config.

    Also, there are several AI nuget packages on top of SDK that enable auto-collection of performance/exception/dependencies data for certain application technologies (like Microsoft.ApplicationInsights.Web.nupkg).

    If you need to work in agent-like approach and would like to onboard a running app to AI - then you can download Application Insights Status Monitor from Web Platform Installer feed to your server and select the application(s) to onboard. This will apply AI auto-collection nuget packages but, certainly, it won't have any custom tracking that might've been added during app development time with AI SDK calls.

    P.S. The data flow from MMA is only supported in VSO Application Insights but not Azure Portal (at least at this point in time).


    Dmitry Matveev


    Monday, November 17, 2014 6:55 PM

All replies

  • Hello Jörg,

    MMA agent is not required to send data to the new AI pipeline.

    The new approach is to call AI SDK methods to log the data to AI. SDK configuration will also allow you to change Instrumentation key programmatically from inside of your application to avoid XML manipulation with applicationinsights.config.

    Also, there are several AI nuget packages on top of SDK that enable auto-collection of performance/exception/dependencies data for certain application technologies (like Microsoft.ApplicationInsights.Web.nupkg).

    If you need to work in agent-like approach and would like to onboard a running app to AI - then you can download Application Insights Status Monitor from Web Platform Installer feed to your server and select the application(s) to onboard. This will apply AI auto-collection nuget packages but, certainly, it won't have any custom tracking that might've been added during app development time with AI SDK calls.

    P.S. The data flow from MMA is only supported in VSO Application Insights but not Azure Portal (at least at this point in time).


    Dmitry Matveev


    Monday, November 17, 2014 6:55 PM
  • Dmitry,

    thanks for the reply and clarification RE: MMA.

    One follow-up question regarding the instrumentation key: when adding AI to an existing ASP.Net Project via VS2013 >= Update 3's built in functionality (Right click on the Project > Add Application Insights) it adds a fairly large ApplicationInsights.config file including an InstrumentationKey (at the very bottom).

    How can I remove that particular InstrumentationKey inside the ApplicationInsights.config and how/when do I set it programmatically for my ASP.Net application?

    (In my use case I have the deployment-specific Instrumentation Key, like all other deployment specific configuration variables, set in my Azure Cloud Service's deployment specific .csdef files and read them during application startup / when needed via Azure's CloudConfigurationManager.)

    Thanks,

    -Jörg

    Monday, November 17, 2014 8:09 PM
  • Jörg,

    If I remember correctly, there are couple places where you can change that.

    One is for telemetry that you submit from your application through SDK calls:

    TelemetryClient client = new TelemetryClient();
    client.Context.InstrumentationKey = "KEY_VALUE";

    Another one is for auto-collected telemetry (ensure to change that before the first request to your app):

    TelemetryConfiguration.Active.InstrumentationKey = ...

    If active configuration key value is set before AI Http Module is initialized - then I think you can even remove the initial key value from ai.Config completely.


    Dmitry Matveev

    Monday, November 17, 2014 8:57 PM
  • Thanks Dmitry!

    I already knew about the TelemetryClient way of doing it (I wrote a serilog (a logging framework similiar to log4net/NLog) Sink for/against it) but here I did mean the auto-collected ones. I'll give that *.Active.InstrumentationKey way a try tomorrow and report back how/if it works.

    Cheers,

    -Jörg

    Monday, November 17, 2014 11:02 PM
  • Dmitry,

    just a quick update - calling

    TelemetryConfiguration.Active.InstrumentationKey = ...

    early in my application did in fact work the way I was hoping for - the events show up in the corresponding AI environment!

    One last question: even though statistics and date do come one, one subsection remains empty the "Dependency Duration" part which, when clicking on the black box with "Learn how to collect dependent resource data." in it shows me to install the aforementioned Status Monitor on my server.

    As this is application is running as an Azure Cloud Service, how would I do that automatically? I can certainly RDP in to & install it manually on the web role machines, but that's not really feasible for larger deployments.

    Is there any way to automate it and/or even better, will these be part of Cloud Service machines automatically in the future?


    • Edited by jbattermann Tuesday, November 18, 2014 5:06 PM minor formatting changes
    Tuesday, November 18, 2014 5:05 PM
  • Jörg,

    Dependency data is collected in couple ways:

    - One does not require Status Monitor component and will collect HTTP Async dependencies;

    - Another one does require Status Monitor component and will collect HTTP Sync and SQL Sync\Async execution.

    If you need this to be on the cloud service - then I'd come up with the startup task that installs StatMon before the application starts.

    Unfortunately, I'm not aware of the AI StatMon MSI location - maybe you can somehow get it when you try manual install with Web PI.

    Can you please file a request on AI User Voice (or vote for existing) to automate such onboarding : AI UV?


    Dmitry Matveev

    Saturday, November 22, 2014 12:24 AM
  • Hi Dmitry,

    Am I correct in concluding that for now in the new azure portal the cpu counters etc won't appear in the appinsights blade / lenses? See my question: https://social.msdn.microsoft.com/Forums/vstudio/en-US/026a4220-797b-4365-8be2-5b97e95dd44c/can-i-get-cpu-memory-and-other-counters-of-my-webrole-in-the-azure-appinsights-dashboard?forum=ApplicationInsights

    Thanks!

    Bart


    bart

    Monday, November 24, 2014 7:07 AM