Application insights without changing the source code - azure

When I have configured application insights by installing the packages to the solution, its working fine and able to capture telemetry data.
Now, I want to integrate application insights with my windows services (running on premises vms) without installing the nuget packages (Microsoft.ApplicationInsights.WindowsServer) or inserting the instrumentation key to the source code. Is it possible?
I have tried to copy all the required dlls (application insights related) to the output directory of my service and used Application Insights configuration to set the instrumentation key but its not sending any telemetry data.

You can integrate your Windows services (on-premises) to send telemetry to App insights, but without installing the NuGet packages and providing Instrumentation key is not possible. There are some other processes to follow too for your use-case.
Refer this official docs,
Applications hosted on premises, in Azure, and in other clouds can all
take advantage of Application Insights. The only limitation is the
need to allow communication to the Application Insights service. For
monitoring Universal Windows Platform (UWP) applications, we recommend
Visual Studio App Center.
Refer this SO thread for better understanding

Related

How to add Azure Application Insights to a .NET Core App?

How does one add Azure Application Insights to a .NET Core App? I want to see search traffic analytics.
An overall solution that would work locally, on both Windows and on Linux* environments, is:
Create an Application Insights account.
Install the Microsoft.ApplicationInsights.AspNetCore NuGet package
Using Dependency Injection, register the Application Insights client into the service collection. You can find a very good example on how to do this on Andrew Lock's blog.
Register Application Insights telemetry insight your Startup class. It will work out of the box for you later on.
services.AddApplicationInsightsTelemetry();
Add ApplicationInsights in your appsettings file, and InstrumentationKey inside of it (Your instrumentation key can be found in the overview tab of your resource):
"ApplicationInsights": {
"InstrumentationKey": "…"
},
Now, if you run your application, you will be able to capture all traffic in your Application Insights account.
* On Linux, this is currently in preview on Azure, but this would work.
It's the same way you do for ASP.NET app. Did you have a chance to look at Start Monitoring Your ASP.NET Core Web Application which includes the same steps
Create AppInsights
Enable AppInsights
Configure App Insights SDK
Open your project in Visual Studio, right click in project you want to add the Application insights and click Publish. Go to Connected Services, inside Service Dependencies, click Add Dependency and select Application Insights Sdk (Local) as shown in the screenshot below.
Click Next then click Finish to install the required Nuget packages and you're done.

Old version of Azure application Insights performance profiler for which application?

I have an Application Insights in Azure. There are some ASP.NET web applications deployed in Azure virtual machine which sends data to that Application Insights.
The problem is when I am going to 'Configure Application Insights Profiler' (under 'performance' tab and then 'configure profiler') in the Application Insights, it is showing me a message 'We detected one or more of your apps are using an older profiler agent. You must be on latest agent to get the new trigger-based profiling feature. Click here to learn more'.
When I am going to the link it is asking to check Windows Azure Diagnostics (WAD) extension version in the virtual machine location 'C:\Packages\Plugins\Microsoft.Azure.Diagnostics.IaaSDiagnostics'.
I have created a list of applications which are having the INSTRUMENTATION KEY in their web.config of the particular Application Insights. I logged into each of the virtual machines where those applications are deployed and checked the location. All of them are having the latest Windows Azure Diagnostics (WAD) extension installed on them.
At this point I have no idea about the reason of the message. Can you tell me, is there a easy way to check for which application it is showing the message?
Hi #DeveloperArnab are you still facing this issue? This is usually caused by one of your applications being on an older version of the agent or one of the apps sampling out application insights telemetry

How does adding the Microsoft.ApplicationInsights NuGet for a .Net WebAPI project interfere with activating AI via the Azure Portal?

