2
votes

We installed Application Insights for our Web Application hosted in Azure portal.

Now it sends reports, etc, the application is just started, we don't need all that data. Is there a way to completely stop/disable all data collection/reports by the Application Insights?

My application is ASP.NET Core one, I have a ConnectedService.json file under "Application Insights" folder, with the following content

{
  "ProviderId": "Microsoft.ApplicationInsights.ConnectedService.ConnectedServiceProvider",
  "Version": "8.6.404.2",
  "GettingStartedDocument": {
    "Uri": "https://go.microsoft.com/fwlink/?LinkID=798432"
  }
}
3
Just switch to a new App Insights instance when you publish to Prod so you start with a clean slate.evilSnobu
what do you mean by "switch when you publish".. I don't see any AppInsights configured in the "publish" settingsserge
Right click on your application in Solution Explorer -> Application Insights -> Configure.evilSnobu
I found this "right click" in MyProject>ConnectedServices>ApplicationInsights. But I have no other AppInsights (new) instance, should I create one? I mean, I want just to disable the existingserge
You can remove the instrumentation key from the .config file or code for the time being by making it empty. I take it you do not want to remove it completely since you did create an AI resource.Peter Bons

3 Answers

3
votes

As Far as I know, currently it seems that stop collection report is not supported unless we remove the relationship between WebApp and application insight or remove the application insight. If you stick on stopping the application insight you could give your feedback to Azure team.

The following ways are that remove the relationship between WebApp and application insight or remove the application insight.

If we don't want to use Application Insights to collection the report for the App, we could remove the instrumentation key from the .config file as Peter Bons said.

If we add the application insight as extension we could remove it from the Azure kudu(https://youwebsite.scm.azurewebsites.net). It seems that you are not in this case.

enter image description here

Update:

For Asp.net core project we could remove the InstrumentationKey from the appsettings.json file.

enter image description here

3
votes

You could put a daily cap on your collected data.

It's under Configure -> Features & pricing. You can go as low as 0.0323 GB a day. Which amounts to about 40 cents a month.

This way you don't have to publish your app to stop or start collecting data.

But this way you have to be able to accept a console error.

2
votes

If you want to limit the % of data being received in azure server go to the app->usage and estimated costs and click on Data sampling.

Or to limit the data from the application itself configure the ApplicationInsigths.config file buy adding :

 <MinSamplingPercentage>0.1</MinSamplingPercentage>

<MaxSamplingPercentage>100.0</MaxSamplingPercentage>

https://docs.microsoft.com/en-gb/azure/azure-monitor/app/sampling#configuring-adaptive-sampling-for-aspnet-applications