Search code examples
azureazure-functionsazure-application-insights.net-6.0

Azure Functions Dependency Tracking for SQL Server and Service Bus Into Application Insights


Previously I have Azure Web App (.net core) and It successfully track the SQL Server and Service Bus dependency into Application Insights. It is not working some how with Azure Functions.

Environment

  • dotnet 6
  • dotnet-isolated mode
  • log level default set to "Information".
  • Azure Environment using Consumption plan for Azure Functions.
  • Application Insights key is configured.

I have Azure API management at front and backend is Azure Function and that call SQL Server and Service Bus.

  • Api Management Service to Azure function dependency successfully resolved but Azure Function to other component is not working.

Solution

  • I know I am posting my own answer. Also there are chance that in future there may be some good solution or it get integrated the way it is in in-process mode.

    By then follow steps.

    1. Add Package
    Microsoft.ApplicationInsights.WorkerService
    
    1. In program.cs in configuring host.
    services.AddApplicationInsightsTelemetryWorkerService();
    

    More info at https://learn.microsoft.com/en-us/azure/azure-monitor/app/worker-service