Is it possible to turn Application Insights off from an external source?

Pablo Arenas 1 Reputation point
2024-10-18T18:50:20.7066667+00:00

Is it possible to to turn off application insights remotely?

I am trying to find a way (if there is any) to toggle TelemetryConfiguration.Active.DisableTelemetry = false via remote, I've been told that having an endpoint is futile because we won't necessarily have access to the customer's system.

The intention for this is, in case that a customer is reaching our data cap in Azure logs, for us to be able to turn telemetry off from our side without having to ask them to remove the instrumentation key and restart the service, or any other thing that involves the customer.

I hope my question makes sense.

Thanks!

Azure Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,396 questions
Azure App Configuration
Azure App Configuration
An Azure service that provides hosted, universal storage for Azure app configurations.
240 questions
{count} votes

1 answer

Sort by: Most helpful
  1. hossein jalilian 9,310 Reputation points
    2024-10-18T20:54:43.5566667+00:00

    Thanks for posting your question in the Microsoft Q&A forum.

    There are a few options to remotely disable or manage Application Insights telemetry, but they have some limitations:

    • You could potentially use Azure App Configuration to store a configuration flag that controls whether Application Insights is enabled or disabled. Your application would need to be set up to check this configuration value periodically and toggle telemetry on/off accordingly
    • You could potentially change or invalidate the instrumentation key remotely. This would effectively stop data from being sent to Application Insights, though it wouldn't technically "disable" it in the application.
    • Azure Monitor provides some capabilities for managing Application Insights resources, but it doesn't appear to offer a direct way to disable telemetry remotely
    • If your application exposes an API, you could potentially create an endpoint that toggles Application Insights on/off. However, as you mentioned, this may not be feasible if you don't have direct access to the customer's system

    Please don't forget to close up the thread here by upvoting and accept it as an answer if it is helpful

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.