Stop auto-logging of outgoing requests to cosmos db to app insights from functions call

Manav Goel 1 Reputation point
  • I created azure function in python and enabled app insights.

-- I am making calls to cosmos db within the call stack and doing crud operations on the database. What is happening is the requests to cosmos db are getting logged automatically (including all the headers see the file attached). I dont know how to turn those off as I dont want to log all that information and save on storage for app insights.59380-screenshot-2021-01-21-at-80050-pm.png

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,382 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 69,581 Reputation points

    Hi @Manav Goel

    The runtime automatically collects data on dependencies for bindings that use certain client SDKs like cosmos DB. These dependencies are automatically tracked.
    As per the document if you want to exclude any of the Dependency, Event, Exception, PageView, Request, and Trace then you need to specify it in the host.json from the application insights. You can use applicationInsights.samplingSettings that has parameter excludedTypes with the Value as Request.