BASIC DESCRIPTION/CONFIGURATION:
We have a .Net Framework 4.6.1 (based upon ServiceStack) WebAPI hosted as Azure WebApp in the Cloud.
Each release-version of our API gets its own Application Insights telemetry endpoint, but we never activate Application Insights for our project in Visual Studio. Instead, after swapping a new releasable version from the staging to the production slot, we activate Application Insights via the Azure Portal, and by that we automatically receive all the request-telemetry that we need out of the box. In the configuration section of our WebApp I can see that some AI-specific Keys were added, most importantly the “APPINSIGHTS_INSTRUMENTATIONKEY”.
This used to work fine. Now I had to implement a feature to be able to send some custom information from our code to application insights.
Herefor I added the Microsoft.ApplicationInsights NuGet package (2.13.1) to our project. In our first scenario I send a custom exception via:
_telemetryClient.TrackException(…)
To test the new feature I created a Development Application Insights resource in the cloud and added the corresponding instrumentation key to our app.config. This works as expected and I can see the exception which I send here in the AI-Instance in the cloud.
NOW THE PROBLEM:
When I publish the app with the new feature to the staging slot in the cloud an then activate application insights via the portal, then I do not receive any standard request-telemetry data any more, only my custom exceptions.
1.) How is request data collected anyway when activating AI via the portal? I cannot find any dlls which would be added to our app hereby, so I suppose that the IIS-Server which hosts our web app collects and transmits the data?
2.) Does the server detect that there is a Microsoft.ApplicationInsights.dll in our code and by that stop collecting the request data because it expects that we handle this in our code ourselves?
The main reason why I do not want to simply activate the full-stack Application Insights feature for our project in Visual Studio is, that it installs a lot of dependencies which trigger DLL-Hell because we need some older versions for these dlls for other dependcies in our app (System.Net.Http for example)

Application Insight - work for .NET Core, but not for website in Service Fabric

I am trying to record requests from a ServiceFabric into Application Insight and have no success.
I have build two apps, one .NET Core 2.1 WebApi with configured Application Insight resources and correct instrumentation key. When I debug it, the requests/exceptions are stored in the Azure application insights.
Then I have a basic website at ServiceFabric. It has same packages and is configured with same application insights resource, but I never see any requests/exceptions from the SF application in the Application Insights.
Both applications say that I am 100% configured (menu Project->Application Insights->Configure Application Insights...) and both use jahav-voting-ai (resource) in voting-rg (resource group).
I have tried to troubleshoot with the
https://learn.microsoft.com/en-us/azure/application-insights/app-insights-asp-net-troubleshoot-no-data but no success (probably because I am very new to both SF and AI).
The Service Fabric project doesn't have Microsoft.ApplicationInsights.ServiceFabric.Native as described in the tutorial, I have tried it but it didn't help at all.
Basically I don't know what is missing from the the most basic .NET Core SF project to make it record requests/exceptions to AI.
I have found several projects that use .NET Framework (that work and record requests/exceptions to AI), but nothing for .NET Core.
The archive with both projects.
TL;DR: Add .UseApplicationInsights() to the WebHost building so the Application Insights will be integrated to the OWIN pipeline.
There is a difference in how the Cloud -> ASP.NET Core Web Application template and the Cloud->Service Fabric Application template behaves when user adds the Application Insight telemetry.
The project created from the Cloud -> ASP.NET Core Web Application template will have .UseApplicationInsights() added to the BuildWebHost() method in the Program.cs, whereas the project created from the Cloud->Service Fabric Application template won't.
Therefore, the .NET Core project hosted in Azure did collect telemetry and the Service Fabric didn't. The difference is the missing directive to use application insights while building the web host.

How to add the instrumentation key in Windows Dev Center Dashboard / Usage page to Azure Portal?

I have published an app to Windows Store. Subscribed to Azure.
It seems I can only deploy/create new Application Insights resource.
How to add/link the instrumentation key found in Windows Dev Center App Analytics / Usage page to Azure Portal / Application Insights?
If you follow the standard getting started flow for Application Insights. Use the InstrumentationKey that the AI portal provides. Specify the iKey in the ApplicationInsights.config file. If the key is in the .config file, the Windows Dev Center should pick up the key as part of the ingestion / publishing process.
As one of the comments indicated, you can use these instructions to add Application Insights Nuget to your application and insert the instrumentation key in code or in ApplicationInsights.config file.
However please note that while you can still use Application Insights for Windows Store apps, we are recommending that you onboard to this Nuget and start using HockeyApp for Windows Store apps:

Resources